@linktr.ee/messaging-react 3.20.0 → 3.21.0-rc-1785406654
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-gNYP3vdJ.js → Card-BIP97Ybb.js} +2 -2
- package/dist/{Card-gNYP3vdJ.js.map → Card-BIP97Ybb.js.map} +1 -1
- package/dist/{Card-BOrp93Yo.cjs → Card-D9R7Qgk9.cjs} +2 -2
- package/dist/{Card-BOrp93Yo.cjs.map → Card-D9R7Qgk9.cjs.map} +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/{index-BuqmY6ae.js → index-D1mXghgf.js} +1359 -1309
- package/dist/index-D1mXghgf.js.map +1 -0
- package/dist/index-cDF7EDso.cjs +2 -0
- package/dist/index-cDF7EDso.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/testing.d.ts +2 -0
- package/package.json +2 -2
- package/src/components/ChannelView.tsx +6 -1
- package/src/components/CustomMessage/CustomMessage.stories.tsx +40 -0
- package/src/components/CustomMessage/CustomMessage.test.tsx +141 -0
- package/src/components/CustomMessage/SentMessageDeliveryStatus.test.tsx +76 -4
- package/src/components/CustomMessage/SentMessageDeliveryStatus.tsx +75 -7
- package/src/components/CustomMessage/index.tsx +5 -1
- package/src/components/MessagingShell/index.tsx +2 -0
- package/src/index.ts +1 -0
- package/src/stream-custom-data.ts +2 -0
- package/src/styles.css +48 -5
- package/src/types.ts +12 -0
- package/dist/index-BuqmY6ae.js.map +0 -1
- package/dist/index-DSZ8Rxnl.cjs +0 -2
- package/dist/index-DSZ8Rxnl.cjs.map +0 -1
package/src/styles.css
CHANGED
|
@@ -480,6 +480,19 @@
|
|
|
480
480
|
position: relative;
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
+
.sent-message-broadcast-link {
|
|
484
|
+
display: inline-flex;
|
|
485
|
+
align-items: center;
|
|
486
|
+
gap: 0.25rem;
|
|
487
|
+
background: none;
|
|
488
|
+
border: 0;
|
|
489
|
+
padding: 0;
|
|
490
|
+
font: inherit;
|
|
491
|
+
color: inherit;
|
|
492
|
+
cursor: pointer;
|
|
493
|
+
text-decoration: underline;
|
|
494
|
+
}
|
|
495
|
+
|
|
483
496
|
.str-chat__li .str-chat__message-inner {
|
|
484
497
|
grid-column-gap: 4px;
|
|
485
498
|
}
|
|
@@ -581,11 +594,12 @@
|
|
|
581
594
|
}
|
|
582
595
|
|
|
583
596
|
/* Message delivery status under sent messages (MES-1036/MES-1296).
|
|
584
|
-
`SentMessageDeliveryStatus` renders
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
597
|
+
`SentMessageDeliveryStatus` renders stream's `.str-chat__message-status`
|
|
598
|
+
directly when there is no broadcast label. When a broadcast label is
|
|
599
|
+
present, `.sent-message-status-row` is the grid item and contains the
|
|
600
|
+
stream status span. Both cases are right-aligned via the outer grid's
|
|
601
|
+
`justify-items: end`; stream's empty status span collapses when no state is
|
|
602
|
+
active (i.e. not the last sent message). */
|
|
589
603
|
.str-chat__li .str-chat__message--me .str-chat__message-status {
|
|
590
604
|
grid-area: delivery-status;
|
|
591
605
|
justify-content: flex-end;
|
|
@@ -596,6 +610,28 @@
|
|
|
596
610
|
line-height: 1.4;
|
|
597
611
|
color: var(--str-chat__text-low-emphasis-color, rgba(0, 0, 0, 0.5));
|
|
598
612
|
}
|
|
613
|
+
.str-chat__li .str-chat__message--me .sent-message-status-row {
|
|
614
|
+
display: inline-flex;
|
|
615
|
+
grid-area: delivery-status;
|
|
616
|
+
align-items: center;
|
|
617
|
+
justify-content: flex-end;
|
|
618
|
+
gap: 4px;
|
|
619
|
+
padding-block-start: 4px;
|
|
620
|
+
padding-inline-end: 16px;
|
|
621
|
+
font-size: 10px;
|
|
622
|
+
line-height: 1.4;
|
|
623
|
+
color: var(--str-chat__text-low-emphasis-color, rgba(0, 0, 0, 0.5));
|
|
624
|
+
}
|
|
625
|
+
.str-chat__li .str-chat__message--me .sent-message-status-row
|
|
626
|
+
.str-chat__message-status {
|
|
627
|
+
grid-area: auto;
|
|
628
|
+
justify-content: inherit;
|
|
629
|
+
gap: inherit;
|
|
630
|
+
padding: 0;
|
|
631
|
+
font: inherit;
|
|
632
|
+
line-height: inherit;
|
|
633
|
+
color: inherit;
|
|
634
|
+
}
|
|
599
635
|
.str-chat__li .str-chat__message-status:empty {
|
|
600
636
|
display: none;
|
|
601
637
|
}
|
|
@@ -608,6 +644,13 @@
|
|
|
608
644
|
.str-chat__li .str-chat__message--me .str-chat__message-status svg path {
|
|
609
645
|
fill: currentColor;
|
|
610
646
|
}
|
|
647
|
+
.str-chat__li .str-chat__message--me .sent-message-status-row svg {
|
|
648
|
+
width: 14px;
|
|
649
|
+
height: 14px;
|
|
650
|
+
}
|
|
651
|
+
.str-chat__li .str-chat__message--me .sent-message-status-row svg path {
|
|
652
|
+
fill: currentColor;
|
|
653
|
+
}
|
|
611
654
|
.str-chat__li .str-chat__message--me .sent-message-status--failed {
|
|
612
655
|
color: var(--str-chat__message-error-color, #d92d20);
|
|
613
656
|
}
|
package/src/types.ts
CHANGED
|
@@ -36,6 +36,11 @@ export type MessageLinkClickHandler = (
|
|
|
36
36
|
message: LocalMessage | undefined
|
|
37
37
|
) => void
|
|
38
38
|
|
|
39
|
+
export type BroadcastClickHandler = (broadcast: {
|
|
40
|
+
id: string
|
|
41
|
+
name?: string
|
|
42
|
+
}) => void
|
|
43
|
+
|
|
39
44
|
export type ChannelPreviewProps = ChannelPreviewUIComponentProps & {
|
|
40
45
|
selectedChannel?: Channel | null
|
|
41
46
|
onChannelSelect: (channel: Channel) => void
|
|
@@ -362,6 +367,12 @@ export interface ChannelViewProps {
|
|
|
362
367
|
*/
|
|
363
368
|
onMessageLinkClick?: MessageLinkClickHandler
|
|
364
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Fired when a broadcast label is clicked on an outgoing broadcast message.
|
|
372
|
+
* Hosts own navigation so this shared package never assumes an admin URL.
|
|
373
|
+
*/
|
|
374
|
+
onBroadcastClick?: BroadcastClickHandler
|
|
375
|
+
|
|
365
376
|
/**
|
|
366
377
|
* Passed to Stream `Channel` as `SendButton`. Required for hosts that replace
|
|
367
378
|
* the send control: `Channel` merges this into `ComponentContext` and an
|
|
@@ -430,6 +441,7 @@ export type ChannelViewPassthroughProps = Pick<
|
|
|
430
441
|
| 'onParticipantNameClick'
|
|
431
442
|
| 'renderMessage'
|
|
432
443
|
| 'onMessageLinkClick'
|
|
444
|
+
| 'onBroadcastClick'
|
|
433
445
|
| 'showChannelInfo'
|
|
434
446
|
| 'composerInput'
|
|
435
447
|
>
|