@linktr.ee/messaging-react 3.37.0-rc-1786190741 → 3.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +4 -4
  2. package/dist/Card-415OfRhw.cjs.map +1 -1
  3. package/dist/{Card-DVMzYquF.js → Card-D4PPD5qa.js} +8 -11
  4. package/dist/Card-D4PPD5qa.js.map +1 -0
  5. package/dist/Card-Dxk_Ggxw.cjs.map +1 -1
  6. package/dist/{Card-DaJtDL7m.js → Card-qS17qnN0.js} +6 -15
  7. package/dist/Card-qS17qnN0.js.map +1 -0
  8. package/dist/LoadingDots-Ct3WmVlT.js.map +1 -1
  9. package/dist/LoadingDots-D9GGphgM.cjs.map +1 -1
  10. package/dist/index-D7A8U8GQ.cjs.map +1 -1
  11. package/dist/{index-BOBIiAuD.js → index-DGmVyxHy.js} +62 -87
  12. package/dist/index-DGmVyxHy.js.map +1 -0
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/package.json +2 -2
  16. package/src/components/ActionButton/ActionButton.stories.tsx +2 -0
  17. package/src/components/ActionButton/ActionButton.test.tsx +55 -60
  18. package/src/components/ActionButton/index.tsx +14 -13
  19. package/src/components/AttachmentCard/AttachmentCard.stories.tsx +3 -1
  20. package/src/components/AttachmentCard/MediaPlayer.tsx +7 -9
  21. package/src/components/AttachmentCard/index.tsx +2 -6
  22. package/src/components/Avatar/Avatar.stories.tsx +5 -17
  23. package/src/components/Avatar/index.tsx +23 -13
  24. package/src/components/ChannelView.test.tsx +10 -6
  25. package/src/components/CustomMessage/CustomMessage.stories.tsx +2 -7
  26. package/src/components/CustomMessage/CustomMessage.test.tsx +3 -5
  27. package/src/components/CustomMessage/LockedAttachment/LockedAttachment.test.tsx +4 -5
  28. package/src/components/CustomMessage/LockedAttachment/components/Text/Card.tsx +4 -2
  29. package/src/components/CustomMessage/LockedAttachment/components/_shared/CardBody.tsx +6 -9
  30. package/src/components/CustomMessage/LockedAttachment/components/_shared/CardThumbnail.tsx +3 -1
  31. package/src/components/CustomMessage/LockedAttachment/components/_shared/GalleryThumbnail.tsx +4 -1
  32. package/src/components/CustomMessage/LockedAttachment/components/_shared/PurchaseStatusBadge.tsx +1 -0
  33. package/src/components/CustomMessage/LockedAttachment/components/_shared/SingleThumbnail.tsx +4 -1
  34. package/src/components/CustomMessage/LockedAttachment/components/_shared/SkeletonTextLines.tsx +2 -7
  35. package/src/components/CustomMessage/LockedAttachment/types.ts +3 -4
  36. package/src/components/CustomMessage/MessageAttachmentConversations.stories.tsx +86 -89
  37. package/src/components/CustomMessage/MessageVoteButtons.tsx +1 -4
  38. package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +10 -13
  39. package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +4 -1
  40. package/src/components/CustomMessage/StreamAttachmentMessage.stories.tsx +4 -4
  41. package/src/components/CustomMessage/StreamAttachmentMessage.test.tsx +7 -6
  42. package/src/components/CustomMessage/context.tsx +2 -7
  43. package/src/components/CustomMessage/index.tsx +4 -1
  44. package/src/components/CustomMessageInput/CustomMessageInput.stories.tsx +11 -33
  45. package/src/components/CustomMessageInput/CustomMessageInput.test.tsx +3 -3
  46. package/src/components/CustomSystemMessage/CustomSystemMessage.test.tsx +9 -6
  47. package/src/components/CustomTypingIndicator/CustomTypingIndicator.stories.tsx +1 -4
  48. package/src/components/IconButton/index.tsx +17 -21
  49. package/src/components/LinkAttachment/LinkAttachment.test.tsx +1 -4
  50. package/src/components/LinkAttachment/components/_shared/CardCta.tsx +1 -4
  51. package/src/components/Loading/Loading.stories.tsx +4 -1
  52. package/src/components/MediaMessage/MediaMessage.stories.tsx +18 -6
  53. package/src/components/MediaMessage/MediaMessage.test.tsx +16 -30
  54. package/src/components/MediaMessage/index.tsx +14 -51
  55. package/src/components/MessageAttachment/Audio/AudioAttachment.stories.tsx +2 -4
  56. package/src/components/MessageAttachment/File/FileAttachment.stories.tsx +1 -3
  57. package/src/components/MessageAttachment/Image/ImageAttachment.stories.tsx +4 -15
  58. package/src/components/MessageAttachment/Image/index.tsx +12 -6
  59. package/src/components/MessageAttachment/MessageAttachment.test.tsx +27 -59
  60. package/src/components/MessageAttachment/Pdf/PdfAttachment.stories.tsx +1 -3
  61. package/src/components/MessageAttachment/Pdf/index.tsx +3 -2
  62. package/src/components/MessageAttachment/Video/VideoAttachment.stories.tsx +3 -11
  63. package/src/components/MessageAttachment/Video/index.tsx +14 -9
  64. package/src/components/MessageAttachment/_shared/CompactDocumentRow.tsx +3 -1
  65. package/src/components/MessageAttachment/_shared/ImageViewer.tsx +3 -1
  66. package/src/components/MessageAttachment/_shared/MediaStackGrid.tsx +1 -5
  67. package/src/components/MessageAttachment/_shared/PdfViewer.tsx +3 -1
  68. package/src/components/MessageAttachment/_shared/VideoViewer.tsx +3 -1
  69. package/src/components/MessageAttachment/_shared/fileMeta.test.ts +6 -4
  70. package/src/components/MessageAttachment/stories/StoryTable.tsx +3 -1
  71. package/src/components/MessageBubble/MessageBubble.stories.tsx +1 -5
  72. package/src/components/MessageBubble/MessageBubble.test.tsx +3 -1
  73. package/src/components/MessageBubble/components/_shared/bubbleTail.tsx +1 -2
  74. package/src/components/MessagingShell/LoadingState.stories.tsx +1 -0
  75. package/src/components/RichCard/RichCard.stories.tsx +3 -14
  76. package/src/components/RichCard/RichCard.test.tsx +4 -16
  77. package/src/components/RichCard/RichCardBody.tsx +3 -11
  78. package/src/components/RichCard/RichCardCard.tsx +3 -1
  79. package/src/components/RichCard/RichCardImages.tsx +4 -2
  80. package/src/components/SearchInput/SearchInput.stories.tsx +1 -0
  81. package/src/components/SearchInput/SearchInput.test.tsx +65 -94
  82. package/src/hooks/useChannelStar.ts +1 -3
  83. package/src/hooks/useMessaging.ts +4 -4
  84. package/src/stories/decorators/storyUser.tsx +2 -2
  85. package/src/stories/mocks.tsx +1 -4
  86. package/src/styles.css +8 -23
  87. package/src/types.ts +2 -1
  88. package/src/utils/cdnImageUrl.test.ts +1 -3
  89. package/dist/Card-DVMzYquF.js.map +0 -1
  90. package/dist/Card-DaJtDL7m.js.map +0 -1
  91. package/dist/index-BOBIiAuD.js.map +0 -1
@@ -331,7 +331,14 @@ const ye = ({
331
331
  shape: i = "squircle",
332
332
  dmAgentEnabled: l = !1
333
333
  }) => {
334
- const o = Sa(e), d = Ea(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s("img", { src: t, alt: "", className: "h-full w-full object-cover" }) : /* @__PURE__ */ s(
334
+ const o = Sa(e), d = Ea(e), m = 0.45, u = n < 32 ? Math.round(n * m) : n < 56 ? 14 : n < 120 ? 18 : 36, g = n >= 40 ? 2 : 1, c = i === "circle" ? { borderRadius: "50%" } : { borderRadius: "1rem" }, b = /* @__PURE__ */ s("div", { className: "h-full w-full overflow-hidden", style: c, children: t ? /* @__PURE__ */ s(
335
+ "img",
336
+ {
337
+ src: t,
338
+ alt: "",
339
+ className: "h-full w-full object-cover"
340
+ }
341
+ ) : /* @__PURE__ */ s(
335
342
  "div",
336
343
  {
337
344
  "aria-hidden": "true",
@@ -345,7 +352,10 @@ const ye = ({
345
352
  return /* @__PURE__ */ f(
346
353
  "div",
347
354
  {
348
- className: k("relative flex-shrink-0", a),
355
+ className: k(
356
+ "relative flex-shrink-0",
357
+ a
358
+ ),
349
359
  style: {
350
360
  "--str-chat__avatar-size": `${n}px`,
351
361
  width: `${n}px`,
@@ -366,7 +376,10 @@ const ye = ({
366
376
  "div",
367
377
  {
368
378
  "data-testid": "avatar-ring",
369
- className: k("h-full w-full", "bg-transparent"),
379
+ className: k(
380
+ "h-full w-full",
381
+ "bg-transparent"
382
+ ),
370
383
  style: {
371
384
  ...c,
372
385
  ...l && {
@@ -1312,39 +1325,12 @@ const ut = ({ attachment: e, isMyMessage: t }) => {
1312
1325
  }
1313
1326
  ) }),
1314
1327
  /* @__PURE__ */ f("div", { className: "px-3 pb-3", children: [
1315
- n && /* @__PURE__ */ s(
1316
- "p",
1317
- {
1318
- className: `truncate text-[14px] font-medium leading-5 ${Xa(t)}`,
1319
- children: n
1320
- }
1321
- ),
1322
- a && /* @__PURE__ */ s(
1323
- "p",
1324
- {
1325
- className: `truncate text-[12px] leading-4 ${Ka(t)}`,
1326
- children: a
1327
- }
1328
- ),
1329
- d && /* @__PURE__ */ s(
1330
- "p",
1331
- {
1332
- className: `mt-1 truncate text-[12px] leading-4 ${Za(t)}`,
1333
- children: d
1334
- }
1335
- )
1328
+ n && /* @__PURE__ */ s("p", { className: `truncate text-[14px] font-medium leading-5 ${Xa(t)}`, children: n }),
1329
+ a && /* @__PURE__ */ s("p", { className: `truncate text-[12px] leading-4 ${Ka(t)}`, children: a }),
1330
+ d && /* @__PURE__ */ s("p", { className: `mt-1 truncate text-[12px] leading-4 ${Za(t)}`, children: d })
1336
1331
  ] })
1337
1332
  ] });
1338
- return d ? /* @__PURE__ */ s(
1339
- "a",
1340
- {
1341
- href: d,
1342
- target: "_blank",
1343
- rel: "noopener noreferrer",
1344
- className: "block no-underline",
1345
- children: m
1346
- }
1347
- ) : /* @__PURE__ */ s("div", { className: "block", children: m });
1333
+ return d ? /* @__PURE__ */ s("a", { href: d, target: "_blank", rel: "noopener noreferrer", className: "block no-underline", children: m }) : /* @__PURE__ */ s("div", { className: "block", children: m });
1348
1334
  };
1349
1335
  function Cs(e) {
1350
1336
  return e.type === "link" || !!e.og_scrape_url && !e.asset_url;
@@ -1385,13 +1371,7 @@ const er = ({
1385
1371
  },
1386
1372
  disabled: n,
1387
1373
  className: "mt-3 inline-flex h-10 w-full items-center justify-center gap-2 rounded-full bg-[#121110] px-4 text-sm font-medium leading-none text-white hover:bg-[#2a2928] disabled:opacity-70",
1388
- children: n ? /* @__PURE__ */ s(
1389
- xe,
1390
- {
1391
- className: "size-4 animate-spin text-white",
1392
- weight: "bold"
1393
- }
1394
- ) : /* @__PURE__ */ f(z.Fragment, { children: [
1374
+ children: n ? /* @__PURE__ */ s(xe, { className: "size-4 animate-spin text-white", weight: "bold" }) : /* @__PURE__ */ f(z.Fragment, { children: [
1395
1375
  /* @__PURE__ */ s(Se, { className: "size-4 text-white", weight: "bold" }),
1396
1376
  "Download"
1397
1377
  ] })
@@ -1501,19 +1481,8 @@ const Ss = ({
1501
1481
  {
1502
1482
  className: "str-chat__message-bubble",
1503
1483
  "data-attachment-bubble": "true",
1504
- style: {
1505
- padding: 0,
1506
- borderRadius: 0,
1507
- overflow: "visible",
1508
- background: "transparent"
1509
- },
1510
- children: n ? /* @__PURE__ */ s("div", { className: dt(t), children: /* @__PURE__ */ s(
1511
- ut,
1512
- {
1513
- attachment: n,
1514
- isMyMessage: t
1515
- }
1516
- ) }) : t ? /* @__PURE__ */ s(Ss, { ...a }) : /* @__PURE__ */ s(Es, { ...a })
1484
+ style: { padding: 0, borderRadius: 0, overflow: "visible", background: "transparent" },
1485
+ children: n ? /* @__PURE__ */ s("div", { className: dt(t), children: /* @__PURE__ */ s(ut, { attachment: n, isMyMessage: t }) }) : t ? /* @__PURE__ */ s(Ss, { ...a }) : /* @__PURE__ */ s(Es, { ...a })
1517
1486
  }
1518
1487
  ) })
1519
1488
  }
@@ -2368,7 +2337,9 @@ const Nr = ({
2368
2337
  alt: n.alt,
2369
2338
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2370
2339
  })), Pr = ({ src: e, alt: t, filename: n, loading: a = "lazy", onClick: r, onDismiss: i }) => {
2371
- const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Me(r);
2340
+ const { viewerOpen: l, viewerIndex: o, handleActivate: d, closeViewer: m } = Me(
2341
+ r
2342
+ );
2372
2343
  return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
2373
2344
  /* @__PURE__ */ s(
2374
2345
  "button",
@@ -2431,7 +2402,9 @@ const Nr = ({
2431
2402
  loading: o = "lazy",
2432
2403
  onClick: d
2433
2404
  }) => {
2434
- const m = Or({ src: t, alt: n, items: r }), h = Le(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: b } = Me(d), w = m.length === 1, p = Fr(w ? m[0] : void 0);
2405
+ const m = Or({ src: t, alt: n, items: r }), h = Le(e), { viewerOpen: u, viewerIndex: g, handleActivate: c, closeViewer: b } = Me(
2406
+ d
2407
+ ), w = m.length === 1, p = Fr(w ? m[0] : void 0);
2435
2408
  if (m.length === 0)
2436
2409
  return null;
2437
2410
  const x = m.map(
@@ -2570,7 +2543,9 @@ const Nr = ({
2570
2543
  onClick: d,
2571
2544
  onDismiss: m
2572
2545
  }) => {
2573
- const h = Le(e), u = Gr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(d), p = e === "composer" && !!m;
2546
+ const h = Le(e), u = Gr({ src: t, filename: n, fileSize: a, title: r, items: i }), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(
2547
+ d
2548
+ ), p = e === "composer" && !!m;
2574
2549
  if (u.length === 0)
2575
2550
  return null;
2576
2551
  const x = u.map((v) => ({
@@ -2713,7 +2688,9 @@ const Nr = ({
2713
2688
  preload: n.preload,
2714
2689
  filename: t && e.length === 1 ? t : t ? `${t} (${a + 1})` : void 0
2715
2690
  })), ei = ({ src: e, poster: t, mimeType: n, filename: a, preload: r, onClick: i, onDismiss: l }) => {
2716
- const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: h } = Me(i);
2691
+ const { viewerOpen: o, viewerIndex: d, handleActivate: m, closeViewer: h } = Me(
2692
+ i
2693
+ );
2717
2694
  return /* @__PURE__ */ f("div", { className: "relative w-fit", children: [
2718
2695
  /* @__PURE__ */ s(
2719
2696
  "button",
@@ -2730,7 +2707,10 @@ const Nr = ({
2730
2707
  Os,
2731
2708
  {
2732
2709
  open: o,
2733
- items: zs([{ src: e, poster: t, mimeType: n, preload: r }], a),
2710
+ items: zs(
2711
+ [{ src: e, poster: t, mimeType: n, preload: r }],
2712
+ a
2713
+ ),
2734
2714
  initialIndex: d,
2735
2715
  onClose: h
2736
2716
  }
@@ -2748,7 +2728,9 @@ const Nr = ({
2748
2728
  preload: d,
2749
2729
  onClick: m
2750
2730
  }) => {
2751
- const h = Qr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(m);
2731
+ const h = Qr({ src: t, poster: n, mimeType: a, preload: d, items: i }), u = Le(e), { viewerOpen: g, viewerIndex: c, handleActivate: b, closeViewer: w } = Me(
2732
+ m
2733
+ );
2752
2734
  if (h.length === 0)
2753
2735
  return null;
2754
2736
  const p = h.map(
@@ -2821,7 +2803,7 @@ const Nr = ({
2821
2803
  function ui(e) {
2822
2804
  return _e($s)[e] ?? di[e];
2823
2805
  }
2824
- const mi = z.lazy(() => import("./Card-DaJtDL7m.js")), hi = z.lazy(() => import("./Card-DVMzYquF.js")), fi = () => /* @__PURE__ */ s(
2806
+ const mi = z.lazy(() => import("./Card-qS17qnN0.js")), hi = z.lazy(() => import("./Card-D4PPD5qa.js")), fi = () => /* @__PURE__ */ s(
2825
2807
  "div",
2826
2808
  {
2827
2809
  className: "w-[280px] min-h-[200px] animate-pulse rounded-md bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]",
@@ -2926,13 +2908,7 @@ const mi = z.lazy(() => import("./Card-DaJtDL7m.js")), hi = z.lazy(() => import(
2926
2908
  "aria-label": "Bad response",
2927
2909
  "aria-pressed": e === "down",
2928
2910
  "data-tooltip": "Bad response",
2929
- children: /* @__PURE__ */ s(
2930
- oa,
2931
- {
2932
- size: 16,
2933
- weight: e === "down" ? "fill" : "regular"
2934
- }
2935
- )
2911
+ children: /* @__PURE__ */ s(oa, { size: 16, weight: e === "down" ? "fill" : "regular" })
2936
2912
  }
2937
2913
  )
2938
2914
  ] }), _t = () => {
@@ -3024,7 +3000,14 @@ const mi = z.lazy(() => import("./Card-DaJtDL7m.js")), hi = z.lazy(() => import(
3024
3000
  );
3025
3001
  return m ? /* @__PURE__ */ f("span", { className: "sent-message-status-row", children: [
3026
3002
  h,
3027
- l && /* @__PURE__ */ s("span", { className: "sent-message-broadcast-separator", "aria-hidden": "true", children: "•" }),
3003
+ l && /* @__PURE__ */ s(
3004
+ "span",
3005
+ {
3006
+ className: "sent-message-broadcast-separator",
3007
+ "aria-hidden": "true",
3008
+ children: "•"
3009
+ }
3010
+ ),
3028
3011
  m
3029
3012
  ] }) : h;
3030
3013
  }, Ci = /^([a-z][a-z0-9+.-]*):/i, Si = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel", "sms"]);
@@ -4108,7 +4091,13 @@ const Zi = ({
4108
4091
  },
4109
4092
  children: Tt ? /* @__PURE__ */ s(Ze, { message: c, standalone: !0 }) : bi(c) ? /* @__PURE__ */ s("div", { className: "str-chat__message-bubble-wrapper", children: /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
4110
4093
  te && F && /* @__PURE__ */ s(F, {}),
4111
- te ? /* @__PURE__ */ s(Fe, { ...Rt, isMine: !0 }) : /* @__PURE__ */ s(
4094
+ te ? /* @__PURE__ */ s(
4095
+ Fe,
4096
+ {
4097
+ ...Rt,
4098
+ isMine: !0
4099
+ }
4100
+ ) : /* @__PURE__ */ s(
4112
4101
  Fe,
4113
4102
  {
4114
4103
  ...Rt,
@@ -5589,14 +5578,7 @@ const Ro = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", L
5589
5578
  } : h, g = m && (((b = l == null ? void 0 : l[0]) == null ? void 0 : b.variant) ?? "primary") === "secondary", c = /* @__PURE__ */ f("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
5590
5579
  o && /* @__PURE__ */ f("div", { className: "flex min-w-0 items-center gap-2", children: [
5591
5580
  i ? /* @__PURE__ */ s("span", { className: "shrink-0", children: i }) : null,
5592
- /* @__PURE__ */ s(
5593
- "p",
5594
- {
5595
- className: k("min-w-0", Ro),
5596
- style: h,
5597
- children: n
5598
- }
5599
- )
5581
+ /* @__PURE__ */ s("p", { className: k("min-w-0", Ro), style: h, children: n })
5600
5582
  ] }),
5601
5583
  d && /* @__PURE__ */ s(
5602
5584
  "p",
@@ -5615,14 +5597,7 @@ const Ro = "line-clamp-2 text-[14px] font-medium leading-5 tracking-[0.28px]", L
5615
5597
  /* @__PURE__ */ s(os, { surface: e, actions: l, layout: "row" })
5616
5598
  ] }) : /* @__PURE__ */ f(J, { children: [
5617
5599
  c,
5618
- /* @__PURE__ */ s(
5619
- os,
5620
- {
5621
- surface: e,
5622
- actions: l,
5623
- layout: "stacked"
5624
- }
5625
- )
5600
+ /* @__PURE__ */ s(os, { surface: e, actions: l, layout: "stacked" })
5626
5601
  ] }) });
5627
5602
  }, Do = {
5628
5603
  dark: "bg-white/[0.06]",
@@ -5934,4 +5909,4 @@ export {
5934
5909
  bs as y,
5935
5910
  mt as z
5936
5911
  };
5937
- //# sourceMappingURL=index-BOBIiAuD.js.map
5912
+ //# sourceMappingURL=index-DGmVyxHy.js.map