@linktr.ee/messaging-react 3.5.2 → 3.5.3
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-BvfoMxwz.cjs → Card-BGlzLvjX.cjs} +2 -2
- package/dist/{Card-BvfoMxwz.cjs.map → Card-BGlzLvjX.cjs.map} +1 -1
- package/dist/{Card-lFj_CszL.cjs → Card-BaMPX4IJ.cjs} +2 -2
- package/dist/{Card-lFj_CszL.cjs.map → Card-BaMPX4IJ.cjs.map} +1 -1
- package/dist/{Card-BnMjliau.js → Card-CylbFbg9.js} +3 -3
- package/dist/{Card-BnMjliau.js.map → Card-CylbFbg9.js.map} +1 -1
- package/dist/{Card-CSEdL1ew.js → Card-DjQ0O0ve.js} +2 -2
- package/dist/{Card-CSEdL1ew.js.map → Card-DjQ0O0ve.js.map} +1 -1
- package/dist/{Card-CVk576_V.js → Card-R_TPCRto.js} +2 -2
- package/dist/{Card-CVk576_V.js.map → Card-R_TPCRto.js.map} +1 -1
- package/dist/{Card-DLG18fjt.cjs → Card-dRbnFA_A.cjs} +2 -2
- package/dist/{Card-DLG18fjt.cjs.map → Card-dRbnFA_A.cjs.map} +1 -1
- package/dist/{LockedThumbnail-C1KdYxd0.cjs → LockedThumbnail-C5ahPvA3.cjs} +2 -2
- package/dist/{LockedThumbnail-C1KdYxd0.cjs.map → LockedThumbnail-C5ahPvA3.cjs.map} +1 -1
- package/dist/{LockedThumbnail-0k5MyzJ7.js → LockedThumbnail-CCQ4wzdn.js} +2 -2
- package/dist/{LockedThumbnail-0k5MyzJ7.js.map → LockedThumbnail-CCQ4wzdn.js.map} +1 -1
- package/dist/{index-DxuG__WG.js → index-BOzklqIY.js} +310 -310
- package/dist/index-BOzklqIY.js.map +1 -0
- package/dist/index-BYS-61iP.cjs +2 -0
- package/dist/index-BYS-61iP.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.test.tsx +26 -0
- package/src/components/Avatar/index.tsx +9 -8
- package/dist/index-DxuG__WG.js.map +0 -1
- package/dist/index-Suw7bhfA.cjs +0 -2
- package/dist/index-Suw7bhfA.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-BYS-61iP.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.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.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 d, m as p, n as v, o as C, p as A, q as k, s as F, t as P, u as b, v as f, w as x, x as y, y as S, z as q, B as z, D as B, E as D, G as E } 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 d, m as p, n as v, o as C, p as A, q as k, s as F, t as P, u as b, v as f, w as x, x as y, y as S, z as q, B as z, D as B, E as D, G as E } from "./index-BOzklqIY.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ActionButton,
|
|
4
4
|
t as Avatar,
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
|
|
4
|
+
import { renderWithProviders, screen } from '../../test/utils'
|
|
5
|
+
|
|
6
|
+
import { Avatar } from '.'
|
|
7
|
+
|
|
8
|
+
describe('Avatar', () => {
|
|
9
|
+
it('uses a smaller emoji font size for sub-20px avatars', () => {
|
|
10
|
+
renderWithProviders(<Avatar id="user-1" name="Alice" size={18} />)
|
|
11
|
+
|
|
12
|
+
expect(screen.getByText(/\p{Emoji}/u)).toHaveStyle({
|
|
13
|
+
fontSize: '10px',
|
|
14
|
+
lineHeight: '1',
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
it('keeps the existing 12px emoji size for 20px avatars', () => {
|
|
19
|
+
renderWithProviders(<Avatar id="user-1" name="Alice" size={20} />)
|
|
20
|
+
|
|
21
|
+
expect(screen.getByText(/\p{Emoji}/u)).toHaveStyle({
|
|
22
|
+
fontSize: '12px',
|
|
23
|
+
lineHeight: '1',
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -29,14 +29,15 @@ export const Avatar = ({
|
|
|
29
29
|
}: AvatarProps) => {
|
|
30
30
|
const emoji = getAvatarEmoji(id)
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
if (size <
|
|
34
|
-
if (size <
|
|
35
|
-
if (size <
|
|
36
|
-
return
|
|
32
|
+
const getFontSize = () => {
|
|
33
|
+
if (size < 20) return 10
|
|
34
|
+
if (size < 32) return 12
|
|
35
|
+
if (size < 56) return 14
|
|
36
|
+
if (size < 120) return 18
|
|
37
|
+
return 36
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
const
|
|
40
|
+
const fontSize = getFontSize()
|
|
40
41
|
// Match design treatment: 2px AI border at 40px avatar size.
|
|
41
42
|
const aiBorderWidth = size >= 40 ? 2 : 1
|
|
42
43
|
|
|
@@ -57,9 +58,9 @@ export const Avatar = ({
|
|
|
57
58
|
<div
|
|
58
59
|
aria-hidden="true"
|
|
59
60
|
className={classNames(
|
|
60
|
-
'avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors'
|
|
61
|
-
fontSizeClass
|
|
61
|
+
'avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors'
|
|
62
62
|
)}
|
|
63
|
+
style={{ fontSize: `${fontSize}px`, lineHeight: 1 }}
|
|
63
64
|
>
|
|
64
65
|
{emoji}
|
|
65
66
|
</div>
|