@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/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 it through stream's `MessageStatus`,
585
- whose `.str-chat__message-status` span is the grid item here (right-aligned
586
- via the outer grid's `justify-items: end`). Stream emits that span for every
587
- own message and leaves it empty when no state is active (i.e. not the last
588
- sent message), so `:empty` collapses those away. */
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
  >