@realtimexsco/live-chat 1.3.2 → 1.3.3

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 CHANGED
@@ -4,14 +4,15 @@
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@realtimexsco/live-chat.svg)](https://www.npmjs.com/package/@realtimexsco/live-chat)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@realtimexsco/live-chat.svg)](https://www.npmjs.com/package/@realtimexsco/live-chat)
7
- [![license](https://img.shields.io/npm/l/@realtimexsco/live-chat.svg)](./LICENSE)
7
+ [![license](https://img.shields.io/npm/l/@realtimexsco/live-chat.svg)](https://bitbucket.org/software-co/realtimex-npm-package/src/1d8b3426735c2d080ded2ba67255bc43f5035f4b/LICENSE)
8
8
 
9
9
  | | |
10
10
  |---|---|
11
11
  | **Package** | [`@realtimexsco/live-chat`](https://www.npmjs.com/package/@realtimexsco/live-chat) |
12
12
  | **Styles** | `@realtimexsco/live-chat/styles.css` |
13
13
  | **Requires** | React 17+, Tailwind CSS **v4**, Zustand 4+ |
14
- | **License** | [MIT](./LICENSE) |
14
+ | **Docs** | [realtimex.softwareco.com](https://realtimex.softwareco.com/) |
15
+ | **License** | [MIT](https://bitbucket.org/software-co/realtimex-npm-package/src/1d8b3426735c2d080ded2ba67255bc43f5035f4b/LICENSE) |
15
16
 
16
17
  Socket.IO, REST client, Zustand store, Radix UI, emoji picker, and chat UI are **bundled**. Your app only installs peer dependencies.
17
18
 
@@ -58,16 +59,12 @@ DMs · groups · Socket.IO · reactions · replies · forward · edit/delete ·
58
59
 
59
60
  | Topic | Link |
60
61
  |-------|------|
61
- | Full setup guide (Tailwind, Vite, Next.js, config) | [docs/full-guide.md](./docs/full-guide.md) |
62
- | Customization (`components`, `classNames`, `features`) | [Customization](./docs/full-guide.md#customization--three-ways) |
63
- | ChatMain props & API | [Props reference](./docs/full-guide.md#chatmain-props-reference) |
64
- | Hooks & store | [Hooks & store](./docs/full-guide.md#hooks--store) |
65
- | Dev proxy (CORS) | [Dev proxy](./docs/full-guide.md#dev-proxy-cors) |
62
+ | Full setup & docs | [https://realtimex.softwareco.com/](https://realtimex.softwareco.com/) |
66
63
  | npm package | [npmjs.com/package/@realtimexsco/live-chat](https://www.npmjs.com/package/@realtimexsco/live-chat) |
67
- | License | [MIT License](./LICENSE) |
64
+ | License | [MIT](https://bitbucket.org/software-co/realtimex-npm-package/src/1d8b3426735c2d080ded2ba67255bc43f5035f4b/LICENSE) |
68
65
 
69
66
  ---
70
67
 
71
68
  ## License
72
69
 
73
- [MIT](./LICENSE) © RealtimeX
70
+ [MIT](https://bitbucket.org/software-co/realtimex-npm-package/src/1d8b3426735c2d080ded2ba67255bc43f5035f4b/LICENSE) © RealtimeX
package/dist/index.cjs CHANGED
@@ -10354,11 +10354,12 @@ function MessageAttachmentsView({
10354
10354
  const isImageOnlyBubble = isBubbleLayout && nonImages.length === 0 && images.length > 0;
10355
10355
  const showImageMetaOverlay = isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption && !attachmentSelectionMode;
10356
10356
  const showCaptionBar = showBottomBar && (!isImageOnlyBubble || hasMessageCaption);
10357
- const bubbleSurface = !isBubbleLayout ? void 0 : isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption ? "media" : isSender ? "sent" : "received";
10357
+ const canShowSenderName = !!isGroup && !isSender && !!showSenderLabel && !!senderName;
10358
+ const showForwardedInHeader = isBubbleLayout && isForwarded;
10359
+ const bubbleSurface = !isBubbleLayout ? void 0 : isImageOnlyBubble && !hasMessageCaption && !anyImageHasCaption && !isForwarded && !canShowSenderName ? "media" : isSender ? "sent" : "received";
10358
10360
  const metaTimeClass = showImageMetaOverlay ? "text-white/90" : isSender ? "text-white/70" : "text-(--chat-muted)";
10359
10361
  const metaBorderClass = isSender ? "border-white/15" : "border-(--chat-border)/40";
10360
10362
  const metaBadgeVariant = showImageMetaOverlay || isBubbleLayout && isSender ? "on-dark" : "default";
10361
- const isForwardedImageOnly = isBubbleLayout && isForwarded && isImageOnlyBubble;
10362
10363
  return /* @__PURE__ */ jsxRuntime.jsxs(
10363
10364
  "div",
10364
10365
  {
@@ -10377,29 +10378,36 @@ function MessageAttachmentsView({
10377
10378
  isSender,
10378
10379
  surface: bubbleSurface,
10379
10380
  className: cn(
10380
- isImageOnlyBubble ? "p-0" : isForwarded ? "px-2 py-0.5" : "px-2.5 py-1"
10381
+ isImageOnlyBubble ? "overflow-hidden p-0" : isForwarded || canShowSenderName ? "px-2 py-0.5" : "px-2.5 py-1"
10381
10382
  )
10382
10383
  })
10383
10384
  ),
10384
10385
  children: [
10385
- !isSender && showSenderLabel && senderName && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-0.5 pb-1", children: /* @__PURE__ */ jsxRuntime.jsx(GroupSenderName, { name: senderName }) }),
10386
- isBubbleLayout && isForwarded && !isForwardedImageOnly && /* @__PURE__ */ jsxRuntime.jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }),
10386
+ (canShowSenderName || showForwardedInHeader) && /* @__PURE__ */ jsxRuntime.jsxs(
10387
+ "div",
10388
+ {
10389
+ className: cn(
10390
+ "relative z-10 flex min-w-0 flex-col gap-0.5",
10391
+ isImageOnlyBubble ? "px-2.5 pt-1.5 pb-1" : "px-0.5 pb-0.5"
10392
+ ),
10393
+ children: [
10394
+ canShowSenderName ? /* @__PURE__ */ jsxRuntime.jsx(GroupSenderName, { name: senderName }) : null,
10395
+ showForwardedInHeader ? /* @__PURE__ */ jsxRuntime.jsx(
10396
+ MessageForwardedLabel,
10397
+ {
10398
+ isSender,
10399
+ className: "px-0 pt-0 pb-0"
10400
+ }
10401
+ ) : null
10402
+ ]
10403
+ }
10404
+ ),
10387
10405
  isBubbleLayout && replySnippet ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 pb-1", children: replySnippet }) : null,
10388
10406
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
10389
10407
  "flex w-full flex-col",
10390
10408
  !isImageOnlyBubble && "gap-0",
10391
- isImageOnlyBubble && "relative overflow-hidden rounded-[inherit]"
10409
+ isImageOnlyBubble && "relative overflow-hidden"
10392
10410
  ), children: [
10393
- isForwardedImageOnly && /* @__PURE__ */ jsxRuntime.jsx(
10394
- "div",
10395
- {
10396
- className: cn(
10397
- "pointer-events-none absolute inset-x-0 top-0 z-20 px-2 py-0.5",
10398
- isSender ? "bg-linear-to-b from-(--chat-theme)/95 via-(--chat-theme)/55 to-transparent" : "bg-linear-to-b from-(--chat-incoming-bubble)/95 via-(--chat-incoming-bubble)/55 to-transparent"
10399
- ),
10400
- children: /* @__PURE__ */ jsxRuntime.jsx(MessageForwardedLabel, { isSender, overlay: true, className: "px-0 pt-0 pb-0" })
10401
- }
10402
- ),
10403
10411
  /* @__PURE__ */ jsxRuntime.jsx(
10404
10412
  MessageAttachmentsImageSection,
10405
10413
  {
@@ -13837,6 +13845,7 @@ function MessageItemTextBubble({
13837
13845
  isSender,
13838
13846
  className: extra
13839
13847
  });
13848
+ const canShowSenderName = !!isGroup && !isSender && !!showSenderLabel && !!senderName;
13840
13849
  return /* @__PURE__ */ jsxRuntime.jsxs(
13841
13850
  "div",
13842
13851
  {
@@ -13844,15 +13853,17 @@ function MessageItemTextBubble({
13844
13853
  bubbleClasses(
13845
13854
  cn(
13846
13855
  "flex min-w-[72px] flex-col transition-all duration-200",
13847
- isForwarded ? "gap-0.5 px-2.5 py-1.5 text-[13px]" : "gap-1 px-3.5 py-2.5 text-[14px]"
13856
+ canShowSenderName ? "gap-0.5 px-2.5 py-1.5 text-[14px]" : isForwarded ? "gap-0.5 px-2.5 py-1.5 text-[13px]" : "gap-1 px-3.5 py-2.5 text-[14px]"
13848
13857
  )
13849
13858
  ),
13850
13859
  isPending && "opacity-70",
13851
13860
  isHighlighted && (isSender ? "ring-2 ring-amber-300/60" : "ring-2 ring-amber-200/60")
13852
13861
  ),
13853
13862
  children: [
13854
- isForwarded && /* @__PURE__ */ jsxRuntime.jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }),
13855
- !isSender && showSenderLabel && senderName && /* @__PURE__ */ jsxRuntime.jsx(GroupSenderName, { name: senderName, className: "mb-0.5" }),
13863
+ (canShowSenderName || isForwarded) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [
13864
+ canShowSenderName ? /* @__PURE__ */ jsxRuntime.jsx(GroupSenderName, { name: senderName }) : null,
13865
+ isForwarded ? /* @__PURE__ */ jsxRuntime.jsx(MessageForwardedLabel, { isSender, className: "px-0 pt-0 pb-0" }) : null
13866
+ ] }),
13856
13867
  /* @__PURE__ */ jsxRuntime.jsx(
13857
13868
  MessageReplySnippet_default,
13858
13869
  {