@linktr.ee/messaging-react 3.5.4-rc-1782920176 → 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-Cvy-wtHk.cjs → Card--81_C_sQ.cjs} +2 -2
- package/dist/{Card-Cvy-wtHk.cjs.map → Card--81_C_sQ.cjs.map} +1 -1
- package/dist/{Card-yGooZXB0.cjs → Card-B3vKWCNO.cjs} +2 -2
- package/dist/{Card-yGooZXB0.cjs.map → Card-B3vKWCNO.cjs.map} +1 -1
- package/dist/{Card-CxeRmW47.cjs → Card-CeONWqN2.cjs} +2 -2
- package/dist/{Card-CxeRmW47.cjs.map → Card-CeONWqN2.cjs.map} +1 -1
- package/dist/{Card-CKV0d2i9.js → Card-Dxq760eB.js} +3 -3
- package/dist/{Card-CKV0d2i9.js.map → Card-Dxq760eB.js.map} +1 -1
- package/dist/{Card-BkToB7yL.js → Card-Ss_tlf9e.js} +2 -2
- package/dist/{Card-BkToB7yL.js.map → Card-Ss_tlf9e.js.map} +1 -1
- package/dist/{Card-DbdWoTwf.js → Card-ukTqXWLq.js} +2 -2
- package/dist/{Card-DbdWoTwf.js.map → Card-ukTqXWLq.js.map} +1 -1
- package/dist/{LockedThumbnail-PsO_A6dM.js → LockedThumbnail-BC_Di5pi.js} +3 -3
- package/dist/{LockedThumbnail-PsO_A6dM.js.map → LockedThumbnail-BC_Di5pi.js.map} +1 -1
- package/dist/{LockedThumbnail-Dkr6-8Lw.cjs → LockedThumbnail-DDOEKes4.cjs} +2 -2
- package/dist/{LockedThumbnail-Dkr6-8Lw.cjs.map → LockedThumbnail-DDOEKes4.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-B7fsmwKg.js → index-Tv7yJSkO.js} +87 -87
- 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/AttachmentCard/index.tsx +1 -1
- package/src/components/Avatar/Avatar.test.tsx +16 -12
- package/src/components/Avatar/index.tsx +7 -3
- package/src/components/CustomLinkPreviewList/CustomLinkPreviewCard.tsx +1 -1
- package/src/components/CustomMessage/MessageAttachmentConversations.stories.tsx +1 -1
- package/src/components/CustomMessage/MessageTag.stories.tsx +2 -2
- package/src/components/LinkAttachment/components/_shared/CardShell.tsx +1 -1
- package/src/components/LockedAttachment/components/_shared/LockedCardShell.tsx +1 -1
- package/src/components/MediaMessage/index.tsx +1 -1
- package/src/components/MessageAttachment/_shared/Bubble.tsx +3 -3
- package/src/styles.css +4 -5
- package/dist/index-B7fsmwKg.js.map +0 -1
- package/dist/index-CwyUGS68.cjs +0 -2
- package/dist/index-CwyUGS68.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": {
|
|
@@ -57,7 +57,7 @@ const AttachmentCard: React.FC<AttachmentCardProps> = ({
|
|
|
57
57
|
data-testid={dataTestId}
|
|
58
58
|
className={classNames(
|
|
59
59
|
'relative w-[280px] select-none overflow-hidden rounded-[24px] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]',
|
|
60
|
-
isDark ? 'bg-[#
|
|
60
|
+
isDark ? 'bg-[#121110]' : 'bg-white'
|
|
61
61
|
)}
|
|
62
62
|
>
|
|
63
63
|
{topLeft ? (
|
|
@@ -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>
|
|
@@ -23,7 +23,7 @@ const CustomLinkPreviewCard: React.FC<CustomLinkPreviewCardProps> = ({
|
|
|
23
23
|
href={og_scrape_url}
|
|
24
24
|
target="_blank"
|
|
25
25
|
rel="noopener noreferrer"
|
|
26
|
-
className="relative block w-full rounded-[24px] bg-[#
|
|
26
|
+
className="relative block w-full rounded-[24px] bg-[#121110] p-2 no-underline transition-opacity hover:opacity-90"
|
|
27
27
|
>
|
|
28
28
|
{image_url && (
|
|
29
29
|
<img
|
|
@@ -83,7 +83,7 @@ ChatbotReceiverText.parameters = skipInChromatic
|
|
|
83
83
|
export const ChatbotSenderText: StoryFn<ComponentProps> = (args) => {
|
|
84
84
|
return (
|
|
85
85
|
<div className="p-12">
|
|
86
|
-
<div className="bg-[#
|
|
86
|
+
<div className="bg-[#121110] rounded-[24px] px-4 py-3 w-[280px]">
|
|
87
87
|
<MessageTag {...args} />
|
|
88
88
|
</div>
|
|
89
89
|
</div>
|
|
@@ -150,7 +150,7 @@ export const AllVariants: StoryFn = () => {
|
|
|
150
150
|
</div>
|
|
151
151
|
<div className="flex items-center gap-4">
|
|
152
152
|
<span className="text-sm w-32">Chatbot (sender):</span>
|
|
153
|
-
<div className="bg-[#
|
|
153
|
+
<div className="bg-[#121110] rounded-[24px] px-4 py-3 w-[280px]">
|
|
154
154
|
<MessageTag
|
|
155
155
|
message={createMockMessage({
|
|
156
156
|
metadata: { custom_type: 'MESSAGE_CHATBOT' },
|
|
@@ -64,7 +64,7 @@ const CardShell: React.FC<CardShellProps> = ({
|
|
|
64
64
|
const isInteractive = href != null || onClick != null
|
|
65
65
|
const className = classNames(
|
|
66
66
|
SHELL_CLASS,
|
|
67
|
-
bgClassName ?? (variant === 'dark' ? 'bg-[#
|
|
67
|
+
bgClassName ?? (variant === 'dark' ? 'bg-[#121110]' : 'bg-white'),
|
|
68
68
|
// `focus-ring` is a design-system utility from the component-library
|
|
69
69
|
// tailwind preset — outline-none + a black 2px focus-visible ring
|
|
70
70
|
// with offset, so keyboard users can see the focused card.
|
|
@@ -26,7 +26,7 @@ const LockedCardShell: React.FC<LockedCardShellProps> = ({
|
|
|
26
26
|
className={classNames(
|
|
27
27
|
'relative w-[280px] select-none overflow-hidden rounded-md',
|
|
28
28
|
'shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_1px_2px_rgba(0,0,0,0.04),0_8px_32px_rgba(0,0,0,0.1)]',
|
|
29
|
-
variant === 'dark' ? 'bg-[#
|
|
29
|
+
variant === 'dark' ? 'bg-[#121110]' : 'bg-white'
|
|
30
30
|
)}
|
|
31
31
|
>
|
|
32
32
|
{children}
|
|
@@ -15,7 +15,7 @@ function formatBytes(bytes: number): string {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function linkCardShellClass(isMyMessage: boolean) {
|
|
18
|
-
const bg = isMyMessage ? 'bg-[#
|
|
18
|
+
const bg = isMyMessage ? 'bg-[#121110]' : 'bg-[#F3F3F1]'
|
|
19
19
|
return `w-[280px] select-none overflow-hidden rounded-[24px] ${bg} shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]`
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -30,7 +30,7 @@ export interface BubbleProps {
|
|
|
30
30
|
// `.str-chat__message-bubble` token set so attachments visually drop
|
|
31
31
|
// into a normal `CustomMessage` thread without any seams:
|
|
32
32
|
// - light → `--str-chat__secondary-surface-color` = grey200 (#e9eaed)
|
|
33
|
-
// - dark → `.str-chat__message--me` override in `styles.css` (#
|
|
33
|
+
// - dark → `.str-chat__message--me` override in `styles.css` (#121110)
|
|
34
34
|
// - text padding → `--str-chat__spacing-2 --str-chat__spacing-4` = 8px 16px
|
|
35
35
|
// - border-radius → `--str-chat__border-radius-md` = 18px
|
|
36
36
|
//
|
|
@@ -41,7 +41,7 @@ export interface BubbleProps {
|
|
|
41
41
|
// rebrand would need to touch every site. A central token would
|
|
42
42
|
// collapse the migration to one definition.
|
|
43
43
|
const BUBBLE_BG_BY_VARIANT: Record<BubbleVariant, string> = {
|
|
44
|
-
dark: 'bg-[#
|
|
44
|
+
dark: 'bg-[#121110]',
|
|
45
45
|
light: 'bg-[#e9eaed]',
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -104,7 +104,7 @@ const CORNER_CLASSES_BY_SIDE_AND_POSITION: Record<
|
|
|
104
104
|
* is the file', 'Here is the image').
|
|
105
105
|
*
|
|
106
106
|
* Two visual variants:
|
|
107
|
-
* - `dark` — sender-side (Composer / Sent), white text on `#
|
|
107
|
+
* - `dark` — sender-side (Composer / Sent), white text on `#121110`.
|
|
108
108
|
* - `light` — recipient-side (Received), dark text on `#e9eaed`.
|
|
109
109
|
*
|
|
110
110
|
* Background colors, padding, border-radius, and inherited font come
|
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
|