@banbox/chat 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +477 -295
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +475 -293
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chat/InboxPopup.tsx +208 -115
- package/src/chat/SinglePopup.tsx +55 -40
- package/src/ui/chat/ChatHeader.tsx +32 -24
- package/src/ui/chat/ChatListHeader.tsx +157 -156
- package/src/ui/chat/ChatScroll.tsx +71 -64
- package/src/ui/chat/TypingIndicator.tsx +36 -17
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { AnimatePresence, motion } from 'framer-motion';
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import React10, { createContext, useContext, useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import
|
|
5
|
+
import clsx16, { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import _Lottie from 'lottie-react';
|
|
8
8
|
|
|
@@ -457,7 +457,7 @@ var ChatTranslateSettingsModal = ({
|
|
|
457
457
|
const content = /* @__PURE__ */ jsxs(
|
|
458
458
|
"div",
|
|
459
459
|
{
|
|
460
|
-
className:
|
|
460
|
+
className: clsx16(
|
|
461
461
|
isSingle ? "fixed inset-0 z-9999 flex" : "absolute inset-0 z-50 flex items-center justify-center"
|
|
462
462
|
),
|
|
463
463
|
onClick: () => onClose(),
|
|
@@ -470,7 +470,7 @@ var ChatTranslateSettingsModal = ({
|
|
|
470
470
|
"aria-modal": "true",
|
|
471
471
|
"aria-labelledby": "translate-settings-title",
|
|
472
472
|
onClick: (e) => e.stopPropagation(),
|
|
473
|
-
className:
|
|
473
|
+
className: clsx16(
|
|
474
474
|
isSingle ? "fixed bottom-6 right-6 w-[500px] max-w-[95vw]" : "relative w-[500px] max-w-[95vw]",
|
|
475
475
|
"z-10000 overflow-visible rounded-md bg-white shadow-[0_12px_30px_rgba(0,0,0,0.18)]",
|
|
476
476
|
className
|
|
@@ -553,7 +553,7 @@ var extColor = (ext) => {
|
|
|
553
553
|
var FilePreviewChip = ({ name, sizeMB, ext, onRemove }) => /* @__PURE__ */ jsxs("div", { className: "mr-2 inline-flex items-center gap-3 whitespace-nowrap rounded-sm border border-[#e1e1e1] bg-white px-3 py-2 h-[65px] max-w-[185px]", children: [
|
|
554
554
|
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
555
555
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
556
|
-
/* @__PURE__ */ jsx(FileIcon, { className:
|
|
556
|
+
/* @__PURE__ */ jsx(FileIcon, { className: clsx16("h-[18px] w-[18px]", extColor(ext)) }),
|
|
557
557
|
" ",
|
|
558
558
|
/* @__PURE__ */ jsx("div", { className: "truncate text-sm font-normal text-black", children: name })
|
|
559
559
|
] }),
|
|
@@ -704,7 +704,7 @@ var ChatComposerBar = ({
|
|
|
704
704
|
{
|
|
705
705
|
type: "button",
|
|
706
706
|
onClick: sendText,
|
|
707
|
-
className:
|
|
707
|
+
className: clsx16(
|
|
708
708
|
"ms-1 grid h-[40px] w-[40px] place-items-center rounded-full text-[#ff5301] hover:bg-[#f8f8f8]"
|
|
709
709
|
),
|
|
710
710
|
title: hasAttachments ? "Send attachments" : "Send",
|
|
@@ -720,7 +720,7 @@ var ChatComposerBar = ({
|
|
|
720
720
|
type: "button",
|
|
721
721
|
onClick: sendAttachments,
|
|
722
722
|
disabled: !hasAttachments,
|
|
723
|
-
className:
|
|
723
|
+
className: clsx16(
|
|
724
724
|
"ms-1 grid h-[40px] w-[40px] place-items-center rounded-full hover:bg-[#f8f8f8]",
|
|
725
725
|
hasAttachments ? "text-[#ff5301]" : "text-[#B9C3D4]"
|
|
726
726
|
),
|
|
@@ -745,7 +745,7 @@ var ChatComposerBar = ({
|
|
|
745
745
|
children: /* @__PURE__ */ jsx(
|
|
746
746
|
RecordMicIcon,
|
|
747
747
|
{
|
|
748
|
-
className:
|
|
748
|
+
className: clsx16(
|
|
749
749
|
"h-6 w-6",
|
|
750
750
|
seconds % 2 === 0 ? "text-[#929292]" : "text-[#ff5301]"
|
|
751
751
|
)
|
|
@@ -1042,7 +1042,7 @@ var EmojiDropup = ({ open, onClose, onSelect, anchorRef, className }) => {
|
|
|
1042
1042
|
ref: panelRef,
|
|
1043
1043
|
role: "dialog",
|
|
1044
1044
|
"aria-label": "Emoji picker",
|
|
1045
|
-
className:
|
|
1045
|
+
className: clsx16("emoji-dropup", className),
|
|
1046
1046
|
style: {
|
|
1047
1047
|
zIndex: "9999",
|
|
1048
1048
|
width: WIDTH2,
|
|
@@ -1186,7 +1186,7 @@ var ReplyCard = ({ refMsg, onClose, compact, className, jumpOnClick }) => {
|
|
|
1186
1186
|
"div",
|
|
1187
1187
|
{
|
|
1188
1188
|
onClick: clickToJump,
|
|
1189
|
-
className:
|
|
1189
|
+
className: clsx16(
|
|
1190
1190
|
widthClamp,
|
|
1191
1191
|
"relative rounded-md bg-[#f8f8f8] px-3",
|
|
1192
1192
|
"border-l-2 border-[#FF5300]",
|
|
@@ -1505,7 +1505,7 @@ var ChatFooter = ({
|
|
|
1505
1505
|
}
|
|
1506
1506
|
setSeconds(0);
|
|
1507
1507
|
};
|
|
1508
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
1508
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx16("border-t border-[#ededed] bg-white p-3.5", className), children: [
|
|
1509
1509
|
replyTo && /* @__PURE__ */ jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsx(ReplyCard_default, { refMsg: replyTo, onClose: clearReply }) }),
|
|
1510
1510
|
/* @__PURE__ */ jsx(
|
|
1511
1511
|
AttachmentPreviewStrip_default,
|
|
@@ -1603,12 +1603,27 @@ var ChatFooter = ({
|
|
|
1603
1603
|
] });
|
|
1604
1604
|
};
|
|
1605
1605
|
var ChatFooter_default = ChatFooter;
|
|
1606
|
-
function ChatHeader({ left, right, below
|
|
1606
|
+
function ChatHeader({ left, right, below }) {
|
|
1607
1607
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1608
|
+
/* @__PURE__ */ jsxs(
|
|
1609
|
+
"div",
|
|
1610
|
+
{
|
|
1611
|
+
style: {
|
|
1612
|
+
borderBottom: "1px solid #e1e1e1",
|
|
1613
|
+
height: 64,
|
|
1614
|
+
display: "flex",
|
|
1615
|
+
alignItems: "flex-start",
|
|
1616
|
+
justifyContent: "space-between",
|
|
1617
|
+
paddingLeft: 16,
|
|
1618
|
+
paddingRight: 16,
|
|
1619
|
+
paddingTop: 10
|
|
1620
|
+
},
|
|
1621
|
+
children: [
|
|
1622
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "flex-start", gap: 12 }, children: left }),
|
|
1623
|
+
right
|
|
1624
|
+
]
|
|
1625
|
+
}
|
|
1626
|
+
),
|
|
1612
1627
|
below && /* @__PURE__ */ jsx(Fragment, { children: below })
|
|
1613
1628
|
] });
|
|
1614
1629
|
}
|
|
@@ -1626,11 +1641,11 @@ var ChatIdentity = (props) => {
|
|
|
1626
1641
|
size = 46,
|
|
1627
1642
|
className
|
|
1628
1643
|
} = props;
|
|
1629
|
-
const subtitleClass =
|
|
1644
|
+
const subtitleClass = clsx16(
|
|
1630
1645
|
"text-[10px] font-medium",
|
|
1631
1646
|
subtitleVariant === "live" ? "text-[#1E9E6A]" : "text-[#929292]"
|
|
1632
1647
|
);
|
|
1633
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
1648
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx16("flex items-start gap-3", className), children: [
|
|
1634
1649
|
/* @__PURE__ */ jsxs("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
1635
1650
|
props.variant === "avatar" && /* @__PURE__ */ jsx(
|
|
1636
1651
|
"img",
|
|
@@ -1643,7 +1658,7 @@ var ChatIdentity = (props) => {
|
|
|
1643
1658
|
props.variant === "initial" && /* @__PURE__ */ jsx(
|
|
1644
1659
|
"div",
|
|
1645
1660
|
{
|
|
1646
|
-
className:
|
|
1661
|
+
className: clsx16(
|
|
1647
1662
|
"grid h-full w-full place-items-center rounded-xs text-[15px] font-semibold text-[#2c2c2c]",
|
|
1648
1663
|
props.textClassName
|
|
1649
1664
|
),
|
|
@@ -1718,7 +1733,7 @@ var ChatInquiryBar = ({ id, onView, className, label, buttonLabel }) => {
|
|
|
1718
1733
|
return /* @__PURE__ */ jsxs(
|
|
1719
1734
|
"div",
|
|
1720
1735
|
{
|
|
1721
|
-
className:
|
|
1736
|
+
className: clsx16(
|
|
1722
1737
|
"flex items-center justify-between border-b border-[#ededed] bg-[#f8f8f8] ps-[16px] pe-[30px] h-[30px]",
|
|
1723
1738
|
className
|
|
1724
1739
|
),
|
|
@@ -1751,7 +1766,7 @@ var ChatInquiryBar = ({ id, onView, className, label, buttonLabel }) => {
|
|
|
1751
1766
|
);
|
|
1752
1767
|
};
|
|
1753
1768
|
var ChatInquiryBar_default = ChatInquiryBar;
|
|
1754
|
-
var ChatListHeader = ({
|
|
1769
|
+
var ChatListHeader = ({ onClose, onSearchChange }) => {
|
|
1755
1770
|
const [searching, setSearching] = React10.useState(false);
|
|
1756
1771
|
const [q, setQ] = React10.useState("");
|
|
1757
1772
|
const inputRef = React10.useRef(null);
|
|
@@ -1764,9 +1779,7 @@ var ChatListHeader = ({ className, onClose, onSearchChange }) => {
|
|
|
1764
1779
|
};
|
|
1765
1780
|
}, [searching]);
|
|
1766
1781
|
React10.useEffect(() => {
|
|
1767
|
-
if (!searching)
|
|
1768
|
-
return;
|
|
1769
|
-
}
|
|
1782
|
+
if (!searching) return;
|
|
1770
1783
|
const onKey = (e) => {
|
|
1771
1784
|
if (e.key === "Escape") {
|
|
1772
1785
|
setSearching(false);
|
|
@@ -1785,91 +1798,117 @@ var ChatListHeader = ({ className, onClose, onSearchChange }) => {
|
|
|
1785
1798
|
inFromLeft: { opacity: 1, x: 0, transition: { duration: 0.18, ease: [0.16, 1, 0.3, 1] } },
|
|
1786
1799
|
outToRight: { opacity: 0, x: 24, transition: { duration: 0.16, ease: [0.4, 0, 1, 1] } }
|
|
1787
1800
|
};
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
className: "h-9 w-9 place-items-center rounded-full hover:bg-black/5 flex items-center justify-center",
|
|
1810
|
-
children: /* @__PURE__ */ jsx(ChatSearchIcon, { className: "w-5 h-5" })
|
|
1811
|
-
}
|
|
1812
|
-
),
|
|
1813
|
-
/* @__PURE__ */ jsx(
|
|
1814
|
-
"button",
|
|
1815
|
-
{
|
|
1816
|
-
title: "Close",
|
|
1817
|
-
onClick: onClose,
|
|
1818
|
-
className: "h-9 w-9 place-items-center rounded-full hover:bg-black/5 flex items-center justify-center",
|
|
1819
|
-
children: /* @__PURE__ */ jsx(ChatXIcon, { className: "w-6 h-6" })
|
|
1820
|
-
}
|
|
1821
|
-
)
|
|
1822
|
-
] })
|
|
1823
|
-
]
|
|
1801
|
+
const btnStyle = {
|
|
1802
|
+
height: 36,
|
|
1803
|
+
width: 36,
|
|
1804
|
+
display: "flex",
|
|
1805
|
+
alignItems: "center",
|
|
1806
|
+
justifyContent: "center",
|
|
1807
|
+
borderRadius: "50%",
|
|
1808
|
+
border: "none",
|
|
1809
|
+
background: "transparent",
|
|
1810
|
+
cursor: "pointer"
|
|
1811
|
+
};
|
|
1812
|
+
return /* @__PURE__ */ jsx(
|
|
1813
|
+
"div",
|
|
1814
|
+
{
|
|
1815
|
+
style: {
|
|
1816
|
+
height: 64,
|
|
1817
|
+
borderBottom: "1px solid #ededed",
|
|
1818
|
+
display: "flex",
|
|
1819
|
+
alignItems: "center",
|
|
1820
|
+
paddingLeft: 20,
|
|
1821
|
+
paddingRight: 20
|
|
1824
1822
|
},
|
|
1825
|
-
"
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
1856
|
-
"button",
|
|
1823
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, { initial: false, mode: "wait", children: !searching ? /* @__PURE__ */ jsxs(
|
|
1824
|
+
motion.div,
|
|
1825
|
+
{
|
|
1826
|
+
style: { display: "flex", width: "100%", alignItems: "center", justifyContent: "space-between" },
|
|
1827
|
+
initial: { opacity: 0, x: -24 },
|
|
1828
|
+
animate: "inFromLeft",
|
|
1829
|
+
exit: "outToLeft",
|
|
1830
|
+
variants,
|
|
1831
|
+
children: [
|
|
1832
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, color: "#2c2c2c" }, children: [
|
|
1833
|
+
/* @__PURE__ */ jsx(MessageIcon, { className: "w-6 h-6" }),
|
|
1834
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: 22, fontWeight: 600 }, children: "Messenger" })
|
|
1835
|
+
] }),
|
|
1836
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
1837
|
+
/* @__PURE__ */ jsx("button", { title: "Search", onClick: () => setSearching(true), style: btnStyle, children: /* @__PURE__ */ jsx(ChatSearchIcon, { className: "w-5 h-5" }) }),
|
|
1838
|
+
/* @__PURE__ */ jsx("button", { title: "Close", onClick: onClose, style: btnStyle, children: /* @__PURE__ */ jsx(ChatXIcon, { className: "w-6 h-6" }) })
|
|
1839
|
+
] })
|
|
1840
|
+
]
|
|
1841
|
+
},
|
|
1842
|
+
"normal"
|
|
1843
|
+
) : /* @__PURE__ */ jsx(
|
|
1844
|
+
motion.div,
|
|
1845
|
+
{
|
|
1846
|
+
style: { display: "flex", width: "100%", alignItems: "center", gap: 12 },
|
|
1847
|
+
initial: { opacity: 0, x: 24 },
|
|
1848
|
+
animate: "inFromRight",
|
|
1849
|
+
exit: "outToRight",
|
|
1850
|
+
variants,
|
|
1851
|
+
children: /* @__PURE__ */ jsxs(
|
|
1852
|
+
"div",
|
|
1857
1853
|
{
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1854
|
+
style: {
|
|
1855
|
+
display: "flex",
|
|
1856
|
+
flex: 1,
|
|
1857
|
+
height: 40,
|
|
1858
|
+
alignItems: "center",
|
|
1859
|
+
borderRadius: 9999,
|
|
1860
|
+
border: "1px solid #6A6A6A",
|
|
1861
|
+
backgroundColor: "#fff",
|
|
1862
|
+
padding: "0 4px",
|
|
1863
|
+
gap: 6
|
|
1863
1864
|
},
|
|
1864
|
-
|
|
1865
|
-
|
|
1865
|
+
children: [
|
|
1866
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", flex: 1, marginLeft: 12 }, children: [
|
|
1867
|
+
/* @__PURE__ */ jsx("span", { style: { marginRight: 8, color: "#929292", flexShrink: 0 }, children: /* @__PURE__ */ jsx(ChatSearchIcon, { className: "w-5 h-5" }) }),
|
|
1868
|
+
/* @__PURE__ */ jsx("span", { style: { marginRight: 8, height: 24, width: 1, flexShrink: 0, backgroundColor: "#e1e1e1" } }),
|
|
1869
|
+
/* @__PURE__ */ jsx(
|
|
1870
|
+
"input",
|
|
1871
|
+
{
|
|
1872
|
+
ref: inputRef,
|
|
1873
|
+
value: q,
|
|
1874
|
+
onChange: (e) => {
|
|
1875
|
+
setQ(e.target.value);
|
|
1876
|
+
onSearchChange?.(e.target.value);
|
|
1877
|
+
},
|
|
1878
|
+
placeholder: "Search",
|
|
1879
|
+
style: {
|
|
1880
|
+
flex: 1,
|
|
1881
|
+
height: "100%",
|
|
1882
|
+
background: "transparent",
|
|
1883
|
+
fontSize: 15,
|
|
1884
|
+
outline: "none",
|
|
1885
|
+
border: "none",
|
|
1886
|
+
color: "#2c2c2c"
|
|
1887
|
+
}
|
|
1888
|
+
}
|
|
1889
|
+
)
|
|
1890
|
+
] }),
|
|
1891
|
+
/* @__PURE__ */ jsx(
|
|
1892
|
+
"button",
|
|
1893
|
+
{
|
|
1894
|
+
title: "Close search",
|
|
1895
|
+
onClick: () => {
|
|
1896
|
+
setSearching(false);
|
|
1897
|
+
setQ("");
|
|
1898
|
+
onSearchChange?.("");
|
|
1899
|
+
},
|
|
1900
|
+
style: { ...btnStyle, height: 32, width: 32 },
|
|
1901
|
+
children: /* @__PURE__ */ jsx(ChatXIcon, { className: "w-5 h-5" })
|
|
1902
|
+
}
|
|
1903
|
+
)
|
|
1904
|
+
]
|
|
1866
1905
|
}
|
|
1867
|
-
)
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
)
|
|
1906
|
+
)
|
|
1907
|
+
},
|
|
1908
|
+
"search"
|
|
1909
|
+
) })
|
|
1910
|
+
}
|
|
1911
|
+
);
|
|
1873
1912
|
};
|
|
1874
1913
|
var ChatListHeader_default = ChatListHeader;
|
|
1875
1914
|
var Row = ({ icon, label, value, highlight }) => {
|
|
@@ -1927,7 +1966,7 @@ var ChatAddressCard = ({ mine, card, className }) => {
|
|
|
1927
1966
|
return /* @__PURE__ */ jsxs(
|
|
1928
1967
|
"div",
|
|
1929
1968
|
{
|
|
1930
|
-
className:
|
|
1969
|
+
className: clsx16(
|
|
1931
1970
|
"w-[340px] rounded-md bg-[#f8f8f8] p-2",
|
|
1932
1971
|
mine ? "ml-auto" : "mr-auto",
|
|
1933
1972
|
className
|
|
@@ -2075,7 +2114,7 @@ var ChatBubbleAudio = ({ mine, audio }) => {
|
|
|
2075
2114
|
type: "button",
|
|
2076
2115
|
"aria-label": playing ? "Pause" : "Play",
|
|
2077
2116
|
onClick: toggle,
|
|
2078
|
-
className:
|
|
2117
|
+
className: clsx16(
|
|
2079
2118
|
"grid h-7 w-[34px] place-items-center rounded-md transition-colors",
|
|
2080
2119
|
mine ? "bg-[#F1F1F1] text-[#00486F]" : "bg-[#F1F1F1] text-[#00486F]"
|
|
2081
2120
|
),
|
|
@@ -2146,7 +2185,7 @@ var extColor2 = (ext) => {
|
|
|
2146
2185
|
var FileChip = ({ file }) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 rounded-sm border border-[#e1e1e1] bg-white px-3 py-2", children: [
|
|
2147
2186
|
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
2148
2187
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
2149
|
-
/* @__PURE__ */ jsx(FileIcon, { className:
|
|
2188
|
+
/* @__PURE__ */ jsx(FileIcon, { className: clsx16("h-[18px] w-[18px]", extColor2(file.ext)) }),
|
|
2150
2189
|
" ",
|
|
2151
2190
|
/* @__PURE__ */ jsx("div", { className: "truncate text-xs font-normal text-black", children: file.name })
|
|
2152
2191
|
] }),
|
|
@@ -2261,14 +2300,14 @@ var ChatBubbleText = ({ mine, text }) => {
|
|
|
2261
2300
|
const color = mine ? "bg-[#f8f8f8] border-[#f1f1f1]" : "bg-white border-[#EFEFEF]";
|
|
2262
2301
|
const corner = mine ? "rounded-tr-[6px]" : "rounded-tl-md";
|
|
2263
2302
|
const textFormatting = "whitespace-pre-wrap break-words";
|
|
2264
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
2303
|
+
return /* @__PURE__ */ jsx("div", { className: clsx16(base, color, corner, textFormatting), children: text });
|
|
2265
2304
|
};
|
|
2266
2305
|
var ChatBubbleText_default = ChatBubbleText;
|
|
2267
2306
|
var ChatBusinessCard = ({ mine, card }) => {
|
|
2268
2307
|
return /* @__PURE__ */ jsx(
|
|
2269
2308
|
"div",
|
|
2270
2309
|
{
|
|
2271
|
-
className:
|
|
2310
|
+
className: clsx16(
|
|
2272
2311
|
"relative h-[208px] w-[355px] overflow-hidden rounded-[12px] bg-white bg-cover bg-no-repeat",
|
|
2273
2312
|
"shadow-[0_2px_12px_rgba(59,51,51,0.1)]",
|
|
2274
2313
|
mine ? "ml-auto" : "mr-auto"
|
|
@@ -2328,13 +2367,13 @@ var MessageHoverActions = ({
|
|
|
2328
2367
|
const showTranslate = !isItemButton || isItemButton.includes("translate");
|
|
2329
2368
|
const hasAny = showReplay || showTranslate;
|
|
2330
2369
|
const isActive = (k) => !!activeButtons?.includes(k);
|
|
2331
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
2370
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx16("relative inline-flex group/message", className), children: [
|
|
2332
2371
|
children,
|
|
2333
2372
|
hasAny && /* @__PURE__ */ jsx(
|
|
2334
2373
|
"div",
|
|
2335
2374
|
{
|
|
2336
2375
|
"aria-hidden": true,
|
|
2337
|
-
className:
|
|
2376
|
+
className: clsx16(
|
|
2338
2377
|
"absolute inset-y-0 w-2",
|
|
2339
2378
|
mine ? "right-full" : "left-full",
|
|
2340
2379
|
"pointer-events-auto"
|
|
@@ -2344,7 +2383,7 @@ var MessageHoverActions = ({
|
|
|
2344
2383
|
hasAny && /* @__PURE__ */ jsx(
|
|
2345
2384
|
"div",
|
|
2346
2385
|
{
|
|
2347
|
-
className:
|
|
2386
|
+
className: clsx16(
|
|
2348
2387
|
"absolute bottom-0 pointer-events-auto transition-opacity",
|
|
2349
2388
|
sidePos,
|
|
2350
2389
|
railNudge,
|
|
@@ -2364,7 +2403,7 @@ var MessageHoverActions = ({
|
|
|
2364
2403
|
e.stopPropagation();
|
|
2365
2404
|
onReply?.();
|
|
2366
2405
|
},
|
|
2367
|
-
className:
|
|
2406
|
+
className: clsx16(
|
|
2368
2407
|
"inline-flex h-[22px] w-[22px] items-center justify-center rounded-sm bg-white text-[#2c2c2c] shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:bg-[#f8f8f8]",
|
|
2369
2408
|
isActive("replay") && "bg-[#636363] text-white"
|
|
2370
2409
|
),
|
|
@@ -2385,7 +2424,7 @@ var MessageHoverActions = ({
|
|
|
2385
2424
|
e.stopPropagation();
|
|
2386
2425
|
onTranslate?.();
|
|
2387
2426
|
},
|
|
2388
|
-
className:
|
|
2427
|
+
className: clsx16(
|
|
2389
2428
|
"inline-flex h-[22px] w-[22px] items-center justify-center rounded-sm bg-white text-[#2c2c2c] shadow-[0_1px_3px_rgba(0,0,0,0.08)] hover:bg-[#f8f8f8]",
|
|
2390
2429
|
isActive("translate") && "!bg-[#636363] text-white"
|
|
2391
2430
|
),
|
|
@@ -2441,7 +2480,7 @@ var ChatMessageItem = ({
|
|
|
2441
2480
|
setTranslated((v) => !v);
|
|
2442
2481
|
onTranslate?.();
|
|
2443
2482
|
};
|
|
2444
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
2483
|
+
return /* @__PURE__ */ jsx("div", { className: clsx16("mb-4", className), "data-msg-id": id, children: /* @__PURE__ */ jsxs("div", { className: clsx16("flex items-end gap-3", mine && "justify-end"), children: [
|
|
2445
2484
|
!mine && /* @__PURE__ */ jsx("div", { className: `${showStatus ? "mb-5" : "mb-0"}`, children: initialSrc ? /* @__PURE__ */ jsxs("div", { className: "relative h-10 w-10 shrink-0 rounded-full border border-[#F1F1F1]", children: [
|
|
2446
2485
|
/* @__PURE__ */ jsx(
|
|
2447
2486
|
"img",
|
|
@@ -2463,19 +2502,19 @@ var ChatMessageItem = ({
|
|
|
2463
2502
|
]
|
|
2464
2503
|
}
|
|
2465
2504
|
) }),
|
|
2466
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
2505
|
+
/* @__PURE__ */ jsxs("div", { className: clsx16("flex flex-col gap-1 w-full"), children: [
|
|
2467
2506
|
/* @__PURE__ */ jsx(
|
|
2468
2507
|
"div",
|
|
2469
2508
|
{
|
|
2470
|
-
className:
|
|
2509
|
+
className: clsx16(
|
|
2471
2510
|
" text-xs font-light text-[#636363]",
|
|
2472
2511
|
mine ? "text-right" : "text-left"
|
|
2473
2512
|
),
|
|
2474
2513
|
children: time
|
|
2475
2514
|
}
|
|
2476
2515
|
),
|
|
2477
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
2478
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
2516
|
+
/* @__PURE__ */ jsxs("div", { className: clsx16("flex flex-col gap-1 w-full", mine ? "items-end" : "items-start"), children: [
|
|
2517
|
+
/* @__PURE__ */ jsx("div", { className: clsx16("flex w-full", mine ? "justify-end" : "justify-start"), children: replyTo && /* @__PURE__ */ jsx(ReplyCard_default, { jumpOnClick: true, refMsg: replyTo, compact: true, className: "mb-1" }) }),
|
|
2479
2518
|
businessCard ? /* @__PURE__ */ jsx(ChatBusinessCard_default, { mine, card: businessCard }) : null,
|
|
2480
2519
|
addressCard ? /* @__PURE__ */ jsx(ChatAddressCard_default, { mine, card: addressCard }) : null,
|
|
2481
2520
|
images?.length ? /* @__PURE__ */ jsx(MessageHoverActions_default, { mine, onReply, isItemButton: ["replay"], children: /* @__PURE__ */ jsx(ChatBubbleImages_default, { images }) }) : null,
|
|
@@ -2492,7 +2531,7 @@ var ChatMessageItem = ({
|
|
|
2492
2531
|
children: /* @__PURE__ */ jsx(ChatBubbleText_default, { mine, text: displayText })
|
|
2493
2532
|
}
|
|
2494
2533
|
) : null,
|
|
2495
|
-
showStatus && /* @__PURE__ */ jsx("div", { className:
|
|
2534
|
+
showStatus && /* @__PURE__ */ jsx("div", { className: clsx16("text-xs text-[#9AA1A9]", mine ? "text-right" : "text-left"), children: status })
|
|
2496
2535
|
] })
|
|
2497
2536
|
] })
|
|
2498
2537
|
] }) });
|
|
@@ -2501,7 +2540,7 @@ var ChatMessageItem_default = ChatMessageItem;
|
|
|
2501
2540
|
var ChatScroll = ({
|
|
2502
2541
|
top,
|
|
2503
2542
|
children,
|
|
2504
|
-
|
|
2543
|
+
style,
|
|
2505
2544
|
bottomAlignWhenShort = false,
|
|
2506
2545
|
scrollKey
|
|
2507
2546
|
}) => {
|
|
@@ -2523,17 +2562,26 @@ var ChatScroll = ({
|
|
|
2523
2562
|
{
|
|
2524
2563
|
ref,
|
|
2525
2564
|
"data-chat-scroll": true,
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2565
|
+
style: {
|
|
2566
|
+
height: "100%",
|
|
2567
|
+
minHeight: 0,
|
|
2568
|
+
overflowY: "auto",
|
|
2569
|
+
backgroundColor: "#fff",
|
|
2570
|
+
padding: 16,
|
|
2571
|
+
// custom scrollbar — hide track for clean look
|
|
2572
|
+
scrollbarWidth: "thin",
|
|
2573
|
+
scrollbarColor: "#d1d5db transparent",
|
|
2574
|
+
...style
|
|
2575
|
+
},
|
|
2530
2576
|
children: /* @__PURE__ */ jsxs(
|
|
2531
2577
|
"div",
|
|
2532
2578
|
{
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2579
|
+
style: {
|
|
2580
|
+
minHeight: "100%",
|
|
2581
|
+
display: "flex",
|
|
2582
|
+
flexDirection: "column",
|
|
2583
|
+
justifyContent: bottomAlignWhenShort ? "flex-end" : "flex-start"
|
|
2584
|
+
},
|
|
2537
2585
|
children: [
|
|
2538
2586
|
top,
|
|
2539
2587
|
children
|
|
@@ -2580,7 +2628,7 @@ var ChatThreadItem = ({
|
|
|
2580
2628
|
"button",
|
|
2581
2629
|
{
|
|
2582
2630
|
onClick,
|
|
2583
|
-
className:
|
|
2631
|
+
className: clsx16(
|
|
2584
2632
|
"relative w-full text-left px-5 py-2 hover:bg-[#f8f8f8] focus:outline-none h-[75px]",
|
|
2585
2633
|
active && "bg-[#f8f8f8]",
|
|
2586
2634
|
className
|
|
@@ -2633,39 +2681,64 @@ var ChatThreadItem_default = ChatThreadItem;
|
|
|
2633
2681
|
var typingdotanimation2_default = { v: "5.12.1", fr: 25, ip: 0, op: 59, w: 400, h: 100, nm: "Composizione 1", ddd: 0, assets: [{ id: "comp_0", nm: "barra", fr: 25, layers: [{ ddd: 0, ind: 1, ty: 4, nm: "barra contorni", sr: 1, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 0, k: 0, ix: 10 }, p: { a: 1, k: [{ i: { x: 0.541, y: 1 }, o: { x: 0.158, y: 0 }, t: 0, s: [47, 189.5, 0], to: [48.333, 0, 0], ti: [-48.333, 0, 0] }, { t: 60, s: [337, 189.5, 0] }], ix: 2, l: 2 }, a: { a: 0, k: [57.25, 4.75, 0], ix: 1, l: 2 }, s: { a: 0, k: [100, 100, 100], ix: 6, l: 2 } }, ao: 0, shapes: [{ ty: "gr", it: [{ ind: 0, ty: "sh", ix: 1, ks: { a: 0, k: { i: [[2.485, 0], [0, 0], [0, 2.485], [-2.485, 0], [0, 0], [0, -2.485]], o: [[0, 0], [-2.485, 0], [0, -2.485], [0, 0], [2.485, 0], [0, 2.485]], v: [[52.5, 4.5], [-52.5, 4.5], [-57, 0], [-52.5, -4.5], [52.5, -4.5], [57, 0]], c: true }, ix: 2 }, nm: "Path 1", mn: "ADBE Vector Shape - Group", hd: false }, { ty: "fl", c: { a: 1, k: [{ i: { x: [0.833], y: [1] }, o: { x: [0.167], y: [0] }, t: 0, s: [0.058823529631, 0.800000011921, 0.807843148708, 1] }, { i: { x: [0.833], y: [0.999] }, o: { x: [0.167], y: [1e-3] }, t: 23, s: [0, 0.419607847929, 0.470588237047, 1] }, { t: 49, s: [0.376470595598, 0.435294121504, 0.482352942228, 1] }], ix: 4 }, o: { a: 0, k: 100, ix: 5 }, r: 1, bm: 0, nm: "Riempimento 1", mn: "ADBE Vector Graphic - Fill", hd: false }, { ty: "tr", p: { a: 0, k: [57.25, 4.75], ix: 2 }, a: { a: 0, k: [0, 0], ix: 1 }, s: { a: 0, k: [100, 100], ix: 3 }, r: { a: 0, k: 0, ix: 6 }, o: { a: 0, k: 100, ix: 7 }, sk: { a: 0, k: 0, ix: 4 }, sa: { a: 0, k: 0, ix: 5 }, nm: "Transform" }], nm: "Gruppo 1", np: 2, cix: 2, bm: 0, ix: 1, mn: "ADBE Vector Group", hd: false }], ip: 0, op: 250, st: 0, ct: 1, bm: 0 }] }], layers: [{ ddd: 0, ind: 1, ty: 0, nm: "barra", refId: "comp_0", sr: 0.89999997615814, ks: { o: { a: 0, k: 100, ix: 11 }, r: { a: 0, k: 0, ix: 10 }, p: { a: 0, k: [201, 50, 0], ix: 2, l: 2 }, a: { a: 0, k: [190, 190, 0], ix: 1, l: 2 }, s: { a: 0, k: [120, 120, 100], ix: 6, l: 2 } }, ao: 0, hasMask: true, masksProperties: [{ inv: false, mode: "a", pt: { a: 0, k: { i: [[2.347, 0], [0, 0], [0, -2.347], [-2.347, 0], [0, 0], [0, 2.347]], o: [[0, 0], [-2.347, 0], [0, 2.347], [0, 0], [2.347, 0], [0, -2.347]], v: [[270.25, 185], [108.75, 185], [104.5, 189.25], [108.75, 193.5], [270.25, 193.5], [274.5, 189.25]], c: true }, ix: 1 }, o: { a: 0, k: 100, ix: 3 }, x: { a: 0, k: 0, ix: 4 }, nm: "Mask 1" }], w: 380, h: 380, ip: 0, op: 59, st: 0, bm: 0 }], markers: [], props: {} };
|
|
2634
2682
|
var Lottie2 = _Lottie.default ?? _Lottie;
|
|
2635
2683
|
var TypingIndicator = ({
|
|
2636
|
-
size = 18,
|
|
2637
2684
|
loop = true,
|
|
2638
2685
|
autoplay = true,
|
|
2639
|
-
className,
|
|
2640
2686
|
ariaLabel = "Typing\u2026",
|
|
2641
|
-
avatarSize = 40
|
|
2687
|
+
avatarSize = 40,
|
|
2688
|
+
style
|
|
2642
2689
|
}) => {
|
|
2643
2690
|
return /* @__PURE__ */ jsxs(
|
|
2644
2691
|
"div",
|
|
2645
2692
|
{
|
|
2646
|
-
className: cn("relative flex items-end gap-[6px]", className),
|
|
2647
2693
|
role: "status",
|
|
2648
2694
|
"aria-label": ariaLabel,
|
|
2695
|
+
style: {
|
|
2696
|
+
position: "relative",
|
|
2697
|
+
display: "flex",
|
|
2698
|
+
alignItems: "flex-end",
|
|
2699
|
+
gap: 6,
|
|
2700
|
+
...style
|
|
2701
|
+
},
|
|
2649
2702
|
children: [
|
|
2650
2703
|
/* @__PURE__ */ jsxs(
|
|
2651
2704
|
"div",
|
|
2652
2705
|
{
|
|
2653
|
-
|
|
2654
|
-
|
|
2706
|
+
style: {
|
|
2707
|
+
position: "relative",
|
|
2708
|
+
flexShrink: 0,
|
|
2709
|
+
borderRadius: "50%",
|
|
2710
|
+
border: "1px solid #F1F1F1",
|
|
2711
|
+
width: avatarSize,
|
|
2712
|
+
height: avatarSize
|
|
2713
|
+
},
|
|
2655
2714
|
children: [
|
|
2656
2715
|
/* @__PURE__ */ jsx(
|
|
2657
2716
|
"img",
|
|
2658
2717
|
{
|
|
2659
2718
|
src: "/chat/img/girl_support.png",
|
|
2660
2719
|
alt: "avatar image",
|
|
2661
|
-
|
|
2720
|
+
style: { height: "100%", width: "100%", borderRadius: "50%", objectFit: "cover" }
|
|
2662
2721
|
}
|
|
2663
2722
|
),
|
|
2664
|
-
/* @__PURE__ */ jsx(
|
|
2723
|
+
/* @__PURE__ */ jsx(
|
|
2724
|
+
"span",
|
|
2725
|
+
{
|
|
2726
|
+
style: {
|
|
2727
|
+
position: "absolute",
|
|
2728
|
+
bottom: 0,
|
|
2729
|
+
right: 0,
|
|
2730
|
+
height: 11.25,
|
|
2731
|
+
width: 11.25,
|
|
2732
|
+
borderRadius: "50%",
|
|
2733
|
+
backgroundColor: "#328545",
|
|
2734
|
+
outline: "2px solid #fff"
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
)
|
|
2665
2738
|
]
|
|
2666
2739
|
}
|
|
2667
2740
|
),
|
|
2668
|
-
/* @__PURE__ */ jsx("span", {
|
|
2741
|
+
/* @__PURE__ */ jsx("span", { style: { position: "absolute", bottom: -13, left: 30 }, children: /* @__PURE__ */ jsx(
|
|
2669
2742
|
Lottie2,
|
|
2670
2743
|
{
|
|
2671
2744
|
animationData: typingdotanimation2_default,
|
|
@@ -2879,6 +2952,7 @@ var avatarBgByInitial = {
|
|
|
2879
2952
|
B: "#F0EDEB",
|
|
2880
2953
|
b: "#F0EDEB"
|
|
2881
2954
|
};
|
|
2955
|
+
var GRADIENT_BORDER = "linear-gradient(236.83deg, rgba(51,201,212,0.3) 0.4%, rgba(39,83,251,0.3) 30.28%, rgba(39,83,251,0.3) 50.2%, rgba(39,83,251,0.3) 65.14%, rgba(235,67,255,0.3) 100%)";
|
|
2882
2956
|
var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
2883
2957
|
const { close, selectThread, selectedThreadId, reference } = useChatUI();
|
|
2884
2958
|
const { isOpen: isGalleryOpen, closeGallery } = useGallery();
|
|
@@ -2924,16 +2998,12 @@ var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
|
2924
2998
|
const idButtonLabel = activeThread?.orderId ? "View Order" : activeThread?.inquiryId ? "View Inquiry" : void 0;
|
|
2925
2999
|
const idValue = activeThread?.orderId ?? activeThread?.inquiryId ?? void 0;
|
|
2926
3000
|
const [showDelete, setShowDelete] = useState(false);
|
|
2927
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
2928
3001
|
const scrollKey = `${activeId}-${messages.length}-${rev}`;
|
|
2929
|
-
const prevActiveIdRef =
|
|
3002
|
+
const prevActiveIdRef = useRef(activeId);
|
|
2930
3003
|
useEffect(() => {
|
|
2931
3004
|
if (prevActiveIdRef.current !== activeId) {
|
|
2932
3005
|
prevActiveIdRef.current = activeId;
|
|
2933
|
-
setIsLoading(true);
|
|
2934
|
-
const t = setTimeout(() => setIsLoading(false), 300);
|
|
2935
3006
|
if (activeId) adapter.threads.markRead?.(activeId);
|
|
2936
|
-
return () => clearTimeout(t);
|
|
2937
3007
|
}
|
|
2938
3008
|
}, [activeId, adapter]);
|
|
2939
3009
|
const toRef2 = (m) => ({
|
|
@@ -2961,13 +3031,18 @@ var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
|
2961
3031
|
message: "The chat has been deleted successfully."
|
|
2962
3032
|
});
|
|
2963
3033
|
};
|
|
2964
|
-
|
|
3034
|
+
const filteredThreads = threads.filter((t) => {
|
|
3035
|
+
if (!searchQuery.trim()) return true;
|
|
3036
|
+
const q = searchQuery.toLowerCase();
|
|
3037
|
+
return t.title.toLowerCase().includes(q) || t.last?.toLowerCase().includes(q) || t.orderId?.toLowerCase().includes(q) || t.inquiryId?.toLowerCase().includes(q);
|
|
3038
|
+
});
|
|
3039
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "fixed", bottom: 16, right: 16, zIndex: 10002 }, children: [
|
|
2965
3040
|
/* @__PURE__ */ jsx(
|
|
2966
3041
|
motion.button,
|
|
2967
3042
|
{
|
|
2968
3043
|
"aria-label": "Close chat",
|
|
2969
3044
|
onClick: close,
|
|
2970
|
-
|
|
3045
|
+
style: { position: "fixed", inset: 0, background: "transparent", border: "none", cursor: "auto" },
|
|
2971
3046
|
initial: { opacity: 0 },
|
|
2972
3047
|
animate: { opacity: 1 },
|
|
2973
3048
|
exit: { opacity: 0 },
|
|
@@ -2979,12 +3054,14 @@ var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
|
2979
3054
|
{
|
|
2980
3055
|
role: "dialog",
|
|
2981
3056
|
"aria-modal": "true",
|
|
2982
|
-
className: "relative rounded-[20px] p-[3px]",
|
|
2983
3057
|
style: {
|
|
3058
|
+
position: "relative",
|
|
2984
3059
|
width: 800,
|
|
2985
3060
|
height: 650,
|
|
3061
|
+
borderRadius: 20,
|
|
3062
|
+
padding: 3,
|
|
2986
3063
|
boxShadow: "0px 2px 12px 0px #3B33331A",
|
|
2987
|
-
background:
|
|
3064
|
+
background: GRADIENT_BORDER
|
|
2988
3065
|
},
|
|
2989
3066
|
initial: { x: "110%" },
|
|
2990
3067
|
animate: { x: 0 },
|
|
@@ -2993,119 +3070,192 @@ var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
|
2993
3070
|
children: /* @__PURE__ */ jsxs(
|
|
2994
3071
|
"div",
|
|
2995
3072
|
{
|
|
2996
|
-
|
|
2997
|
-
|
|
3073
|
+
style: {
|
|
3074
|
+
position: "relative",
|
|
3075
|
+
height: "100%",
|
|
3076
|
+
width: "100%",
|
|
3077
|
+
overflow: "hidden",
|
|
3078
|
+
borderRadius: 18,
|
|
3079
|
+
backgroundColor: "#fff",
|
|
3080
|
+
overscrollBehavior: "contain"
|
|
3081
|
+
},
|
|
2998
3082
|
children: [
|
|
2999
|
-
/* @__PURE__ */
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
onDelete: () => setShowDelete(true)
|
|
3012
|
-
}) ?? null
|
|
3013
|
-
}
|
|
3014
|
-
) }),
|
|
3015
|
-
idValue && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: /* @__PURE__ */ jsx(
|
|
3016
|
-
ChatInquiryBar_default,
|
|
3017
|
-
{
|
|
3018
|
-
id: idValue,
|
|
3019
|
-
label: idLabel,
|
|
3020
|
-
buttonLabel: idButtonLabel,
|
|
3021
|
-
onView: () => {
|
|
3022
|
-
const type = activeThread?.orderId ? "order" : "inquiry";
|
|
3023
|
-
uiCallbacks?.onNavigate?.({ type, id: idValue });
|
|
3024
|
-
}
|
|
3025
|
-
}
|
|
3026
|
-
) }),
|
|
3027
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxs("div", { className: "relative h-full min-h-0", children: [
|
|
3028
|
-
/* @__PURE__ */ jsx(
|
|
3029
|
-
ChatScroll_default,
|
|
3083
|
+
/* @__PURE__ */ jsxs(
|
|
3084
|
+
"div",
|
|
3085
|
+
{
|
|
3086
|
+
style: {
|
|
3087
|
+
display: "grid",
|
|
3088
|
+
gridTemplateColumns: "1fr 310px",
|
|
3089
|
+
height: "100%",
|
|
3090
|
+
minHeight: 0
|
|
3091
|
+
},
|
|
3092
|
+
children: [
|
|
3093
|
+
/* @__PURE__ */ jsxs(
|
|
3094
|
+
"div",
|
|
3030
3095
|
{
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3096
|
+
style: {
|
|
3097
|
+
display: "flex",
|
|
3098
|
+
flexDirection: "column",
|
|
3099
|
+
height: "100%",
|
|
3100
|
+
minHeight: 0,
|
|
3101
|
+
borderRight: "1px solid #9BBCCF"
|
|
3102
|
+
},
|
|
3103
|
+
children: [
|
|
3104
|
+
/* @__PURE__ */ jsx("div", { style: { height: 64, flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3105
|
+
ChatHeader,
|
|
3106
|
+
{
|
|
3107
|
+
left: activeThread?.avatarSrc ? /* @__PURE__ */ jsx(
|
|
3108
|
+
ChatIdentity_default,
|
|
3109
|
+
{
|
|
3110
|
+
variant: "avatar",
|
|
3111
|
+
src: activeThread.avatarSrc,
|
|
3112
|
+
online,
|
|
3113
|
+
title,
|
|
3114
|
+
subtitle,
|
|
3115
|
+
verified: isVerified,
|
|
3116
|
+
subtitleVariant: "muted"
|
|
3117
|
+
}
|
|
3118
|
+
) : /* @__PURE__ */ jsx(
|
|
3119
|
+
ChatIdentity_default,
|
|
3120
|
+
{
|
|
3121
|
+
variant: "initial",
|
|
3122
|
+
initial,
|
|
3123
|
+
bg: avatarBg,
|
|
3124
|
+
online,
|
|
3125
|
+
title,
|
|
3126
|
+
subtitle,
|
|
3127
|
+
verified: isVerified,
|
|
3128
|
+
subtitleVariant: "muted"
|
|
3129
|
+
}
|
|
3130
|
+
),
|
|
3131
|
+
right: uiCallbacks?.renderKebabMenu?.({
|
|
3132
|
+
pinned: Boolean(activeThread?.pinned),
|
|
3133
|
+
onPinToggle: () => {
|
|
3134
|
+
if (activeId) adapter.threads.pin(activeId, !activeThread?.pinned);
|
|
3135
|
+
},
|
|
3136
|
+
onDelete: () => setShowDelete(true)
|
|
3137
|
+
}) ?? null
|
|
3138
|
+
}
|
|
3139
|
+
) }),
|
|
3140
|
+
idValue && /* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3141
|
+
ChatInquiryBar_default,
|
|
3039
3142
|
{
|
|
3040
|
-
id:
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3143
|
+
id: idValue,
|
|
3144
|
+
label: idLabel,
|
|
3145
|
+
buttonLabel: idButtonLabel,
|
|
3146
|
+
onView: () => {
|
|
3147
|
+
const type = activeThread?.orderId ? "order" : "inquiry";
|
|
3148
|
+
uiCallbacks?.onNavigate?.({ type, id: idValue });
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
) }),
|
|
3152
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
|
|
3153
|
+
/* @__PURE__ */ jsx(
|
|
3154
|
+
ChatScroll_default,
|
|
3155
|
+
{
|
|
3156
|
+
className: "h-full pb-10",
|
|
3157
|
+
bottomAlignWhenShort: false,
|
|
3158
|
+
scrollKey,
|
|
3159
|
+
style: { height: "100%", overflowY: "auto" },
|
|
3160
|
+
children: messages.map((m, idx) => {
|
|
3161
|
+
const mine = m.author === "you";
|
|
3162
|
+
const isLast = idx === messages.length - 1;
|
|
3163
|
+
return /* @__PURE__ */ jsx(
|
|
3164
|
+
ChatMessageItem_default,
|
|
3165
|
+
{
|
|
3166
|
+
id: m.id,
|
|
3167
|
+
mine,
|
|
3168
|
+
time: m.time ?? "",
|
|
3169
|
+
authorInitial: typeof m.author === "string" ? m.author : "U",
|
|
3170
|
+
avatarBg,
|
|
3171
|
+
text: m.text ?? m.content,
|
|
3172
|
+
businessCard: m.businessCard,
|
|
3173
|
+
addressCard: m.addressCard,
|
|
3174
|
+
images: m.images,
|
|
3175
|
+
files: m.files,
|
|
3176
|
+
audio: m.audio,
|
|
3177
|
+
replyTo: m.replyTo,
|
|
3178
|
+
showStatus: isLast,
|
|
3179
|
+
status: activeThread?.status?.kind === "seen" ? "Seen" : "Delivered",
|
|
3180
|
+
onReply: () => setReplyTo(toRef2(m)),
|
|
3181
|
+
initialSrc: m.avatarSrc
|
|
3182
|
+
},
|
|
3183
|
+
m.id
|
|
3184
|
+
);
|
|
3185
|
+
})
|
|
3186
|
+
}
|
|
3187
|
+
),
|
|
3188
|
+
/* @__PURE__ */ jsx(
|
|
3189
|
+
"div",
|
|
3190
|
+
{
|
|
3191
|
+
style: {
|
|
3192
|
+
position: "absolute",
|
|
3193
|
+
left: 0,
|
|
3194
|
+
right: 0,
|
|
3195
|
+
bottom: 0,
|
|
3196
|
+
display: "flex",
|
|
3197
|
+
alignItems: "center",
|
|
3198
|
+
justifyContent: "flex-start",
|
|
3199
|
+
padding: "4px 16px 8px",
|
|
3200
|
+
background: "#fff",
|
|
3201
|
+
pointerEvents: "none"
|
|
3202
|
+
},
|
|
3203
|
+
children: /* @__PURE__ */ jsx(TypingIndicator_default, { style: { pointerEvents: "auto" } })
|
|
3204
|
+
}
|
|
3205
|
+
)
|
|
3206
|
+
] }),
|
|
3207
|
+
/* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3208
|
+
ChatFooter_default,
|
|
3209
|
+
{
|
|
3210
|
+
replyTo,
|
|
3211
|
+
clearReply: () => setReplyTo(void 0),
|
|
3212
|
+
onAfterSend: () => setRev((v) => v + 1),
|
|
3213
|
+
onSend: (payload) => {
|
|
3214
|
+
if (activeId) adapter.messages.send(activeId, payload);
|
|
3215
|
+
}
|
|
3056
3216
|
},
|
|
3057
|
-
|
|
3058
|
-
)
|
|
3059
|
-
|
|
3217
|
+
activeId
|
|
3218
|
+
) })
|
|
3219
|
+
]
|
|
3060
3220
|
}
|
|
3061
3221
|
),
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
status,
|
|
3100
|
-
avatarText: t.avatarText ?? "",
|
|
3101
|
-
avatarSrc: t.avatarSrc
|
|
3102
|
-
},
|
|
3103
|
-
t.id
|
|
3104
|
-
);
|
|
3105
|
-
}) })
|
|
3106
|
-
] })
|
|
3107
|
-
] }),
|
|
3108
|
-
/* @__PURE__ */ jsx(ChatConfirmModal, { open: showDelete, onClose: () => setShowDelete(false), onConfirm: handleConfirmDelete }),
|
|
3222
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0 }, children: [
|
|
3223
|
+
/* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(ChatListHeader_default, { onClose: close, onSearchChange: (val) => setSearchQuery(val) }) }),
|
|
3224
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0, overflowY: "auto" }, children: filteredThreads.map((t) => {
|
|
3225
|
+
const status = t.status ?? (t.unread && t.unread > 0 ? { kind: "new", count: t.unread } : { kind: "seen" });
|
|
3226
|
+
return /* @__PURE__ */ jsx(
|
|
3227
|
+
ChatThreadItem_default,
|
|
3228
|
+
{
|
|
3229
|
+
onClick: () => {
|
|
3230
|
+
setReplyTo(void 0);
|
|
3231
|
+
selectThread(t.id);
|
|
3232
|
+
},
|
|
3233
|
+
active: t.id === activeId,
|
|
3234
|
+
pinned: Boolean(t.pinned),
|
|
3235
|
+
online: t.online,
|
|
3236
|
+
verified: Boolean(t.badge),
|
|
3237
|
+
title: t.title,
|
|
3238
|
+
preview: t.last ?? "",
|
|
3239
|
+
time: t.time ?? "",
|
|
3240
|
+
status,
|
|
3241
|
+
avatarText: t.avatarText ?? "",
|
|
3242
|
+
avatarSrc: t.avatarSrc
|
|
3243
|
+
},
|
|
3244
|
+
t.id
|
|
3245
|
+
);
|
|
3246
|
+
}) })
|
|
3247
|
+
] })
|
|
3248
|
+
]
|
|
3249
|
+
}
|
|
3250
|
+
),
|
|
3251
|
+
/* @__PURE__ */ jsx(
|
|
3252
|
+
ChatConfirmModal,
|
|
3253
|
+
{
|
|
3254
|
+
open: showDelete,
|
|
3255
|
+
onClose: () => setShowDelete(false),
|
|
3256
|
+
onConfirm: handleConfirmDelete
|
|
3257
|
+
}
|
|
3258
|
+
),
|
|
3109
3259
|
/* @__PURE__ */ jsx(ChatImagePreviewModal_default, { isOpen: isGalleryOpen, onClose: closeGallery })
|
|
3110
3260
|
]
|
|
3111
3261
|
}
|
|
@@ -3115,6 +3265,7 @@ var InboxPopup = ({ adapter, uiCallbacks }) => {
|
|
|
3115
3265
|
] });
|
|
3116
3266
|
};
|
|
3117
3267
|
var InboxPopup_default = InboxPopup;
|
|
3268
|
+
var GRADIENT_BORDER2 = "linear-gradient(236.83deg, rgba(51,201,212,0.3) 0.4%, rgba(39,83,251,0.3) 30.28%, rgba(39,83,251,0.3) 50.2%, rgba(39,83,251,0.3) 65.14%, rgba(235,67,255,0.3) 100%)";
|
|
3118
3269
|
function coalesceThreadId(reference, threads) {
|
|
3119
3270
|
const referenceId = reference?.id;
|
|
3120
3271
|
if (reference?.kind === "quotation") {
|
|
@@ -3167,14 +3318,13 @@ var SinglePopup = ({ adapter, uiCallbacks }) => {
|
|
|
3167
3318
|
setScrollKey(Date.now());
|
|
3168
3319
|
setReplyTo(void 0);
|
|
3169
3320
|
}, [activeId, adapter]);
|
|
3170
|
-
|
|
3171
|
-
return /* @__PURE__ */ jsxs("div", { className: "fixed bottom-4 right-4 z-[10002]", children: [
|
|
3321
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "fixed", bottom: 16, right: 16, zIndex: 10002 }, children: [
|
|
3172
3322
|
/* @__PURE__ */ jsx(
|
|
3173
3323
|
motion.button,
|
|
3174
3324
|
{
|
|
3175
3325
|
"aria-label": "Close chat",
|
|
3176
3326
|
onClick: close,
|
|
3177
|
-
|
|
3327
|
+
style: { position: "fixed", inset: 0, background: "transparent", border: "none", cursor: "auto" },
|
|
3178
3328
|
initial: { opacity: 0 },
|
|
3179
3329
|
animate: { opacity: 1 },
|
|
3180
3330
|
exit: { opacity: 0 },
|
|
@@ -3186,10 +3336,14 @@ var SinglePopup = ({ adapter, uiCallbacks }) => {
|
|
|
3186
3336
|
{
|
|
3187
3337
|
role: "dialog",
|
|
3188
3338
|
"aria-modal": "true",
|
|
3189
|
-
className: "relative h-[650px] w-[450px] rounded-[20px] p-[2px]",
|
|
3190
3339
|
style: {
|
|
3340
|
+
position: "relative",
|
|
3341
|
+
height: 650,
|
|
3342
|
+
width: 450,
|
|
3343
|
+
borderRadius: 20,
|
|
3344
|
+
padding: 2,
|
|
3191
3345
|
boxShadow: "0px 2px 12px 0px #3B33331A",
|
|
3192
|
-
background:
|
|
3346
|
+
background: GRADIENT_BORDER2
|
|
3193
3347
|
},
|
|
3194
3348
|
initial: { x: "110%" },
|
|
3195
3349
|
animate: { x: 0 },
|
|
@@ -3198,10 +3352,18 @@ var SinglePopup = ({ adapter, uiCallbacks }) => {
|
|
|
3198
3352
|
children: /* @__PURE__ */ jsxs(
|
|
3199
3353
|
"div",
|
|
3200
3354
|
{
|
|
3201
|
-
|
|
3202
|
-
|
|
3355
|
+
style: {
|
|
3356
|
+
display: "flex",
|
|
3357
|
+
flexDirection: "column",
|
|
3358
|
+
height: "100%",
|
|
3359
|
+
width: "100%",
|
|
3360
|
+
overflow: "hidden",
|
|
3361
|
+
borderRadius: 18,
|
|
3362
|
+
backgroundColor: "#fff",
|
|
3363
|
+
overscrollBehavior: "contain"
|
|
3364
|
+
},
|
|
3203
3365
|
children: [
|
|
3204
|
-
/* @__PURE__ */ jsx("div", {
|
|
3366
|
+
/* @__PURE__ */ jsx("div", { style: { height: 64, flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3205
3367
|
ChatHeader,
|
|
3206
3368
|
{
|
|
3207
3369
|
left: /* @__PURE__ */ jsx(
|
|
@@ -3221,41 +3383,61 @@ var SinglePopup = ({ adapter, uiCallbacks }) => {
|
|
|
3221
3383
|
{
|
|
3222
3384
|
type: "button",
|
|
3223
3385
|
onClick: close,
|
|
3224
|
-
|
|
3386
|
+
style: {
|
|
3387
|
+
display: "flex",
|
|
3388
|
+
alignItems: "center",
|
|
3389
|
+
justifyContent: "center",
|
|
3390
|
+
height: 34,
|
|
3391
|
+
width: 34,
|
|
3392
|
+
borderRadius: "50%",
|
|
3393
|
+
backgroundColor: "#fff",
|
|
3394
|
+
color: "#000",
|
|
3395
|
+
border: "none",
|
|
3396
|
+
boxShadow: "0px 2px 4px 0px #A5A3AE4D",
|
|
3397
|
+
cursor: "pointer"
|
|
3398
|
+
},
|
|
3225
3399
|
children: /* @__PURE__ */ jsx(ChatXIcon, { className: "h-6 w-6" })
|
|
3226
3400
|
}
|
|
3227
3401
|
)
|
|
3228
3402
|
}
|
|
3229
3403
|
) }),
|
|
3230
|
-
/* @__PURE__ */ jsx("div", {
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
mine
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3404
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: /* @__PURE__ */ jsxs(
|
|
3405
|
+
ChatScroll_default,
|
|
3406
|
+
{
|
|
3407
|
+
bottomAlignWhenShort: false,
|
|
3408
|
+
scrollKey,
|
|
3409
|
+
style: { height: "100%", overflowY: "auto" },
|
|
3410
|
+
children: [
|
|
3411
|
+
messages.map((m, idx) => {
|
|
3412
|
+
const mine = m.author === "you";
|
|
3413
|
+
const isLast = idx === messages.length - 1;
|
|
3414
|
+
return /* @__PURE__ */ jsx(
|
|
3415
|
+
ChatMessageItem_default,
|
|
3416
|
+
{
|
|
3417
|
+
id: m.id,
|
|
3418
|
+
mine,
|
|
3419
|
+
time: m.time ?? "",
|
|
3420
|
+
authorInitial: typeof m.author === "string" ? m.author : "U",
|
|
3421
|
+
text: m.text ?? m.content,
|
|
3422
|
+
businessCard: m.businessCard,
|
|
3423
|
+
addressCard: m.addressCard,
|
|
3424
|
+
images: m.images,
|
|
3425
|
+
files: m.files,
|
|
3426
|
+
audio: m.audio,
|
|
3427
|
+
replyTo: m.replyTo,
|
|
3428
|
+
initialSrc: m.avatarSrc,
|
|
3429
|
+
showStatus: isLast,
|
|
3430
|
+
status: activeThread?.status?.kind === "seen" ? "Seen" : "Delivered",
|
|
3431
|
+
onReply: () => setReplyTo(toRef(m))
|
|
3432
|
+
},
|
|
3433
|
+
m.id
|
|
3434
|
+
);
|
|
3435
|
+
}),
|
|
3436
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "flex-start" }, children: /* @__PURE__ */ jsx(TypingIndicator_default, {}) })
|
|
3437
|
+
]
|
|
3438
|
+
}
|
|
3439
|
+
) }),
|
|
3440
|
+
/* @__PURE__ */ jsx("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(
|
|
3259
3441
|
ChatFooter_default,
|
|
3260
3442
|
{
|
|
3261
3443
|
variant: "single",
|