@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/{Card-Cd0uC7M9.js → Card-DdmdgPiC.js} +2 -2
- package/dist/{Card-Cd0uC7M9.js.map → Card-DdmdgPiC.js.map} +1 -1
- package/dist/{Card-B1Rliu1L.cjs → Card-ZqURr2Xg.cjs} +2 -2
- package/dist/{Card-B1Rliu1L.cjs.map → Card-ZqURr2Xg.cjs.map} +1 -1
- package/dist/{index-Hlj3mc6w.js → index-CitR7B66.js} +120 -120
- package/dist/{index-Hlj3mc6w.js.map → index-CitR7B66.js.map} +1 -1
- package/dist/{index-CWpDkA50.cjs → index-QulHlER7.cjs} +3 -3
- package/dist/{index-CWpDkA50.cjs.map → index-QulHlER7.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/LinkAttachment/LinkAttachment.test.tsx +21 -20
- package/src/components/LinkAttachment/components/_shared/useChinPalette.ts +9 -10
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
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-
|
|
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
|
|
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.
|
|
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('
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// cannot
|
|
241
|
-
//
|
|
242
|
-
//
|
|
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
|
|
251
|
+
const { container, unmount } = renderWithProviders(
|
|
249
252
|
<LinkAttachment.Sent {...CARD_PROPS} {...AUDIO} accentColor={ACCENT} />
|
|
250
253
|
)
|
|
251
|
-
const
|
|
252
|
-
expect(
|
|
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
|
-
|
|
259
|
+
unmount()
|
|
255
260
|
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
265
|
+
accentColor={ACCENT}
|
|
264
266
|
/>
|
|
265
267
|
)
|
|
266
|
-
const
|
|
267
|
-
expect(
|
|
268
|
-
expect(
|
|
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
|
|
109
|
-
// `<audio>` player
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
113
|
-
// the
|
|
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
|
-
|
|
118
|
+
hasHero && status === 'ready'
|
|
120
119
|
? accentSurface(accentColor, variant)
|
|
121
120
|
: undefined
|
|
122
121
|
|