@linktr.ee/messaging-react 4.3.1-rc-1787564868 → 4.3.1-rc-1787565296
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-CPjlTEDn.js → Card-CyWHWq0c.js} +2 -2
- package/dist/{Card-CPjlTEDn.js.map → Card-CyWHWq0c.js.map} +1 -1
- package/dist/{Card-Bgapr7T9.cjs → Card-DnxM0CSC.cjs} +2 -2
- package/dist/{Card-Bgapr7T9.cjs.map → Card-DnxM0CSC.cjs.map} +1 -1
- package/dist/{index-BpUohOUq.cjs → index-BtVpvpDD.cjs} +3 -3
- package/dist/{index-BpUohOUq.cjs.map → index-BtVpvpDD.cjs.map} +1 -1
- package/dist/{index-BJ1FkeL1.js → index-CtmXbMa5.js} +7 -6
- package/dist/{index-BJ1FkeL1.js.map → index-CtmXbMa5.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/components/MessageBubble/MessageBubble.stories.tsx +7 -1
- package/src/components/MessageBubble/MessageBubble.test.tsx +18 -7
- package/src/components/MessageBubble/components/_shared/BubbleShell.tsx +13 -8
- package/src/components/RichCard/RichCard.stories.tsx +13 -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-BtVpvpDD.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.MessageAttachment=e.MessageAttachment;exports.MessageBubble=e.MessageBubble;exports.MessagingLoggerProvider=e.MessagingLoggerProvider;exports.MessagingProvider=e.MessagingProvider;exports.MessagingShell=e.MessagingShell;exports.RichCard=e.RichCard;exports.TipMessage=e.TipMessage;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.isTipMessage=e.isTipMessage;exports.isUuidLike=e.isUuidLike;exports.messageAttachmentGroupPositionFromStream=e.bubbleGroupPositionFromStream;exports.normalizeLanguageCode=e.normalizeLanguageCode;exports.optimizeMessagingAttachmentUrl=e.optimizeMessagingAttachmentUrl;exports.resolveConversationParticipant=e.resolveConversationParticipant;exports.resolveParticipantDisplayName=e.resolveParticipantDisplayName;exports.useComposerLocked=e.useComposerLocked;exports.useCustomMessage=e.useCustomMessage;exports.useMessaging=e.useMessaging;exports.useMessagingLogger=e.useMessagingLogger;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as t, C as i, b as n, c as o, d as g, F as r, e as m, L as l, f as M, M as c, h as L, i as p, j as u, k as h, R as C, T as d, l as v, m as A, n as b, p as k, q as F, s as P, t as T, u as f, v as x, w as y, o as z, x as S, y as q, z as B, B as D, D as E, E as R } from "./index-
|
|
1
|
+
import { A as e, a as t, C as i, b as n, c as o, d as g, F as r, e as m, L as l, f as M, M as c, h as L, i as p, j as u, k as h, R as C, T as d, l as v, m as A, n as b, p as k, q as F, s as P, t as T, u as f, v as x, w as y, o as z, x as S, y as q, z as B, B as D, D as E, E as R } from "./index-CtmXbMa5.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": "4.3.1-rc-
|
|
3
|
+
"version": "4.3.1-rc-1787565296",
|
|
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
|
"chromatic:local": "yarn storybook:build && chromatic"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@linktr.ee/messaging-core": "2.5.0-rc-
|
|
53
|
+
"@linktr.ee/messaging-core": "2.5.0-rc-1787565296",
|
|
54
54
|
"@linktr.ee/messaging-taxonomy": "^0.10.0",
|
|
55
55
|
"@phosphor-icons/react": "^2.1.10"
|
|
56
56
|
},
|
|
@@ -29,7 +29,13 @@ const Row = ({
|
|
|
29
29
|
<div
|
|
30
30
|
className={`flex ${align === 'end' ? 'justify-end' : 'justify-start'}`}
|
|
31
31
|
>
|
|
32
|
-
|
|
32
|
+
<div
|
|
33
|
+
className={`str-chat__message ${
|
|
34
|
+
align === 'end' ? 'str-chat__message--me' : 'str-chat__message--other'
|
|
35
|
+
}`}
|
|
36
|
+
>
|
|
37
|
+
<div className="str-chat__message-inner">{children}</div>
|
|
38
|
+
</div>
|
|
33
39
|
</div>
|
|
34
40
|
</div>
|
|
35
41
|
)
|
|
@@ -22,12 +22,15 @@ describe('MessageBubble', () => {
|
|
|
22
22
|
const { rerender } = renderWithProviders(
|
|
23
23
|
<MessageBubble.Sent text="tailed" />
|
|
24
24
|
)
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const bubble = screen
|
|
26
|
+
.getByText('tailed')
|
|
27
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
27
28
|
expect(bubble.querySelector('span[aria-hidden="true"]')).not.toBeNull()
|
|
28
29
|
|
|
29
30
|
rerender(<MessageBubble.Sent text="tailed" tail={false} />)
|
|
30
|
-
const bubbleNoTail = screen
|
|
31
|
+
const bubbleNoTail = screen
|
|
32
|
+
.getByText('tailed')
|
|
33
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
31
34
|
expect(bubbleNoTail.querySelector('span[aria-hidden="true"]')).toBeNull()
|
|
32
35
|
})
|
|
33
36
|
|
|
@@ -47,13 +50,17 @@ describe('MessageBubble', () => {
|
|
|
47
50
|
|
|
48
51
|
it('applies the sent and received surface treatments from theme vars', () => {
|
|
49
52
|
const { rerender } = renderWithProviders(<MessageBubble.Sent text="mine" />)
|
|
50
|
-
const sent = screen
|
|
53
|
+
const sent = screen
|
|
54
|
+
.getByText('mine')
|
|
55
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
51
56
|
expect(sent.style.backgroundColor).toBe(
|
|
52
57
|
'var(--str-chat__own-message-bubble-background-color, #1e2330)'
|
|
53
58
|
)
|
|
54
59
|
|
|
55
60
|
rerender(<MessageBubble.Received text="theirs" />)
|
|
56
|
-
const received = screen
|
|
61
|
+
const received = screen
|
|
62
|
+
.getByText('theirs')
|
|
63
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
57
64
|
expect(received.style.backgroundColor).toBe(
|
|
58
65
|
'var(--str-chat__message-bubble-background-color, #f1f0ee)'
|
|
59
66
|
)
|
|
@@ -61,7 +68,9 @@ describe('MessageBubble', () => {
|
|
|
61
68
|
|
|
62
69
|
it('masks message content from session replay by default', () => {
|
|
63
70
|
renderWithProviders(<MessageBubble.Received header="Brie" text="secret" />)
|
|
64
|
-
const bubble = screen
|
|
71
|
+
const bubble = screen
|
|
72
|
+
.getByText('secret')
|
|
73
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
65
74
|
expect(bubble.getAttribute('data-dd-privacy')).toBe('mask')
|
|
66
75
|
})
|
|
67
76
|
|
|
@@ -69,7 +78,9 @@ describe('MessageBubble', () => {
|
|
|
69
78
|
renderWithProviders(
|
|
70
79
|
<MessageBubble.Sent text="wide" className="w-fit max-w-[520px]" />
|
|
71
80
|
)
|
|
72
|
-
const bubble = screen
|
|
81
|
+
const bubble = screen
|
|
82
|
+
.getByText('wide')
|
|
83
|
+
.closest('.str-chat__message-bubble') as HTMLElement
|
|
73
84
|
expect(bubble.classList.contains('w-fit')).toBe(true)
|
|
74
85
|
expect(bubble.className).toContain('max-w-[520px]')
|
|
75
86
|
})
|
|
@@ -67,7 +67,8 @@ const BubbleShell: React.FC<BubbleShellProps> = ({
|
|
|
67
67
|
<div
|
|
68
68
|
data-dd-privacy="mask"
|
|
69
69
|
className={classNames(
|
|
70
|
-
'
|
|
70
|
+
'str-chat__message-bubble',
|
|
71
|
+
'relative',
|
|
71
72
|
'text-[0.875rem] leading-[1.3125rem] tracking-[0.14px]',
|
|
72
73
|
className
|
|
73
74
|
)}
|
|
@@ -77,13 +78,17 @@ const BubbleShell: React.FC<BubbleShellProps> = ({
|
|
|
77
78
|
isolation: 'isolate',
|
|
78
79
|
}}
|
|
79
80
|
>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
<div className="str-chat__message-text">
|
|
82
|
+
{header != null && (
|
|
83
|
+
<div className="mb-1 font-medium" data-testid="message-bubble-header">
|
|
84
|
+
{header}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
<p className="m-0 whitespace-pre-wrap break-words hyphens-manual">
|
|
88
|
+
{text}
|
|
89
|
+
</p>
|
|
90
|
+
{tail && <BubbleTail variant={variant} />}
|
|
91
|
+
</div>
|
|
87
92
|
</div>
|
|
88
93
|
)
|
|
89
94
|
|
|
@@ -95,6 +95,13 @@ const COLLECTION: RichCardBaseProps = {
|
|
|
95
95
|
imagePresentation: 'fan',
|
|
96
96
|
actions: [secondaryLink('View collection', 'tr.ee/briesummer')],
|
|
97
97
|
}
|
|
98
|
+
const NEWLINE_SUBTITLE: RichCardBaseProps = {
|
|
99
|
+
...OFFICIAL_WELCOME,
|
|
100
|
+
title: 'Start every conversation with a personal welcome message!',
|
|
101
|
+
subtitle:
|
|
102
|
+
'👋 Say hello as people arrive\n✨ Spark conversations\n💬 Add automated FAQs',
|
|
103
|
+
subtitleLines: 6,
|
|
104
|
+
}
|
|
98
105
|
|
|
99
106
|
const bothSides = (props: RichCardBaseProps) => (
|
|
100
107
|
<>
|
|
@@ -113,7 +120,8 @@ const bothSides = (props: RichCardBaseProps) => (
|
|
|
113
120
|
* The three real surfaces that converge on `linktree_rich_card`, each shown
|
|
114
121
|
* Received (light) and Sent (dark). They differ only by knobs: the official
|
|
115
122
|
* welcome card is `hero + primary`; a single-link broadcast is `hero +
|
|
116
|
-
* secondary`; a collection is `fan + secondary`.
|
|
123
|
+
* secondary`; a collection is `fan + secondary`. A fourth row shows a
|
|
124
|
+
* newline-separated subtitle (the onboarding result-card shape).
|
|
117
125
|
*/
|
|
118
126
|
export const Instances: StoryFn = () => (
|
|
119
127
|
<Table>
|
|
@@ -131,6 +139,10 @@ export const Instances: StoryFn = () => (
|
|
|
131
139
|
<RowLabel>Collection — fan · secondary</RowLabel>
|
|
132
140
|
{bothSides(COLLECTION)}
|
|
133
141
|
</tr>
|
|
142
|
+
<tr>
|
|
143
|
+
<RowLabel>Subtitle with newlines</RowLabel>
|
|
144
|
+
{bothSides(NEWLINE_SUBTITLE)}
|
|
145
|
+
</tr>
|
|
134
146
|
</tbody>
|
|
135
147
|
</Table>
|
|
136
148
|
)
|