@linktr.ee/messaging-react 3.12.4 → 3.12.5-rc-1784189661
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-BMJl2xlA.cjs → Card-CUeDtVX9.cjs} +2 -2
- package/dist/{Card-BMJl2xlA.cjs.map → Card-CUeDtVX9.cjs.map} +1 -1
- package/dist/{Card-CWlzDHJA.js → Card-Dvcwvr5y.js} +2 -2
- package/dist/{Card-CWlzDHJA.js.map → Card-Dvcwvr5y.js.map} +1 -1
- package/dist/{index-B2BrYTjw.js → index-CQm_f20V.js} +3 -3
- package/dist/index-CQm_f20V.js.map +1 -0
- package/dist/index-qzfxhUVd.cjs +2 -0
- package/dist/index-qzfxhUVd.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/utils/resolveParticipantDisplayName.test.ts +28 -0
- package/src/utils/resolveParticipantDisplayName.ts +5 -0
- package/dist/index-B2BrYTjw.js.map +0 -1
- package/dist/index-DSxpS5J9.cjs +0 -2
- package/dist/index-DSxpS5J9.cjs.map +0 -1
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-qzfxhUVd.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-CQm_f20V.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.12.
|
|
3
|
+
"version": "3.12.5-rc-1784189661",
|
|
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": "
|
|
53
|
+
"@linktr.ee/messaging-core": "2.3.0-rc-1784189661",
|
|
54
54
|
"@phosphor-icons/react": "^2.1.10"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
@@ -54,6 +54,34 @@ describe('resolveParticipantDisplayName', () => {
|
|
|
54
54
|
).toBe('Unknown member')
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
+
it('treats the `Follower <id>` placeholder name as missing', () => {
|
|
58
|
+
expect(
|
|
59
|
+
resolveParticipantDisplayName({
|
|
60
|
+
id: 'opaque-user-id',
|
|
61
|
+
name: 'Follower opaque-user-id',
|
|
62
|
+
})
|
|
63
|
+
).toBe('Unknown member')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('falls back to username when the name is the `Follower <id>` placeholder', () => {
|
|
67
|
+
expect(
|
|
68
|
+
resolveParticipantDisplayName({
|
|
69
|
+
id: 'opaque-user-id',
|
|
70
|
+
name: 'Follower opaque-user-id',
|
|
71
|
+
username: 'alice',
|
|
72
|
+
})
|
|
73
|
+
).toBe('alice')
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('does not treat a real name beginning with "Follower" as the placeholder', () => {
|
|
77
|
+
expect(
|
|
78
|
+
resolveParticipantDisplayName({
|
|
79
|
+
id: 'opaque-user-id',
|
|
80
|
+
name: 'Follower of Jesus',
|
|
81
|
+
})
|
|
82
|
+
).toBe('Follower of Jesus')
|
|
83
|
+
})
|
|
84
|
+
|
|
57
85
|
it('returns Unknown member when no usable fields exist', () => {
|
|
58
86
|
expect(resolveParticipantDisplayName({ id: 'user-1' })).toBe(
|
|
59
87
|
'Unknown member'
|
|
@@ -18,6 +18,11 @@ function isUsableDisplayValue(
|
|
|
18
18
|
const trimmed = value?.trim()
|
|
19
19
|
if (!trimmed) return false
|
|
20
20
|
if (userId && trimmed === userId) return false
|
|
21
|
+
// Followers with no real name were historically provisioned in Stream Chat with a
|
|
22
|
+
// placeholder name of the form `Follower <id>` (the string "Follower " + the user id).
|
|
23
|
+
// Treat it as missing so surfaces fall back to their own label instead of leaking the
|
|
24
|
+
// internal placeholder as a display name (MES-1077).
|
|
25
|
+
if (userId && trimmed === `Follower ${userId}`) return false
|
|
21
26
|
return !isUuidLike(trimmed)
|
|
22
27
|
}
|
|
23
28
|
|