@liveblocks/react-ui 3.14.0-types2 → 3.15.0-thread1

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.
@@ -22,8 +22,6 @@ var cn = require('../utils/cn.cjs');
22
22
  var download = require('../utils/download.cjs');
23
23
  var useGroupMention = require('../utils/use-group-mention.cjs');
24
24
  var useRefs = require('../utils/use-refs.cjs');
25
- var useVisible = require('../utils/use-visible.cjs');
26
- var useWindowFocus = require('../utils/use-window-focus.cjs');
27
25
  var Composer = require('./Composer.cjs');
28
26
  var Attachment = require('./internal/Attachment.cjs');
29
27
  var Avatar = require('./internal/Avatar.cjs');
@@ -35,8 +33,8 @@ var Group = require('./internal/Group.cjs');
35
33
  var List = require('./internal/List.cjs');
36
34
  var Tooltip = require('./internal/Tooltip.cjs');
37
35
  var User = require('./internal/User.cjs');
38
- var TooltipPrimitive = require('@radix-ui/react-tooltip');
39
36
  var PopoverPrimitive = require('@radix-ui/react-popover');
37
+ var TooltipPrimitive = require('@radix-ui/react-tooltip');
40
38
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
41
39
 
42
40
  function _interopNamespaceDefault(e) {
@@ -60,6 +58,23 @@ var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TogglePri
60
58
 
61
59
 
62
60
  const REACTIONS_TRUNCATE = 5;
61
+ function CommentAvatar(props) {
62
+ return /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { ...props });
63
+ }
64
+ function CommentAuthor(props) {
65
+ return /* @__PURE__ */ jsxRuntime.jsx(User.User, { ...props });
66
+ }
67
+ function CommentDate({ locale, date, className, ...props }) {
68
+ return /* @__PURE__ */ jsxRuntime.jsx(
69
+ Timestamp.Timestamp,
70
+ {
71
+ locale,
72
+ date,
73
+ className: cn.cn("lb-date", className),
74
+ ...props
75
+ }
76
+ );
77
+ }
63
78
  function CommentUserMention({
64
79
  mention,
65
80
  className,
@@ -335,27 +350,6 @@ function CommentNonInteractiveFileAttachment({
335
350
  }
336
351
  );
337
352
  }
338
- function AutoMarkReadThreadIdHandler({
339
- threadId,
340
- roomId,
341
- commentRef
342
- }) {
343
- const markThreadAsRead = _private.useMarkRoomThreadAsRead(roomId);
344
- const isWindowFocused = useWindowFocus.useWindowFocus();
345
- useVisible.useIntersectionCallback(
346
- commentRef,
347
- (isIntersecting) => {
348
- if (isIntersecting) {
349
- markThreadAsRead(threadId);
350
- }
351
- },
352
- {
353
- // The underlying IntersectionObserver is only enabled when the window is focused
354
- enabled: isWindowFocused
355
- }
356
- );
357
- return null;
358
- }
359
353
  const CommentDropdownItem = react.forwardRef(({ children, icon, onSelect, onClick, ...props }, forwardedRef) => {
360
354
  const handleClick = react.useCallback(
361
355
  (event) => {
@@ -396,10 +390,15 @@ const Comment = Object.assign(
396
390
  dropdownItems,
397
391
  overrides: overrides$1,
398
392
  components: components$1,
393
+ additionalContent,
394
+ avatar,
395
+ author,
396
+ date,
399
397
  className,
400
398
  actions,
401
399
  actionsClassName,
402
- autoMarkReadThreadId,
400
+ internalDropdownItems,
401
+ children,
403
402
  ...props
404
403
  }, forwardedRef) => {
405
404
  const ref = react.useRef(null);
@@ -506,240 +505,268 @@ const Comment = Object.assign(
506
505
  if (!showDeleted && !comment.body) {
507
506
  return null;
508
507
  }
509
- const defaultDropdownItems = comment.userId === currentUserId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
508
+ const commentDropdownItems = comment.userId === currentUserId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
510
509
  /* @__PURE__ */ jsxRuntime.jsx(CommentDropdownItem, { onSelect: handleEdit, icon: /* @__PURE__ */ jsxRuntime.jsx(Edit.EditIcon, {}), children: $.COMMENT_EDIT }),
511
510
  /* @__PURE__ */ jsxRuntime.jsx(CommentDropdownItem, { onSelect: handleDelete, icon: /* @__PURE__ */ jsxRuntime.jsx(Delete.DeleteIcon, {}), children: $.COMMENT_DELETE })
512
511
  ] }) : null;
512
+ const defaultDropdownItems = internalDropdownItems || commentDropdownItems ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
513
+ internalDropdownItems,
514
+ commentDropdownItems
515
+ ] }) : null;
513
516
  const dropdownContent = typeof dropdownItems === "function" ? dropdownItems({ children: defaultDropdownItems, comment }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
514
517
  defaultDropdownItems,
515
518
  dropdownItems
516
519
  ] });
517
- return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(components.ComponentsProvider, { components: components$1, children: [
518
- autoMarkReadThreadId && /* @__PURE__ */ jsxRuntime.jsx(
519
- AutoMarkReadThreadIdHandler,
520
+ let content;
521
+ if (isEditing) {
522
+ content = /* @__PURE__ */ jsxRuntime.jsx(
523
+ Composer.Composer,
520
524
  {
521
- commentRef: ref,
522
- threadId: autoMarkReadThreadId,
525
+ className: "lb-comment-composer",
526
+ onComposerSubmit: handleEditSubmit,
527
+ defaultValue: comment.body,
528
+ defaultAttachments: comment.attachments,
529
+ autoFocus: true,
530
+ showAttribution: false,
531
+ showAttachments,
532
+ showFormattingControls: showComposerFormattingControls,
533
+ actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
534
+ /* @__PURE__ */ jsxRuntime.jsx(
535
+ Tooltip.Tooltip,
536
+ {
537
+ content: $.COMMENT_EDIT_COMPOSER_CANCEL,
538
+ "aria-label": $.COMMENT_EDIT_COMPOSER_CANCEL,
539
+ children: /* @__PURE__ */ jsxRuntime.jsx(
540
+ Button.Button,
541
+ {
542
+ className: "lb-composer-action",
543
+ onClick: handleEditCancel,
544
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Cross.CrossIcon, {})
545
+ }
546
+ )
547
+ }
548
+ ),
549
+ /* @__PURE__ */ jsxRuntime.jsx(
550
+ Tooltip.ShortcutTooltip,
551
+ {
552
+ content: $.COMMENT_EDIT_COMPOSER_SAVE,
553
+ shortcut: "Enter",
554
+ children: /* @__PURE__ */ jsxRuntime.jsx(index$1.Submit, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
555
+ Button.Button,
556
+ {
557
+ variant: "primary",
558
+ className: "lb-composer-action",
559
+ onClick: stopPropagation,
560
+ "aria-label": $.COMMENT_EDIT_COMPOSER_SAVE,
561
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Check.CheckIcon, {})
562
+ }
563
+ ) })
564
+ }
565
+ )
566
+ ] }),
567
+ overrides: {
568
+ COMPOSER_PLACEHOLDER: $.COMMENT_EDIT_COMPOSER_PLACEHOLDER
569
+ },
523
570
  roomId: comment.roomId
524
571
  }
525
- ),
526
- /* @__PURE__ */ jsxRuntime.jsxs(
527
- "div",
528
- {
529
- id: comment.id,
530
- className: cn.cn(
531
- "lb-root lb-comment",
532
- indentContent && "lb-comment:indent-content",
533
- showActions === "hover" && "lb-comment:show-actions-hover",
534
- (isMoreActionOpen || isReactionActionOpen) && "lb-comment:action-open",
535
- className
536
- ),
537
- "data-deleted": !comment.body ? "" : void 0,
538
- "data-editing": isEditing ? "" : void 0,
539
- "data-target": isTarget ? "" : void 0,
540
- dir: $.dir,
541
- ...props,
542
- ref: mergedRefs,
543
- children: [
544
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-header", children: [
545
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-details", children: [
546
- /* @__PURE__ */ jsxRuntime.jsx(
547
- Avatar.Avatar,
572
+ );
573
+ } else {
574
+ content = comment.body ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
575
+ /* @__PURE__ */ jsxRuntime.jsx(
576
+ index.Body,
577
+ {
578
+ className: "lb-comment-body",
579
+ body: comment.body,
580
+ components: {
581
+ Mention: ({ mention }) => /* @__PURE__ */ jsxRuntime.jsx(
582
+ CommentMention,
583
+ {
584
+ mention,
585
+ onClick: (event) => onMentionClick?.(mention, event),
586
+ overrides: overrides$1
587
+ }
588
+ ),
589
+ Link: CommentLink
590
+ }
591
+ }
592
+ ),
593
+ additionalContent,
594
+ showAttachments && (mediaAttachments.length > 0 || fileAttachments.length > 0) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-attachments", children: [
595
+ mediaAttachments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-attachments", children: mediaAttachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
596
+ CommentMediaAttachment,
597
+ {
598
+ attachment,
599
+ overrides: overrides$1,
600
+ onAttachmentClick,
601
+ roomId: comment.roomId
602
+ },
603
+ attachment.id
604
+ )) }) : null,
605
+ fileAttachments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-attachments", children: fileAttachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
606
+ CommentFileAttachment,
607
+ {
608
+ attachment,
609
+ overrides: overrides$1,
610
+ onAttachmentClick,
611
+ roomId: comment.roomId
612
+ },
613
+ attachment.id
614
+ )) }) : null
615
+ ] }) : null,
616
+ showReactions && comment.reactions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-reactions", children: [
617
+ comment.reactions.map((reaction) => /* @__PURE__ */ jsxRuntime.jsx(
618
+ CommentReaction,
619
+ {
620
+ comment,
621
+ reaction,
622
+ overrides: overrides$1,
623
+ disabled: !canComment
624
+ },
625
+ reaction.emoji
626
+ )),
627
+ canComment ? /* @__PURE__ */ jsxRuntime.jsx(EmojiPicker.EmojiPicker, { onEmojiSelect: handleReactionSelect, children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_ADD_REACTION, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
628
+ Button.Button,
629
+ {
630
+ className: "lb-comment-reaction lb-comment-reaction-add",
631
+ variant: "outline",
632
+ onClick: stopPropagation,
633
+ "aria-label": $.COMMENT_ADD_REACTION,
634
+ icon: /* @__PURE__ */ jsxRuntime.jsx(EmojiPlus.EmojiPlusIcon, {})
635
+ }
636
+ ) }) }) }) : null
637
+ ] })
638
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-comment-body", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lb-comment-deleted", children: $.COMMENT_DELETED }) });
639
+ content = typeof children === "function" ? children({ comment, children: content }) : children ?? content;
640
+ }
641
+ return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(components.ComponentsProvider, { components: components$1, children: /* @__PURE__ */ jsxRuntime.jsxs(
642
+ "div",
643
+ {
644
+ id: comment.id,
645
+ className: cn.cn(
646
+ "lb-root lb-comment",
647
+ indentContent && "lb-comment:indent-content",
648
+ showActions === "hover" && "lb-comment:show-actions-hover",
649
+ (isMoreActionOpen || isReactionActionOpen) && "lb-comment:action-open",
650
+ className
651
+ ),
652
+ "data-deleted": !comment.body ? "" : void 0,
653
+ "data-editing": isEditing ? "" : void 0,
654
+ "data-target": isTarget ? "" : void 0,
655
+ dir: $.dir,
656
+ ...props,
657
+ ref: mergedRefs,
658
+ children: [
659
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-header", children: [
660
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-details", children: [
661
+ avatar ? /* @__PURE__ */ jsxRuntime.jsx(
662
+ "div",
663
+ {
664
+ className: "lb-comment-avatar",
665
+ onClick: handleAuthorClick,
666
+ children: avatar
667
+ }
668
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
669
+ Avatar.Avatar,
670
+ {
671
+ className: "lb-comment-avatar",
672
+ userId: comment.userId,
673
+ onClick: handleAuthorClick
674
+ }
675
+ ),
676
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "lb-comment-details-labels", children: [
677
+ author ? /* @__PURE__ */ jsxRuntime.jsx(
678
+ "span",
548
679
  {
549
- className: "lb-comment-avatar",
680
+ className: "lb-comment-author",
681
+ onClick: handleAuthorClick,
682
+ children: author
683
+ }
684
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
685
+ User.User,
686
+ {
687
+ className: "lb-comment-author",
550
688
  userId: comment.userId,
551
689
  onClick: handleAuthorClick
552
690
  }
553
691
  ),
554
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "lb-comment-details-labels", children: [
692
+ date ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-comment-date", children: date }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
555
693
  /* @__PURE__ */ jsxRuntime.jsx(
556
- User.User,
694
+ CommentDate,
557
695
  {
558
- className: "lb-comment-author",
559
- userId: comment.userId,
560
- onClick: handleAuthorClick
696
+ locale: $.locale,
697
+ date: comment.createdAt,
698
+ className: "lb-comment-date-created"
561
699
  }
562
700
  ),
563
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "lb-comment-date", children: [
564
- /* @__PURE__ */ jsxRuntime.jsx(
565
- Timestamp.Timestamp,
566
- {
567
- locale: $.locale,
568
- date: comment.createdAt,
569
- className: "lb-date lb-comment-date-created"
570
- }
571
- ),
572
- comment.editedAt && comment.body && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
573
- " ",
574
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-comment-date-edited", children: $.COMMENT_EDITED })
575
- ] })
701
+ comment.editedAt && comment.body && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
702
+ " ",
703
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-comment-date-edited", children: $.COMMENT_EDITED })
576
704
  ] })
577
705
  ] })
578
- ] }),
579
- showActions && !isEditing && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn.cn("lb-comment-actions", actionsClassName), children: [
580
- actions ?? null,
581
- showReactions && canComment ? /* @__PURE__ */ jsxRuntime.jsx(
582
- EmojiPicker.EmojiPicker,
583
- {
584
- onEmojiSelect: handleReactionSelect,
585
- onOpenChange: setReactionActionOpen,
586
- children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_ADD_REACTION, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
587
- Button.Button,
588
- {
589
- className: "lb-comment-action",
590
- onClick: stopPropagation,
591
- "aria-label": $.COMMENT_ADD_REACTION,
592
- icon: /* @__PURE__ */ jsxRuntime.jsx(EmojiPlus.EmojiPlusIcon, {})
593
- }
594
- ) }) })
595
- }
596
- ) : null,
597
- dropdownContent ? /* @__PURE__ */ jsxRuntime.jsx(
598
- Dropdown.Dropdown,
599
- {
600
- open: isMoreActionOpen,
601
- onOpenChange: setMoreActionOpen,
602
- align: "end",
603
- content: dropdownContent,
604
- children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_MORE, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
605
- Button.Button,
606
- {
607
- className: "lb-comment-action",
608
- disabled: !comment.body,
609
- onClick: stopPropagation,
610
- "aria-label": $.COMMENT_MORE,
611
- icon: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis.EllipsisIcon, {})
612
- }
613
- ) }) })
614
- }
615
- ) : null
616
706
  ] })
617
707
  ] }),
618
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-comment-content", children: isEditing ? /* @__PURE__ */ jsxRuntime.jsx(
619
- Composer.Composer,
620
- {
621
- className: "lb-comment-composer",
622
- onComposerSubmit: handleEditSubmit,
623
- defaultValue: comment.body,
624
- defaultAttachments: comment.attachments,
625
- autoFocus: true,
626
- showAttribution: false,
627
- showAttachments,
628
- showFormattingControls: showComposerFormattingControls,
629
- actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
630
- /* @__PURE__ */ jsxRuntime.jsx(
631
- Tooltip.Tooltip,
708
+ showActions && !isEditing && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn.cn("lb-comment-actions", actionsClassName), children: [
709
+ actions ?? null,
710
+ showReactions && canComment ? /* @__PURE__ */ jsxRuntime.jsx(
711
+ EmojiPicker.EmojiPicker,
712
+ {
713
+ onEmojiSelect: handleReactionSelect,
714
+ onOpenChange: setReactionActionOpen,
715
+ children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_ADD_REACTION, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
716
+ Button.Button,
632
717
  {
633
- content: $.COMMENT_EDIT_COMPOSER_CANCEL,
634
- "aria-label": $.COMMENT_EDIT_COMPOSER_CANCEL,
635
- children: /* @__PURE__ */ jsxRuntime.jsx(
636
- Button.Button,
637
- {
638
- className: "lb-composer-action",
639
- onClick: handleEditCancel,
640
- icon: /* @__PURE__ */ jsxRuntime.jsx(Cross.CrossIcon, {})
641
- }
642
- )
718
+ className: "lb-comment-action",
719
+ onClick: stopPropagation,
720
+ "aria-label": $.COMMENT_ADD_REACTION,
721
+ icon: /* @__PURE__ */ jsxRuntime.jsx(EmojiPlus.EmojiPlusIcon, {})
643
722
  }
644
- ),
645
- /* @__PURE__ */ jsxRuntime.jsx(
646
- Tooltip.ShortcutTooltip,
723
+ ) }) })
724
+ }
725
+ ) : null,
726
+ dropdownContent ? /* @__PURE__ */ jsxRuntime.jsx(
727
+ Dropdown.Dropdown,
728
+ {
729
+ open: isMoreActionOpen,
730
+ onOpenChange: setMoreActionOpen,
731
+ align: "end",
732
+ content: dropdownContent,
733
+ children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_MORE, children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
734
+ Button.Button,
647
735
  {
648
- content: $.COMMENT_EDIT_COMPOSER_SAVE,
649
- shortcut: "Enter",
650
- children: /* @__PURE__ */ jsxRuntime.jsx(index$1.Submit, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
651
- Button.Button,
652
- {
653
- variant: "primary",
654
- className: "lb-composer-action",
655
- onClick: stopPropagation,
656
- "aria-label": $.COMMENT_EDIT_COMPOSER_SAVE,
657
- icon: /* @__PURE__ */ jsxRuntime.jsx(Check.CheckIcon, {})
658
- }
659
- ) })
736
+ className: "lb-comment-action",
737
+ disabled: !comment.body,
738
+ onClick: stopPropagation,
739
+ "aria-label": $.COMMENT_MORE,
740
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Ellipsis.EllipsisIcon, {})
660
741
  }
661
- )
662
- ] }),
663
- overrides: {
664
- COMPOSER_PLACEHOLDER: $.COMMENT_EDIT_COMPOSER_PLACEHOLDER
665
- },
666
- roomId: comment.roomId
667
- }
668
- ) : comment.body ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
669
- /* @__PURE__ */ jsxRuntime.jsx(
670
- index.Body,
671
- {
672
- className: "lb-comment-body",
673
- body: comment.body,
674
- components: {
675
- Mention: ({ mention }) => /* @__PURE__ */ jsxRuntime.jsx(
676
- CommentMention,
677
- {
678
- mention,
679
- onClick: (event) => onMentionClick?.(mention, event),
680
- overrides: overrides$1
681
- }
682
- ),
683
- Link: CommentLink
684
- }
742
+ ) }) })
685
743
  }
686
- ),
687
- showAttachments && (mediaAttachments.length > 0 || fileAttachments.length > 0) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-attachments", children: [
688
- mediaAttachments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-attachments", children: mediaAttachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
689
- CommentMediaAttachment,
690
- {
691
- attachment,
692
- overrides: overrides$1,
693
- onAttachmentClick,
694
- roomId: comment.roomId
695
- },
696
- attachment.id
697
- )) }) : null,
698
- fileAttachments.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-attachments", children: fileAttachments.map((attachment) => /* @__PURE__ */ jsxRuntime.jsx(
699
- CommentFileAttachment,
700
- {
701
- attachment,
702
- overrides: overrides$1,
703
- onAttachmentClick,
704
- roomId: comment.roomId
705
- },
706
- attachment.id
707
- )) }) : null
708
- ] }) : null,
709
- showReactions && comment.reactions.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lb-comment-reactions", children: [
710
- comment.reactions.map((reaction) => /* @__PURE__ */ jsxRuntime.jsx(
711
- CommentReaction,
712
- {
713
- comment,
714
- reaction,
715
- overrides: overrides$1,
716
- disabled: !canComment
717
- },
718
- reaction.emoji
719
- )),
720
- canComment ? /* @__PURE__ */ jsxRuntime.jsx(EmojiPicker.EmojiPicker, { onEmojiSelect: handleReactionSelect, children: /* @__PURE__ */ jsxRuntime.jsx(Tooltip.Tooltip, { content: $.COMMENT_ADD_REACTION, children: /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
721
- Button.Button,
722
- {
723
- className: "lb-comment-reaction lb-comment-reaction-add",
724
- variant: "outline",
725
- onClick: stopPropagation,
726
- "aria-label": $.COMMENT_ADD_REACTION,
727
- icon: /* @__PURE__ */ jsxRuntime.jsx(EmojiPlus.EmojiPlusIcon, {})
728
- }
729
- ) }) }) }) : null
730
- ] })
731
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-comment-body", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lb-comment-deleted", children: $.COMMENT_DELETED }) }) })
732
- ]
733
- }
734
- )
735
- ] }) });
744
+ ) : null
745
+ ] })
746
+ ] }),
747
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lb-comment-content", children: content })
748
+ ]
749
+ }
750
+ ) }) });
736
751
  }
737
752
  ),
738
753
  {
739
754
  /**
740
755
  * Displays a dropdown item in the comment's dropdown.
741
756
  */
742
- DropdownItem: CommentDropdownItem
757
+ DropdownItem: CommentDropdownItem,
758
+ /**
759
+ * Displays a comment's avatar.
760
+ */
761
+ Avatar: CommentAvatar,
762
+ /**
763
+ * Displays a comment's author.
764
+ */
765
+ Author: CommentAuthor,
766
+ /**
767
+ * Displays a comment's date.
768
+ */
769
+ Date: CommentDate
743
770
  }
744
771
  );
745
772