@linktr.ee/messaging-react 3.5.5 → 3.5.6-rc-1782993089
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-CHvZlG79.js → Card-BBZvkjL_.js} +2 -2
- package/dist/{Card-CHvZlG79.js.map → Card-BBZvkjL_.js.map} +1 -1
- package/dist/{Card-vLf8WYOu.cjs → Card-BXE8pJ79.cjs} +2 -2
- package/dist/{Card-vLf8WYOu.cjs.map → Card-BXE8pJ79.cjs.map} +1 -1
- package/dist/{Card-S1vPBCzV.cjs → Card-C6Wa9-kl.cjs} +2 -2
- package/dist/{Card-S1vPBCzV.cjs.map → Card-C6Wa9-kl.cjs.map} +1 -1
- package/dist/{Card-BrKZ-lbW.cjs → Card-D53qZLHI.cjs} +2 -2
- package/dist/{Card-BrKZ-lbW.cjs.map → Card-D53qZLHI.cjs.map} +1 -1
- package/dist/{Card-DN-Wvpia.js → Card-DIZQPGVQ.js} +3 -3
- package/dist/{Card-DN-Wvpia.js.map → Card-DIZQPGVQ.js.map} +1 -1
- package/dist/{Card-Bb26YfI4.js → Card-Dq01YelX.js} +2 -2
- package/dist/{Card-Bb26YfI4.js.map → Card-Dq01YelX.js.map} +1 -1
- package/dist/{LockedThumbnail-BE4DGTl8.cjs → LockedThumbnail-Bm2UNwLs.cjs} +2 -2
- package/dist/{LockedThumbnail-BE4DGTl8.cjs.map → LockedThumbnail-Bm2UNwLs.cjs.map} +1 -1
- package/dist/{LockedThumbnail-Jl0brl9S.js → LockedThumbnail-DTLtL7Xc.js} +3 -3
- package/dist/{LockedThumbnail-Jl0brl9S.js.map → LockedThumbnail-DTLtL7Xc.js.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-Cjf7FPAs.cjs → index-CWpqzddu.cjs} +2 -2
- package/dist/{index-Cjf7FPAs.cjs.map → index-CWpqzddu.cjs.map} +1 -1
- package/dist/{index-6Q-jnVFS.js → index-DX6U0xNB.js} +7 -7
- package/dist/{index-6Q-jnVFS.js.map → index-DX6U0xNB.js.map} +1 -1
- 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/CustomLinkPreviewList/CustomLinkPreviewCard.tsx +1 -1
- package/src/components/CustomMessage/CustomMessage.stories.tsx +27 -0
- 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 +53 -9
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-CWpqzddu.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-DX6U0xNB.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.
|
|
3
|
+
"version": "3.5.6-rc-1782993089",
|
|
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": "
|
|
41
|
+
"@linktr.ee/messaging-core": "2.3.0-rc-1782993089",
|
|
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-[#1e2330]' : 'bg-white'
|
|
61
61
|
)}
|
|
62
62
|
>
|
|
63
63
|
{topLeft ? (
|
|
@@ -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-[#1e2330] p-2 no-underline transition-opacity hover:opacity-90"
|
|
27
27
|
>
|
|
28
28
|
{image_url && (
|
|
29
29
|
<img
|
|
@@ -247,6 +247,33 @@ WithTipTag.args = {
|
|
|
247
247
|
],
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
+
export const ThreeConsecutiveSentMessages: StoryFn<TemplateProps> =
|
|
251
|
+
Template.bind({})
|
|
252
|
+
ThreeConsecutiveSentMessages.args = {
|
|
253
|
+
messages: [
|
|
254
|
+
{
|
|
255
|
+
id: 'msg-1',
|
|
256
|
+
text: 'why is it that the sun',
|
|
257
|
+
user: storyUsers.visitor,
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: 'msg-2',
|
|
261
|
+
text: 'has rays',
|
|
262
|
+
user: storyUsers.creator,
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: 'msg-3',
|
|
266
|
+
text: 'how how how',
|
|
267
|
+
user: storyUsers.creator,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: 'msg-4',
|
|
271
|
+
text: 'thanks for the note',
|
|
272
|
+
user: storyUsers.visitor,
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
}
|
|
276
|
+
|
|
250
277
|
export const TipOnly: StoryFn<TemplateProps> = Template.bind({})
|
|
251
278
|
TipOnly.args = {
|
|
252
279
|
messages: [
|
|
@@ -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-[#1e2330] 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-[#1e2330] 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-[#1e2330]' : '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-[#1e2330]' : '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-[#1e2330]' : '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` (#1e2330)
|
|
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-[#1e2330]',
|
|
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 `#1e2330`.
|
|
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: #f2f1ef;
|
|
12
|
+
--str-chat__message-bubble-color: #000000;
|
|
13
13
|
|
|
14
|
-
--str-chat__own-message-bubble-background-color: #
|
|
14
|
+
--str-chat__own-message-bubble-background-color: #1e2330;
|
|
15
15
|
--str-chat__own-message-bubble-color: #fff;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -560,7 +560,15 @@
|
|
|
560
560
|
|
|
561
561
|
.str-chat__message .str-chat__message-bubble {
|
|
562
562
|
font-size: 0.875rem;
|
|
563
|
-
line-height: 1.
|
|
563
|
+
line-height: 1.3125rem;
|
|
564
|
+
letter-spacing: 0.14px;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.str-chat__li--single .str-chat__message-bubble,
|
|
568
|
+
.str-chat__li--top .str-chat__message-bubble,
|
|
569
|
+
.str-chat__li--middle .str-chat__message-bubble,
|
|
570
|
+
.str-chat__li--bottom .str-chat__message-bubble {
|
|
571
|
+
border-radius: var(--str-chat__message-bubble-border-radius);
|
|
564
572
|
}
|
|
565
573
|
|
|
566
574
|
/* Chatbot reply markdown — restore semantics that consumer Tailwind preflight
|
|
@@ -673,15 +681,51 @@
|
|
|
673
681
|
margin-block-end: 0.875rem;
|
|
674
682
|
}
|
|
675
683
|
|
|
676
|
-
.str-chat__message--other
|
|
677
|
-
|
|
684
|
+
.str-chat__message--other
|
|
685
|
+
.str-chat__message-bubble-wrapper
|
|
686
|
+
> .str-chat__message-bubble:last-child {
|
|
687
|
+
position: relative;
|
|
688
|
+
|
|
689
|
+
&::after {
|
|
690
|
+
content: '';
|
|
691
|
+
position: absolute;
|
|
692
|
+
inset-block-end: 0;
|
|
693
|
+
inset-inline-start: calc(-1 * 0.25rem);
|
|
694
|
+
width: 1.1875rem;
|
|
695
|
+
height: 1.4375rem;
|
|
696
|
+
background-color: var(--str-chat__message-bubble-background-color);
|
|
697
|
+
pointer-events: none;
|
|
698
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='25 22 20 23'%3E%3Cpath d='M45 22H30C30 32.1934 29.1413 37.2345 25.8323 43.4893C25.4732 44.168 25.9613 44.9917 26.7255 44.9178C39.8236 43.6506 44.6803 28.0737 45 22Z'/%3E%3C/svg%3E")
|
|
699
|
+
no-repeat center / 100% 100%;
|
|
700
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='25 22 20 23'%3E%3Cpath d='M45 22H30C30 32.1934 29.1413 37.2345 25.8323 43.4893C25.4732 44.168 25.9613 44.9917 26.7255 44.9178C39.8236 43.6506 44.6803 28.0737 45 22Z'/%3E%3C/svg%3E")
|
|
701
|
+
no-repeat center / 100% 100%;
|
|
702
|
+
}
|
|
678
703
|
}
|
|
679
704
|
|
|
680
|
-
.str-chat__message--me
|
|
681
|
-
|
|
705
|
+
.str-chat__message--me
|
|
706
|
+
.str-chat__message-bubble-wrapper
|
|
707
|
+
> .str-chat__message-bubble:last-child {
|
|
708
|
+
position: relative;
|
|
709
|
+
|
|
710
|
+
&::after {
|
|
711
|
+
content: '';
|
|
712
|
+
position: absolute;
|
|
713
|
+
inset-block-end: 0;
|
|
714
|
+
inset-inline-end: calc(-1 * 0.25rem);
|
|
715
|
+
width: 1.1875rem;
|
|
716
|
+
height: 1.4375rem;
|
|
717
|
+
background-color: var(--str-chat__own-message-bubble-background-color);
|
|
718
|
+
pointer-events: none;
|
|
719
|
+
transform: scaleX(-1);
|
|
720
|
+
transform-origin: center;
|
|
721
|
+
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='25 22 20 23'%3E%3Cpath d='M45 22H30C30 32.1934 29.1413 37.2345 25.8323 43.4893C25.4732 44.168 25.9613 44.9917 26.7255 44.9178C39.8236 43.6506 44.6803 28.0737 45 22Z'/%3E%3C/svg%3E")
|
|
722
|
+
no-repeat center / 100% 100%;
|
|
723
|
+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='25 22 20 23'%3E%3Cpath d='M45 22H30C30 32.1934 29.1413 37.2345 25.8323 43.4893C25.4732 44.168 25.9613 44.9917 26.7255 44.9178C39.8236 43.6506 44.6803 28.0737 45 22Z'/%3E%3C/svg%3E")
|
|
724
|
+
no-repeat center / 100% 100%;
|
|
725
|
+
}
|
|
682
726
|
}
|
|
683
|
-
}
|
|
684
727
|
|
|
728
|
+
}
|
|
685
729
|
/* Locked attachment wrapper: stack card + text bubble in the correct direction */
|
|
686
730
|
.str-chat__li .str-chat__message--me .str-chat__message-bubble-wrapper {
|
|
687
731
|
display: flex;
|