@linktr.ee/messaging-react 3.5.4-rc-1782919630 → 3.5.4-rc-1782923875
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-BaMPX4IJ.cjs → Card--81_C_sQ.cjs} +2 -2
- package/dist/{Card-BaMPX4IJ.cjs.map → Card--81_C_sQ.cjs.map} +1 -1
- package/dist/{Card-BGlzLvjX.cjs → Card-B3vKWCNO.cjs} +2 -2
- package/dist/{Card-BGlzLvjX.cjs.map → Card-B3vKWCNO.cjs.map} +1 -1
- package/dist/{Card-dRbnFA_A.cjs → Card-CeONWqN2.cjs} +2 -2
- package/dist/{Card-dRbnFA_A.cjs.map → Card-CeONWqN2.cjs.map} +1 -1
- package/dist/{Card-CylbFbg9.js → Card-Dxq760eB.js} +3 -3
- package/dist/{Card-CylbFbg9.js.map → Card-Dxq760eB.js.map} +1 -1
- package/dist/{Card-DjQ0O0ve.js → Card-Ss_tlf9e.js} +2 -2
- package/dist/{Card-DjQ0O0ve.js.map → Card-Ss_tlf9e.js.map} +1 -1
- package/dist/{Card-R_TPCRto.js → Card-ukTqXWLq.js} +2 -2
- package/dist/{Card-R_TPCRto.js.map → Card-ukTqXWLq.js.map} +1 -1
- package/dist/{LockedThumbnail-CCQ4wzdn.js → LockedThumbnail-BC_Di5pi.js} +2 -2
- package/dist/{LockedThumbnail-CCQ4wzdn.js.map → LockedThumbnail-BC_Di5pi.js.map} +1 -1
- package/dist/{LockedThumbnail-C5ahPvA3.cjs → LockedThumbnail-DDOEKes4.cjs} +2 -2
- package/dist/{LockedThumbnail-C5ahPvA3.cjs.map → LockedThumbnail-DDOEKes4.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-BOzklqIY.js → index-Tv7yJSkO.js} +82 -82
- package/dist/index-Tv7yJSkO.js.map +1 -0
- package/dist/index-wqJgn5CZ.cjs +2 -0
- package/dist/index-wqJgn5CZ.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/Avatar/Avatar.test.tsx +16 -12
- package/src/components/Avatar/index.tsx +7 -3
- package/src/styles.css +4 -5
- package/dist/index-BOzklqIY.js.map +0 -1
- package/dist/index-BYS-61iP.cjs +0 -2
- package/dist/index-BYS-61iP.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-wqJgn5CZ.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-Tv7yJSkO.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.5.4-rc-
|
|
3
|
+
"version": "3.5.4-rc-1782923875",
|
|
4
4
|
"description": "React messaging components built on messaging-core for web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@linktr.ee/component-library": "11.8.6",
|
|
41
|
-
"@linktr.ee/messaging-core": "2.3.0-rc-
|
|
41
|
+
"@linktr.ee/messaging-core": "2.3.0-rc-1782923875",
|
|
42
42
|
"@phosphor-icons/react": "^2.1.10"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
@@ -6,21 +6,25 @@ import { renderWithProviders, screen } from '../../test/utils'
|
|
|
6
6
|
import { Avatar } from '.'
|
|
7
7
|
|
|
8
8
|
describe('Avatar', () => {
|
|
9
|
-
|
|
10
|
-
renderWithProviders(<Avatar id="user-1" name="Alice" size={
|
|
9
|
+
const emojiFontSize = (size: number) => {
|
|
10
|
+
renderWithProviders(<Avatar id="user-1" name="Alice" size={size} />)
|
|
11
|
+
return screen.getByText(/\p{Emoji}/u)
|
|
12
|
+
}
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
lineHeight: '1',
|
|
15
|
-
})
|
|
14
|
+
it('scales the emoji with small (<32px) avatars so it does not overpower them', () => {
|
|
15
|
+
expect(emojiFontSize(18)).toHaveStyle({ fontSize: '8px', lineHeight: '1' })
|
|
16
16
|
})
|
|
17
17
|
|
|
18
|
-
it('
|
|
19
|
-
|
|
18
|
+
it('scales up proportionally as small avatars grow', () => {
|
|
19
|
+
expect(emojiFontSize(20)).toHaveStyle({ fontSize: '9px' })
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('stays continuous with the fixed 14px step at the 32px boundary', () => {
|
|
23
|
+
// 31 * 0.45 rounds to 14, matching the >=32px fixed size.
|
|
24
|
+
expect(emojiFontSize(31)).toHaveStyle({ fontSize: '14px' })
|
|
25
|
+
})
|
|
20
26
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
lineHeight: '1',
|
|
24
|
-
})
|
|
27
|
+
it('keeps fixed emoji sizes for larger avatars', () => {
|
|
28
|
+
expect(emojiFontSize(40)).toHaveStyle({ fontSize: '14px' })
|
|
25
29
|
})
|
|
26
30
|
})
|
|
@@ -29,9 +29,13 @@ export const Avatar = ({
|
|
|
29
29
|
}: AvatarProps) => {
|
|
30
30
|
const emoji = getAvatarEmoji(id)
|
|
31
31
|
|
|
32
|
+
// Small avatars scale the emoji with the avatar so it doesn't overpower a
|
|
33
|
+
// tiny circle — a fixed floor read ~60% of a 17px avatar vs ~35% at 40px.
|
|
34
|
+
// Larger avatars keep fixed sizes. 0.45 is continuous with the 14px step at
|
|
35
|
+
// 32px; lower it to shrink small emoji further.
|
|
36
|
+
const SMALL_EMOJI_RATIO = 0.45
|
|
32
37
|
const getFontSize = () => {
|
|
33
|
-
if (size <
|
|
34
|
-
if (size < 32) return 12
|
|
38
|
+
if (size < 32) return Math.round(size * SMALL_EMOJI_RATIO)
|
|
35
39
|
if (size < 56) return 14
|
|
36
40
|
if (size < 120) return 18
|
|
37
41
|
return 36
|
|
@@ -60,7 +64,7 @@ export const Avatar = ({
|
|
|
60
64
|
className={classNames(
|
|
61
65
|
'avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors'
|
|
62
66
|
)}
|
|
63
|
-
style={{ fontSize
|
|
67
|
+
style={{ fontSize, lineHeight: 1 }}
|
|
64
68
|
>
|
|
65
69
|
{emoji}
|
|
66
70
|
</div>
|
package/src/styles.css
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
--str-chat__font-family: inherit;
|
|
9
9
|
|
|
10
10
|
--str-chat__message-bubble-border-radius: 1.5rem;
|
|
11
|
-
--str-chat__message-bubble-background-color: #
|
|
12
|
-
--str-chat__message-bubble-color: #
|
|
11
|
+
--str-chat__message-bubble-background-color: #f1f0ee;
|
|
12
|
+
--str-chat__message-bubble-color: #181818;
|
|
13
13
|
|
|
14
|
-
--str-chat__own-message-bubble-background-color: #
|
|
14
|
+
--str-chat__own-message-bubble-background-color: #121110;
|
|
15
15
|
--str-chat__own-message-bubble-color: #fff;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -560,8 +560,7 @@
|
|
|
560
560
|
|
|
561
561
|
.str-chat__message .str-chat__message-bubble {
|
|
562
562
|
font-size: 0.875rem;
|
|
563
|
-
line-height: 1.
|
|
564
|
-
letter-spacing: 0.14px;
|
|
563
|
+
line-height: 1.25rem;
|
|
565
564
|
}
|
|
566
565
|
|
|
567
566
|
/* Chatbot reply markdown — restore semantics that consumer Tailwind preflight
|