@linktr.ee/messaging-react 3.25.0-rc-1785443162 → 3.25.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-CWpDkA50.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-QulHlER7.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-Hlj3mc6w.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-CitR7B66.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.25.0-rc-1785443162",
3
+ "version": "3.25.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-1785443162",
53
+ "@linktr.ee/messaging-core": "^2.2.0",
54
54
  "@linktr.ee/messaging-taxonomy": "^0.3.0",
55
55
  "@phosphor-icons/react": "^2.1.10",
56
56
  "culori": "^4.0.2"
@@ -234,39 +234,40 @@ describe('LinkAttachment accent chin (MES-1349, MES-1388)', () => {
234
234
  expect(container.querySelector('video')).not.toHaveAttribute('poster')
235
235
  })
236
236
 
237
- it('derives audio artwork into the surface, and inks the flat fill when there is none', async () => {
238
- // MES-1349 refused the accent here because the hero collapses to the native
239
- // player and the artwork is never shown. The colour is derived now, so it
240
- // cannot mislead about legibility, and artwork is what distinguishes one
241
- // track from another so it paints. Reachable through Stream, which maps
242
- // any playable link attachment to `featured`.
237
+ it('leaves a playable audio card on its flat fill, and inks that fill dark', async () => {
238
+ // The accent stays out: the hero collapses to the native player, so artwork
239
+ // never appears and a colour taken from it would describe an image the
240
+ // viewer cannot see (MES-1349). Colouring audio from its artwork belongs to
241
+ // the audio tickets, not here.
242
+ //
243
+ // The ink does change. `AUDIO_BG_CLASS` is near-white and is applied to a
244
+ // *sent* card, whose variant ink is white — 1.13:1, invisible. Ink now
245
+ // follows the surface the card was given rather than the variant (MES-1388).
243
246
  const AUDIO = {
244
247
  mimeType: 'audio/mpeg',
245
248
  sourceUrl: 'https://cdn.example.com/clip.mp3',
246
249
  }
247
250
 
248
- const withArtwork = renderWithProviders(
251
+ const { container, unmount } = renderWithProviders(
249
252
  <LinkAttachment.Sent {...CARD_PROPS} {...AUDIO} accentColor={ACCENT} />
250
253
  )
251
- const painted = withArtwork.container.firstElementChild as HTMLElement
252
- expect(painted.style.backgroundColor).not.toBe('')
254
+ const sent = container.firstElementChild as HTMLElement
255
+ expect(sent.style.backgroundColor).toBe('')
256
+ expect(sent.className).toContain(AUDIO_BG_CLASS)
257
+ expect(screen.getByText(CARD_PROPS.title)).toHaveStyle({ color: '#040403' })
253
258
  expect(screen.queryByRole('img')).toBeNull()
254
- withArtwork.unmount()
259
+ unmount()
255
260
 
256
- // No artwork: the flat audio fill stays, and this is the MES-1388 bug —
257
- // `AUDIO_BG_CLASS` is near-white and lands on a *sent* card, whose variant
258
- // ink is white. Ink must follow the fill it was given, not the variant.
259
- const bare = renderWithProviders(
260
- <LinkAttachment.Sent
261
+ renderWithProviders(
262
+ <LinkAttachment.Received
261
263
  {...CARD_PROPS}
262
264
  {...AUDIO}
263
- thumbnailUrl={undefined}
265
+ accentColor={ACCENT}
264
266
  />
265
267
  )
266
- const flat = bare.container.firstElementChild as HTMLElement
267
- expect(flat.style.backgroundColor).toBe('')
268
- expect(flat.className).toContain(AUDIO_BG_CLASS)
269
- expect(screen.getByText(CARD_PROPS.title)).toHaveStyle({ color: '#040403' })
268
+ const received = await screen.findByTestId('link-attachment')
269
+ expect(received.style.backgroundColor).toBe('')
270
+ expect(received.className).toContain(AUDIO_BG_CLASS)
270
271
  })
271
272
 
272
273
  it('drops the accent when the featured hero has no image to show', async () => {
@@ -105,18 +105,17 @@ export function useChinPalette({
105
105
  // Truthiness rather than `!= null` so this tracks `CardThumbnail`'s own
106
106
  // `thumbnailUrl ?` branch, which renders the placeholder for `''` too.
107
107
  //
108
- // Playable audio is included even though its hero collapses to the native
109
- // `<audio>` player and the artwork is never displayed. MES-1349 excluded it
110
- // on the grounds that an accent is a claim about an image the viewer can see;
111
- // the colour is now derived rather than painted raw, so it can no longer
112
- // mislead about legibility, and an audio attachment with artwork is exactly
113
- // the case where colour distinguishes one track from another. The cost is
114
- // that a 404 artwork still tints the card here: the `<img>` never mounts, so
115
- // `onImageError` cannot fire to withdraw it.
116
- const hasArtwork = layout === 'featured' && !!thumbnailUrl && !heroFailed
108
+ // Playable audio stays excluded, as MES-1349 decided: its hero collapses to
109
+ // the native `<audio>` player, so the artwork never appears and an accent
110
+ // taken from it would be a claim about an image the viewer cannot see. The
111
+ // `<img>` never mounts either, so `onImageError` could not withdraw the colour
112
+ // if the artwork 404'd. Colouring audio cards from their artwork is a change
113
+ // to the audio tickets (MES-1360 / MES-1361), not to this one.
117
114
  const isAudio = isPlayableAudio(mimeType, sourceUrl)
115
+ const hasHero =
116
+ layout === 'featured' && !!thumbnailUrl && !isAudio && !heroFailed
118
117
  const surface =
119
- hasArtwork && status === 'ready'
118
+ hasHero && status === 'ready'
120
119
  ? accentSurface(accentColor, variant)
121
120
  : undefined
122
121