@realtimexsco/live-chat 1.4.17 → 1.4.18
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/README.md +3 -3
- package/dist/index.cjs +27 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +27 -27
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -2
package/README.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> Drop-in real-time chat UI for React and Next.js — direct messages, group chats, reactions, replies, forwarding, pinned/starred messages, and more. Built on Socket.IO, Zustand, Tailwind CSS v4, and Radix UI.
|
|
4
4
|
|
|
5
|
-
[npm version](https://www.npmjs.com/package/@realtimexsco/live-chat)
|
|
6
|
-
[npm downloads](https://www.npmjs.com/package/@realtimexsco/live-chat)
|
|
7
|
-
[
|
|
5
|
+
[](https://www.npmjs.com/package/@realtimexsco/live-chat)
|
|
6
|
+
[](https://www.npmjs.com/package/@realtimexsco/live-chat)
|
|
7
|
+
[](#license)
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
| | |
|
package/dist/index.cjs
CHANGED
|
@@ -9823,10 +9823,10 @@ function AudioAttachmentPlayer({
|
|
|
9823
9823
|
"div",
|
|
9824
9824
|
{
|
|
9825
9825
|
className: cn(
|
|
9826
|
-
"chat-audio-player w-full min-w-[220px] max-w-[280px] rounded-xl border p-2.5",
|
|
9826
|
+
"chat-audio-player w-full min-w-[220px] max-w-[280px] rounded-xl border p-2.5 transition-shadow duration-150",
|
|
9827
9827
|
onThemeBubble && "chat-audio-player-on-dark border-white/20 bg-white/12 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-[2px]",
|
|
9828
|
-
onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm [.dark_&]:bg-(--chat-surface)",
|
|
9829
|
-
!inBubble && "border-(--chat-border) bg-(--chat-elevated) text-(--chat-text) shadow-sm",
|
|
9828
|
+
onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm hover:shadow-md [.dark_&]:bg-(--chat-surface)",
|
|
9829
|
+
!inBubble && "border-(--chat-border) bg-(--chat-elevated) text-(--chat-text) shadow-sm hover:shadow-md",
|
|
9830
9830
|
className
|
|
9831
9831
|
),
|
|
9832
9832
|
children: [
|
|
@@ -9862,7 +9862,7 @@ function AudioAttachmentPlayer({
|
|
|
9862
9862
|
onClick: () => void togglePlay(),
|
|
9863
9863
|
disabled: !url,
|
|
9864
9864
|
className: cn(
|
|
9865
|
-
"flex size-8 shrink-0 items-center justify-center rounded-full border transition-
|
|
9865
|
+
"flex size-8 shrink-0 items-center justify-center rounded-full border transition-all duration-150 hover:scale-105",
|
|
9866
9866
|
onThemeBubble ? "border-white/30 bg-white/10 text-white hover:bg-white/15" : "border-(--chat-border) bg-(--chat-input-bg) text-(--chat-text) hover:bg-(--chat-hover)",
|
|
9867
9867
|
!url && "opacity-40"
|
|
9868
9868
|
),
|
|
@@ -9916,10 +9916,10 @@ function getMediaCardClasses(inBubble, isSender) {
|
|
|
9916
9916
|
const onThemeBubble = inBubble && isSender;
|
|
9917
9917
|
const onIncomingBubble = inBubble && !isSender;
|
|
9918
9918
|
return cn(
|
|
9919
|
-
"w-full min-w-[220px] max-w-[280px] rounded-xl border p-2.5",
|
|
9919
|
+
"w-full min-w-[220px] max-w-[280px] rounded-xl border p-2.5 transition-shadow duration-150",
|
|
9920
9920
|
onThemeBubble && "border-white/20 bg-white/12 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-[2px]",
|
|
9921
|
-
onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm [.dark_&]:bg-(--chat-surface)",
|
|
9922
|
-
!inBubble && "border-(--chat-border) bg-(--chat-elevated) text-(--chat-text) shadow-sm"
|
|
9921
|
+
onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm hover:shadow-md [.dark_&]:bg-(--chat-surface)",
|
|
9922
|
+
!inBubble && "border-(--chat-border) bg-(--chat-elevated) text-(--chat-text) shadow-sm hover:shadow-md"
|
|
9923
9923
|
);
|
|
9924
9924
|
}
|
|
9925
9925
|
function VideoAttachmentPlayer({
|
|
@@ -10043,10 +10043,10 @@ function VideoAttachmentPlayer({
|
|
|
10043
10043
|
{
|
|
10044
10044
|
type: "button",
|
|
10045
10045
|
onClick: () => void togglePlay(),
|
|
10046
|
-
className: "absolute inset-0 flex items-center justify-center bg-black/20 transition-colors hover:bg-black/30",
|
|
10046
|
+
className: "group/play absolute inset-0 flex items-center justify-center bg-black/20 transition-colors hover:bg-black/30",
|
|
10047
10047
|
"aria-label": `Play ${name}`,
|
|
10048
10048
|
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
10049
|
-
"flex items-center justify-center rounded-full shadow-md",
|
|
10049
|
+
"flex items-center justify-center rounded-full shadow-md transition-transform duration-150 group-hover/play:scale-110",
|
|
10050
10050
|
compact ? "size-9" : "size-11",
|
|
10051
10051
|
onThemeBubble ? "bg-white/95 text-(--chat-theme)" : "bg-(--chat-surface)/95 text-(--chat-text)"
|
|
10052
10052
|
), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, { size: compact ? 15 : 18, className: "ml-0.5 fill-current" }) })
|
|
@@ -10089,13 +10089,13 @@ function getAttachmentIcon(fileName, type, className, size = 20) {
|
|
|
10089
10089
|
}
|
|
10090
10090
|
function getAttachmentIconBoxClass(fileName, type) {
|
|
10091
10091
|
const ext = fileName.split(".").pop()?.toLowerCase() || "";
|
|
10092
|
-
if (["mp3", "wav", "ogg", "m4a"].includes(ext)) return "bg-violet-500";
|
|
10093
|
-
if (["mp4", "mov", "webm"].includes(ext)) return "bg-pink-500";
|
|
10094
|
-
if (ext === "pdf") return "bg-red-500";
|
|
10095
|
-
if (["doc", "docx"].includes(ext)) return "bg-blue-500";
|
|
10096
|
-
if (["xls", "xlsx", "csv"].includes(ext)) return "bg-emerald-600";
|
|
10097
|
-
if (["ppt", "pptx"].includes(ext)) return "bg-orange-500";
|
|
10098
|
-
return "bg-slate-500";
|
|
10092
|
+
if (["mp3", "wav", "ogg", "m4a"].includes(ext)) return "bg-linear-to-br from-violet-500 to-fuchsia-500";
|
|
10093
|
+
if (["mp4", "mov", "webm"].includes(ext)) return "bg-linear-to-br from-pink-500 to-rose-500";
|
|
10094
|
+
if (ext === "pdf") return "bg-linear-to-br from-red-500 to-rose-600";
|
|
10095
|
+
if (["doc", "docx"].includes(ext)) return "bg-linear-to-br from-blue-500 to-indigo-500";
|
|
10096
|
+
if (["xls", "xlsx", "csv"].includes(ext)) return "bg-linear-to-br from-emerald-500 to-teal-600";
|
|
10097
|
+
if (["ppt", "pptx"].includes(ext)) return "bg-linear-to-br from-orange-500 to-amber-500";
|
|
10098
|
+
return "bg-linear-to-br from-slate-500 to-slate-600";
|
|
10099
10099
|
}
|
|
10100
10100
|
var MessageStatus = ({ status, isPending, className }) => {
|
|
10101
10101
|
const resolvedStatus = status || "sent";
|
|
@@ -11245,28 +11245,28 @@ function ImageTile({ att, className, fill, embeddedInBubble, showImageCaption, o
|
|
|
11245
11245
|
{
|
|
11246
11246
|
type: "button",
|
|
11247
11247
|
className: cn(
|
|
11248
|
-
"relative block w-full overflow-hidden bg-(--chat-elevated)",
|
|
11248
|
+
"group relative block w-full overflow-hidden bg-(--chat-elevated)",
|
|
11249
11249
|
fill ? "h-full min-h-0" : "",
|
|
11250
11250
|
className
|
|
11251
11251
|
),
|
|
11252
11252
|
onClick: onOpen,
|
|
11253
11253
|
"aria-label": `Open ${att.name || "image"}`,
|
|
11254
11254
|
children: [
|
|
11255
|
-
mediaUrl ? (
|
|
11256
|
-
// eslint-disable-next-line @next/next/no-img-element -- remote chat attachment URLs are dynamic/user-supplied
|
|
11255
|
+
mediaUrl ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11257
11256
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11258
11257
|
"img",
|
|
11259
11258
|
{
|
|
11260
11259
|
src: mediaUrl,
|
|
11261
11260
|
alt: att.name || "Image",
|
|
11262
11261
|
className: cn(
|
|
11263
|
-
"block",
|
|
11262
|
+
"block transition-transform duration-300 ease-out group-hover:scale-[1.04]",
|
|
11264
11263
|
fill || embeddedInBubble ? "size-full object-cover" : "max-h-[300px] w-full rounded-xl object-contain"
|
|
11265
11264
|
),
|
|
11266
11265
|
loading: "lazy"
|
|
11267
11266
|
}
|
|
11268
|
-
)
|
|
11269
|
-
|
|
11267
|
+
),
|
|
11268
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute inset-0 bg-black/0 transition-colors duration-200 group-hover:bg-black/10", "aria-hidden": true })
|
|
11269
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-full min-h-[80px] items-center justify-center text-xs text-(--chat-muted)", children: "Image unavailable" }),
|
|
11270
11270
|
showImageCaption && imageCaption ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-10 bg-linear-to-t from-black/75 via-black/35 to-transparent px-1.5 pb-1 pt-5 text-left", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-3 text-[10px] leading-snug text-white", children: imageCaption }) }) : null
|
|
11271
11271
|
]
|
|
11272
11272
|
}
|
|
@@ -11701,14 +11701,14 @@ function FileAttachmentRow({
|
|
|
11701
11701
|
"div",
|
|
11702
11702
|
{
|
|
11703
11703
|
className: cn(
|
|
11704
|
-
"group w-full transition-
|
|
11704
|
+
"group w-full transition-all duration-150",
|
|
11705
11705
|
!stacked && "flex min-w-[220px] items-center gap-2",
|
|
11706
11706
|
stacked && "py-1.5",
|
|
11707
11707
|
stacked && showDivider && (onThemeBubble ? "border-t border-white/15" : "border-t border-(--chat-border)/35"),
|
|
11708
11708
|
!stacked && "rounded-xl border p-2.5",
|
|
11709
|
-
!stacked && onThemeBubble && "border-white/20 bg-white/12 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-[2px]",
|
|
11710
|
-
!stacked && onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm [.dark_&]:bg-(--chat-surface)",
|
|
11711
|
-
!stacked && !inBubble && "border-(--chat-border) bg-(--chat-surface) shadow-sm",
|
|
11709
|
+
!stacked && onThemeBubble && "border-white/20 bg-white/12 text-white shadow-[inset_0_1px_0_rgba(255,255,255,0.08)] backdrop-blur-[2px] hover:bg-white/16",
|
|
11710
|
+
!stacked && onIncomingBubble && "border-(--chat-border)/70 bg-(--chat-elevated) text-(--chat-text) shadow-sm hover:border-(--chat-theme)/30 hover:shadow-md [.dark_&]:bg-(--chat-surface)",
|
|
11711
|
+
!stacked && !inBubble && "border-(--chat-border) bg-(--chat-surface) shadow-sm hover:border-(--chat-theme)/30 hover:shadow-md",
|
|
11712
11712
|
!fileUrl && "pointer-events-none opacity-60",
|
|
11713
11713
|
isCaptionActive && "opacity-90"
|
|
11714
11714
|
),
|
|
@@ -11723,7 +11723,7 @@ function FileAttachmentRow({
|
|
|
11723
11723
|
className: "flex min-w-0 flex-1 items-center gap-2.5 text-left disabled:cursor-default",
|
|
11724
11724
|
children: [
|
|
11725
11725
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
11726
|
-
"flex size-10 shrink-0 items-center justify-center rounded-lg text-white shadow-sm",
|
|
11726
|
+
"flex size-10 shrink-0 items-center justify-center rounded-lg text-white shadow-sm transition-transform duration-150 group-hover:scale-105",
|
|
11727
11727
|
getAttachmentIconBoxClass(rawName)
|
|
11728
11728
|
), children: getAttachmentIcon(rawName, "file", "text-white", 18) }),
|
|
11729
11729
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|