@linktr.ee/messaging-react 3.16.0-rc-1785214411 → 3.16.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.
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2STuN782.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CyH3LHVq.cjs");exports.ActionButton=e.ActionButton;exports.Avatar=e.Avatar;exports.ChannelEmptyState=e.ChannelEmptyState;exports.ChannelList=e.ChannelList;exports.ChannelView=e.ChannelView;exports.CustomMessageProvider=e.CustomMessageProvider;exports.FaqList=e.FaqList;exports.FaqListItem=e.FaqListItem;exports.LinkAttachment=e.LinkAttachment;exports.LockedAttachment=e.LockedAttachment;exports.MediaMessage=e.MediaMessage;exports.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessageVoteButtons=e.MessageVoteButtons;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.buildCompactMetaLabel=e.buildCompactMetaLabel;exports.formatFileSize=e.formatFileSize;exports.formatRelativeTime=e.formatRelativeTime;exports.getFileExtensionLabel=e.getFileExtensionLabel;exports.getMessageDisplayText=e.getMessageDisplayText;exports.isLinkAttachment=e.isLinkAttachment;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveLinkAttachment=e.resolveLinkAttachment;exports.resolveMediaFromMessage=e.resolveMediaFromMessage;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessageVote=e.useMessageVote;exports.useMessaging=e.useMessaging;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-vYOR0x6o.js";
1
+ import { a as e, b as t, C as i, c as o, d as n, e as m, F as r, f as g, L as l, h as M, M as c, i as u, j as L, k as h, l as p, m as d, n as v, p as C, q as A, s as k, t as F, u as b, v as P, w as f, x, o as y, y as z, z as B, B as S, D as q, E as D, G as E, H as V, I as w } from "./index-BB32JkPv.js";
2
2
  export {
3
3
  e as ActionButton,
4
4
  t as Avatar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/messaging-react",
3
- "version": "3.16.0-rc-1785214411",
3
+ "version": "3.16.0",
4
4
  "description": "React messaging components built on messaging-core for web applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@linktr.ee/component-library": "11.8.6",
53
- "@linktr.ee/messaging-core": "2.3.0-rc-1785214411",
53
+ "@linktr.ee/messaging-core": "^2.2.0",
54
54
  "@phosphor-icons/react": "^2.1.10"
55
55
  },
56
56
  "devDependencies": {
@@ -9,13 +9,13 @@ import { renderWithProviders, screen, within } from '../../test/utils'
9
9
 
10
10
  import { SentMessageDeliveryStatus } from './SentMessageDeliveryStatus'
11
11
 
12
- // stream-chat-react's `MessageStatus` owns the outer gating (own message, not
13
- // error, not in a thread) and only exposes a terminal state once a message is
14
- // stored Stream's tested code. What this component owns is the "Delivered"
15
- // label wired into the terminal slots (sent/delivered/read), its "latest
16
- // message in the thread" gate derived from live channel state. Mock
17
- // `MessageStatus` to render the slots it was handed,
18
- // and the context hooks the label reads.
12
+ // stream-chat-react's `MessageStatus` owns own-message / not-error gating and
13
+ // only exposes a terminal state once a message is stored — Stream's tested
14
+ // code. Its threadList guard skips `sending`, so this component owns
15
+ // thread-list suppression plus the "Delivered"/"Sending" labels and the
16
+ // "latest message in the thread" gate from live channel state. Mock
17
+ // `MessageStatus` to render the slots it was handed, and the context hooks
18
+ // the label reads.
19
19
  vi.mock('stream-chat-react', () => ({
20
20
  useMessageContext: vi.fn(),
21
21
  useChannelStateContext: vi.fn(),
@@ -138,6 +138,7 @@ describe('SentMessageDeliveryStatus', () => {
138
138
  it('renders "Sending" in the sending slot for the latest message', () => {
139
139
  mockedUseMessageContext.mockReturnValue({
140
140
  message: { id: 'own-2', status: 'sending' },
141
+ threadList: false,
141
142
  } as never)
142
143
 
143
144
  renderWithProviders(<SentMessageDeliveryStatus />)
@@ -148,6 +149,7 @@ describe('SentMessageDeliveryStatus', () => {
148
149
  it('does not render "Sending" for an earlier message', () => {
149
150
  mockedUseMessageContext.mockReturnValue({
150
151
  message: { id: 'own-1', status: 'sending' },
152
+ threadList: false,
151
153
  } as never)
152
154
 
153
155
  renderWithProviders(<SentMessageDeliveryStatus />)
@@ -155,6 +157,22 @@ describe('SentMessageDeliveryStatus', () => {
155
157
  expect(screen.getByTestId('sending-slot')).toBeEmptyDOMElement()
156
158
  })
157
159
 
160
+ it('does not render "Sending" inside a thread list', () => {
161
+ // Stream's MessageStatus still invokes MessageSendingStatus when
162
+ // threadList is true; we suppress the stamp ourselves.
163
+ mockedUseMessageContext.mockReturnValue({
164
+ message: { id: 'own-2', status: 'sending' },
165
+ threadList: true,
166
+ } as never)
167
+
168
+ renderWithProviders(<SentMessageDeliveryStatus />)
169
+
170
+ expect(screen.queryByTestId('sending-slot')).not.toBeInTheDocument()
171
+ expect(
172
+ screen.queryByTestId('sent-message-sending-status')
173
+ ).not.toBeInTheDocument()
174
+ })
175
+
158
176
  it('renders "Failed to send" for every own failed message', () => {
159
177
  mockedUseMessageContext.mockReturnValue({
160
178
  message: { id: 'own-1', status: 'failed', type: 'regular' },
@@ -105,23 +105,30 @@ const FailedStatus = () => (
105
105
  * a right-aligned "✓✓ Delivered" that appears once Stream confirms the
106
106
  * message is stored and updates live.
107
107
  *
108
- * Built on stream-chat-react's `MessageStatus`, which owns the gating we keep
109
- * — own message, not an error, not inside a thread — and only surfaces a
110
- * terminal (sending/sent/delivered/read) state once the message is stored.
111
- * Sending uses the same latest-message-in-thread gate, while failed messages
112
- * bypass `MessageStatus` because it has no failed slot and are shown on every
113
- * own, non-thread failed message.
108
+ * Built on stream-chat-react's `MessageStatus`, which owns the own-message /
109
+ * not-error gating and only surfaces a terminal (sending/sent/delivered/read)
110
+ * state once the message is stored. Stream's `threadList` guard covers
111
+ * sent/delivered/read only not `sending` so we suppress the whole stamp
112
+ * (including failed) in thread lists ourselves. Sending uses the same
113
+ * latest-message-in-thread gate; failed messages bypass `MessageStatus`
114
+ * because it has no failed slot and are shown on every own, non-thread
115
+ * failed message.
114
116
  */
115
117
  export const SentMessageDeliveryStatus = () => {
116
118
  const { isMyMessage, message, threadList } = useMessageContext(
117
119
  'SentMessageDeliveryStatus'
118
120
  )
119
121
 
122
+ // Stream's MessageStatus still mounts MessageSendingStatus when
123
+ // threadList is true; keep all of our stamps out of thread replies.
124
+ if (threadList) {
125
+ return null
126
+ }
127
+
120
128
  if (
121
129
  message.status === 'failed' &&
122
130
  isMyMessage() &&
123
- message.type !== 'error' &&
124
- !threadList
131
+ message.type !== 'error'
125
132
  ) {
126
133
  return <FailedStatus />
127
134
  }