@poolse/react-ui 2.21.0 → 2.23.0
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/index.cjs +99 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -5
- package/dist/index.d.ts +32 -5
- package/dist/index.js +100 -19
- package/dist/index.js.map +1 -1
- package/dist/styles.css +70 -0
- package/package.json +11 -11
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
2
|
+
import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode, SVGProps, ReactElement } from 'react';
|
|
5
5
|
import { UploadItem, ReactionMap } from '@poolse/react';
|
|
@@ -440,8 +440,22 @@ interface ConversationViewProps {
|
|
|
440
440
|
* a single handler can switch between rooms.
|
|
441
441
|
*/
|
|
442
442
|
onMarkedRead?: (conversationId: string) => void;
|
|
443
|
+
/**
|
|
444
|
+
* Offer "Call back" on call-log rows the viewer missed or declined,
|
|
445
|
+
* or placed with no answer. Receives the call's media; place the call
|
|
446
|
+
* on this conversation.
|
|
447
|
+
*/
|
|
448
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
449
|
+
/**
|
|
450
|
+
* Show a "Call in progress · Join" banner while a call runs on this
|
|
451
|
+
* conversation that the viewer is not on. Called with the live call
|
|
452
|
+
* when they click Join.
|
|
453
|
+
*/
|
|
454
|
+
onJoinCall?: (call: LiveCall) => void;
|
|
455
|
+
/** The call this client is already on, if any — its banner is hidden. */
|
|
456
|
+
currentCallId?: string | null;
|
|
443
457
|
}
|
|
444
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
445
459
|
|
|
446
460
|
interface ChatHeaderProps {
|
|
447
461
|
/** Conversation id — used to fetch the row + members for the title / presence dot. */
|
|
@@ -632,10 +646,23 @@ interface CallLogRowProps {
|
|
|
632
646
|
msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
|
|
633
647
|
deleted_at?: string | null;
|
|
634
648
|
};
|
|
635
|
-
/** Current user's id — decides
|
|
649
|
+
/** Current user's id — decides how the call is worded for them. */
|
|
636
650
|
meId: string | null;
|
|
651
|
+
/**
|
|
652
|
+
* Offer "Call back" on calls the viewer missed or declined, or placed
|
|
653
|
+
* with no answer. Receives the call's media. Omit to show no action.
|
|
654
|
+
*/
|
|
655
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
656
|
+
}
|
|
657
|
+
declare function CallLogRow({ msg, meId, onCallBack }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
658
|
+
|
|
659
|
+
interface LiveCallBannerProps {
|
|
660
|
+
call: LiveCall;
|
|
661
|
+
/** How many people are in the room right now. */
|
|
662
|
+
inCall: number;
|
|
663
|
+
onJoin: (call: LiveCall) => void;
|
|
637
664
|
}
|
|
638
|
-
declare function
|
|
665
|
+
declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
|
|
639
666
|
|
|
640
667
|
interface EditableMessageBubbleProps {
|
|
641
668
|
message: Message;
|
|
@@ -984,4 +1011,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
984
1011
|
*/
|
|
985
1012
|
declare function PoolseFonts(): null;
|
|
986
1013
|
|
|
987
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, type CallInvite, CallLogRow, type CallLogRowProps, CallProvider, type CallProviderProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useCallInvite, useDisplayName, usePoolseFonts };
|
|
1014
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, type CallInvite, CallLogRow, type CallLogRowProps, CallProvider, type CallProviderProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useCallInvite, useDisplayName, usePoolseFonts };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
2
|
+
import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode, SVGProps, ReactElement } from 'react';
|
|
5
5
|
import { UploadItem, ReactionMap } from '@poolse/react';
|
|
@@ -440,8 +440,22 @@ interface ConversationViewProps {
|
|
|
440
440
|
* a single handler can switch between rooms.
|
|
441
441
|
*/
|
|
442
442
|
onMarkedRead?: (conversationId: string) => void;
|
|
443
|
+
/**
|
|
444
|
+
* Offer "Call back" on call-log rows the viewer missed or declined,
|
|
445
|
+
* or placed with no answer. Receives the call's media; place the call
|
|
446
|
+
* on this conversation.
|
|
447
|
+
*/
|
|
448
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
449
|
+
/**
|
|
450
|
+
* Show a "Call in progress · Join" banner while a call runs on this
|
|
451
|
+
* conversation that the viewer is not on. Called with the live call
|
|
452
|
+
* when they click Join.
|
|
453
|
+
*/
|
|
454
|
+
onJoinCall?: (call: LiveCall) => void;
|
|
455
|
+
/** The call this client is already on, if any — its banner is hidden. */
|
|
456
|
+
currentCallId?: string | null;
|
|
443
457
|
}
|
|
444
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
458
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
445
459
|
|
|
446
460
|
interface ChatHeaderProps {
|
|
447
461
|
/** Conversation id — used to fetch the row + members for the title / presence dot. */
|
|
@@ -632,10 +646,23 @@ interface CallLogRowProps {
|
|
|
632
646
|
msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
|
|
633
647
|
deleted_at?: string | null;
|
|
634
648
|
};
|
|
635
|
-
/** Current user's id — decides
|
|
649
|
+
/** Current user's id — decides how the call is worded for them. */
|
|
636
650
|
meId: string | null;
|
|
651
|
+
/**
|
|
652
|
+
* Offer "Call back" on calls the viewer missed or declined, or placed
|
|
653
|
+
* with no answer. Receives the call's media. Omit to show no action.
|
|
654
|
+
*/
|
|
655
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
656
|
+
}
|
|
657
|
+
declare function CallLogRow({ msg, meId, onCallBack }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
658
|
+
|
|
659
|
+
interface LiveCallBannerProps {
|
|
660
|
+
call: LiveCall;
|
|
661
|
+
/** How many people are in the room right now. */
|
|
662
|
+
inCall: number;
|
|
663
|
+
onJoin: (call: LiveCall) => void;
|
|
637
664
|
}
|
|
638
|
-
declare function
|
|
665
|
+
declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
|
|
639
666
|
|
|
640
667
|
interface EditableMessageBubbleProps {
|
|
641
668
|
message: Message;
|
|
@@ -984,4 +1011,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
984
1011
|
*/
|
|
985
1012
|
declare function PoolseFonts(): null;
|
|
986
1013
|
|
|
987
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, type CallInvite, CallLogRow, type CallLogRowProps, CallProvider, type CallProviderProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useCallInvite, useDisplayName, usePoolseFonts };
|
|
1014
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, type CallInvite, CallLogRow, type CallLogRowProps, CallProvider, type CallProviderProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, EditableMessageBubble, type EditableMessageBubbleProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, type InboxUser, LiveCallBanner, type LiveCallBannerProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, PoolseFonts, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, ReactionPicker, ReactionStrip, type ReactionStripProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useCallInvite, useDisplayName, usePoolseFonts };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { createContext, forwardRef, useState, useRef, useCallback, useImperativeHandle, useEffect, useMemo, Fragment as Fragment$1, useContext } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { useMembers, useAttachmentUpload, useMe, useConversations, useUser, useConversation, usePresence, useMessages, useTyping, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, sameDay, formatDayLabel, formatCallLogPreview, callLogDisplayFor, useThread, useReactions, useAttachmentUrl, useCalls, useCallRoom, useVoiceRoom } from '@poolse/react';
|
|
4
|
+
import { useMembers, useAttachmentUpload, useMe, useConversations, useUser, useConversation, usePresence, useMessages, useTyping, useRealtimeStatus, isMessageVisibleTo, receiptsOf, computeGroupPosition, sameDay, formatDayLabel, canEditOwnMessage, formatCallLogPreview, useLiveCall, callLogDisplayFor, useThread, useReactions, useAttachmentUrl, useCalls, useCallRoom, useVoiceRoom } from '@poolse/react';
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
7
7
|
|
|
@@ -843,6 +843,26 @@ function PoolseFonts() {
|
|
|
843
843
|
usePoolseFonts(true);
|
|
844
844
|
return null;
|
|
845
845
|
}
|
|
846
|
+
function LiveCallBanner({ call, inCall, onJoin }) {
|
|
847
|
+
const what = call.media === "video" ? "Video call in progress" : "Voice call in progress";
|
|
848
|
+
const who = inCall > 0 ? `${inCall} on the call` : "Ringing";
|
|
849
|
+
return /* @__PURE__ */ jsxs("div", { className: "poolse-live-call", role: "status", "aria-label": `${what}, ${who}`, children: [
|
|
850
|
+
/* @__PURE__ */ jsx(
|
|
851
|
+
PoolseIcon,
|
|
852
|
+
{
|
|
853
|
+
name: call.media === "video" ? "video" : "phone",
|
|
854
|
+
size: 16,
|
|
855
|
+
label: null,
|
|
856
|
+
className: "poolse-live-call__icon"
|
|
857
|
+
}
|
|
858
|
+
),
|
|
859
|
+
/* @__PURE__ */ jsxs("span", { className: "poolse-live-call__text", children: [
|
|
860
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-live-call__title", children: what }),
|
|
861
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-live-call__meta", children: who })
|
|
862
|
+
] }),
|
|
863
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: "poolse-live-call__join", onClick: () => onJoin(call), children: "Join" })
|
|
864
|
+
] });
|
|
865
|
+
}
|
|
846
866
|
|
|
847
867
|
// src/listAutocomplete.ts
|
|
848
868
|
var UNORDERED_RE = /^(\s*)([-*+]) (.*)$/;
|
|
@@ -1469,27 +1489,49 @@ function computeInitials(name) {
|
|
|
1469
1489
|
const parts = name.trim().split(/\s+/).slice(0, 2);
|
|
1470
1490
|
return parts.map((p) => p.charAt(0).toUpperCase()).join("").slice(0, 2) || "?";
|
|
1471
1491
|
}
|
|
1472
|
-
function CallLogRow({ msg, meId }) {
|
|
1492
|
+
function CallLogRow({ msg, meId, onCallBack }) {
|
|
1473
1493
|
const display = callLogDisplayFor(msg, meId);
|
|
1474
1494
|
if (!display) return null;
|
|
1475
|
-
return /* @__PURE__ */ jsx(
|
|
1495
|
+
return /* @__PURE__ */ jsx(
|
|
1496
|
+
CallLogLine,
|
|
1497
|
+
{
|
|
1498
|
+
display,
|
|
1499
|
+
insertedAt: msg.inserted_at,
|
|
1500
|
+
...onCallBack ? { onCallBack } : {}
|
|
1501
|
+
}
|
|
1502
|
+
);
|
|
1476
1503
|
}
|
|
1477
|
-
function CallLogLine({
|
|
1504
|
+
function CallLogLine({
|
|
1505
|
+
display,
|
|
1506
|
+
insertedAt,
|
|
1507
|
+
onCallBack
|
|
1508
|
+
}) {
|
|
1478
1509
|
const time = formatTime(insertedAt);
|
|
1479
1510
|
const icon = display.media === "video" ? "video" : "phone";
|
|
1480
1511
|
const label = [display.title, display.detail, time].filter(Boolean).join(", ");
|
|
1481
|
-
return /* @__PURE__ */
|
|
1512
|
+
return /* @__PURE__ */ jsxs(
|
|
1482
1513
|
"div",
|
|
1483
1514
|
{
|
|
1484
1515
|
className: `poolse-call-log${display.missed ? " poolse-call-log--missed" : ""}`,
|
|
1485
1516
|
role: "note",
|
|
1486
1517
|
"aria-label": label,
|
|
1487
|
-
children:
|
|
1488
|
-
/* @__PURE__ */
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1518
|
+
children: [
|
|
1519
|
+
/* @__PURE__ */ jsxs("span", { className: "poolse-call-log__chip", children: [
|
|
1520
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: 13, label: null, className: "poolse-call-log__icon" }),
|
|
1521
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-call-log__title", children: display.title }),
|
|
1522
|
+
display.detail && /* @__PURE__ */ jsx("span", { className: "poolse-call-log__detail", children: display.detail }),
|
|
1523
|
+
time && /* @__PURE__ */ jsx("span", { className: "poolse-call-log__time", children: time })
|
|
1524
|
+
] }),
|
|
1525
|
+
display.callBack && onCallBack && /* @__PURE__ */ jsx(
|
|
1526
|
+
"button",
|
|
1527
|
+
{
|
|
1528
|
+
type: "button",
|
|
1529
|
+
className: "poolse-call-log__call-back",
|
|
1530
|
+
onClick: () => onCallBack(display.media),
|
|
1531
|
+
children: "Call back"
|
|
1532
|
+
}
|
|
1533
|
+
)
|
|
1534
|
+
]
|
|
1493
1535
|
}
|
|
1494
1536
|
);
|
|
1495
1537
|
}
|
|
@@ -2159,7 +2201,14 @@ function ActionButton({
|
|
|
2159
2201
|
function MessageRow(props) {
|
|
2160
2202
|
const callLog = callLogDisplayFor(props.msg, props.meId);
|
|
2161
2203
|
if (callLog !== void 0) {
|
|
2162
|
-
return callLog ? /* @__PURE__ */ jsx(
|
|
2204
|
+
return callLog ? /* @__PURE__ */ jsx(
|
|
2205
|
+
CallLogRow,
|
|
2206
|
+
{
|
|
2207
|
+
msg: props.msg,
|
|
2208
|
+
meId: props.meId,
|
|
2209
|
+
...props.onCallBack ? { onCallBack: props.onCallBack } : {}
|
|
2210
|
+
}
|
|
2211
|
+
) : null;
|
|
2163
2212
|
}
|
|
2164
2213
|
return /* @__PURE__ */ jsx(BubbleMessageRow, { ...props });
|
|
2165
2214
|
}
|
|
@@ -2597,7 +2646,10 @@ function ConversationView({
|
|
|
2597
2646
|
daySeparators = TRUE,
|
|
2598
2647
|
senderLabels = "auto",
|
|
2599
2648
|
avatars = "auto",
|
|
2600
|
-
onMarkedRead
|
|
2649
|
+
onMarkedRead,
|
|
2650
|
+
onCallBack,
|
|
2651
|
+
onJoinCall,
|
|
2652
|
+
currentCallId = null
|
|
2601
2653
|
}) {
|
|
2602
2654
|
usePoolseFonts(loadFonts);
|
|
2603
2655
|
const { me } = useMe();
|
|
@@ -2705,8 +2757,10 @@ function ConversationView({
|
|
|
2705
2757
|
() => messages.filter((m) => isMessageVisibleTo(m, meIdForFeed)),
|
|
2706
2758
|
[messages, meIdForFeed]
|
|
2707
2759
|
);
|
|
2760
|
+
const receiptsVisible = receiptsOf(me).visible;
|
|
2761
|
+
const showReadState = readReceipts && receiptsVisible;
|
|
2708
2762
|
const maxReadByOthers = useMemo(() => {
|
|
2709
|
-
if (!
|
|
2763
|
+
if (!showReadState || !me) return null;
|
|
2710
2764
|
let max = 0;
|
|
2711
2765
|
let any = false;
|
|
2712
2766
|
for (const m of members) {
|
|
@@ -2721,7 +2775,7 @@ function ConversationView({
|
|
|
2721
2775
|
any = true;
|
|
2722
2776
|
}
|
|
2723
2777
|
return any ? max : null;
|
|
2724
|
-
}, [
|
|
2778
|
+
}, [showReadState, me, members, messages]);
|
|
2725
2779
|
const [editingId, setEditingId] = useState(null);
|
|
2726
2780
|
const [threadRootId, setThreadRootId] = useState(null);
|
|
2727
2781
|
const threadRoot = useMemo(
|
|
@@ -2816,6 +2870,15 @@ function ConversationView({
|
|
|
2816
2870
|
onDragLeave,
|
|
2817
2871
|
onDrop,
|
|
2818
2872
|
children: [
|
|
2873
|
+
onJoinCall && /* @__PURE__ */ jsx(
|
|
2874
|
+
JoinBanner,
|
|
2875
|
+
{
|
|
2876
|
+
conversationId,
|
|
2877
|
+
meId: me?.id ?? null,
|
|
2878
|
+
currentCallId,
|
|
2879
|
+
onJoin: onJoinCall
|
|
2880
|
+
}
|
|
2881
|
+
),
|
|
2819
2882
|
status !== "connected" && status !== "idle" && /* @__PURE__ */ jsxs(
|
|
2820
2883
|
"div",
|
|
2821
2884
|
{
|
|
@@ -2865,7 +2928,7 @@ function ConversationView({
|
|
|
2865
2928
|
};
|
|
2866
2929
|
})() : msg;
|
|
2867
2930
|
const isSelf = me !== null && msg.sender_id === me.id;
|
|
2868
|
-
const readState =
|
|
2931
|
+
const readState = showReadState && isSelf && maxReadByOthers !== null ? maxReadByOthers >= msg.sequence ? "read" : "sent" : void 0;
|
|
2869
2932
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
2870
2933
|
showDaySeparator && /* @__PURE__ */ jsx("div", { className: "poolse-day-separator", "aria-hidden": "false", children: /* @__PURE__ */ jsx("span", { children: formatDayLabel(msg.inserted_at) }) }),
|
|
2871
2934
|
/* @__PURE__ */ jsx(
|
|
@@ -2886,7 +2949,13 @@ function ConversationView({
|
|
|
2886
2949
|
...readState ? { readState } : {},
|
|
2887
2950
|
...labelFor ? { labelFor } : {},
|
|
2888
2951
|
editing: editingId === msg.id,
|
|
2889
|
-
|
|
2952
|
+
...canEditOwnMessage({
|
|
2953
|
+
isSelf,
|
|
2954
|
+
deleted: !!msg.deleted_at,
|
|
2955
|
+
receiptsVisible,
|
|
2956
|
+
readState,
|
|
2957
|
+
insertedAt: msg.inserted_at
|
|
2958
|
+
}) ? { onStartEdit: () => setEditingId(msg.id) } : {},
|
|
2890
2959
|
onCancelEdit: () => setEditingId(null),
|
|
2891
2960
|
onSaveEdit: async (body) => {
|
|
2892
2961
|
await edit(msg.id, body);
|
|
@@ -2895,7 +2964,8 @@ function ConversationView({
|
|
|
2895
2964
|
onDelete: () => void deleteMsg(msg.id),
|
|
2896
2965
|
onOpenThread: () => setThreadRootId(msg.id),
|
|
2897
2966
|
onQuote: () => setReplyingTo(msg),
|
|
2898
|
-
onQuotedClick: scrollToOriginal
|
|
2967
|
+
onQuotedClick: scrollToOriginal,
|
|
2968
|
+
...onCallBack ? { onCallBack } : {}
|
|
2899
2969
|
}
|
|
2900
2970
|
)
|
|
2901
2971
|
] }, msg.id);
|
|
@@ -2942,6 +3012,17 @@ function ConversationView({
|
|
|
2942
3012
|
) })
|
|
2943
3013
|
] });
|
|
2944
3014
|
}
|
|
3015
|
+
function JoinBanner({
|
|
3016
|
+
conversationId,
|
|
3017
|
+
meId,
|
|
3018
|
+
currentCallId,
|
|
3019
|
+
onJoin
|
|
3020
|
+
}) {
|
|
3021
|
+
const { call, participantIds } = useLiveCall(conversationId);
|
|
3022
|
+
if (!call || call.id === currentCallId) return null;
|
|
3023
|
+
if (meId !== null && participantIds.includes(meId)) return null;
|
|
3024
|
+
return /* @__PURE__ */ jsx(LiveCallBanner, { call, inCall: participantIds.length, onJoin });
|
|
3025
|
+
}
|
|
2945
3026
|
function ChatHeader({
|
|
2946
3027
|
conversationId,
|
|
2947
3028
|
labelFor,
|
|
@@ -3663,6 +3744,6 @@ function PoolseLogo({
|
|
|
3663
3744
|
);
|
|
3664
3745
|
}
|
|
3665
3746
|
|
|
3666
|
-
export { AttachmentPreview, Avatar, CallControlButton, CallDeviceMenu, CallLogRow, CallProvider, CallVideoGrid, ChatHeader, ConversationList, ConversationView, EditableMessageBubble, GroupDetailsSheet, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, PoolseFonts, PoolseIcon, PoolseInbox, PoolseLogo, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, UserPickerSheet, useCallInvite, useDisplayName, usePoolseFonts };
|
|
3747
|
+
export { AttachmentPreview, Avatar, CallControlButton, CallDeviceMenu, CallLogRow, CallProvider, CallVideoGrid, ChatHeader, ConversationList, ConversationView, EditableMessageBubble, GroupDetailsSheet, LiveCallBanner, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, PoolseFonts, PoolseIcon, PoolseInbox, PoolseLogo, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, UserPickerSheet, useCallInvite, useDisplayName, usePoolseFonts };
|
|
3667
3748
|
//# sourceMappingURL=index.js.map
|
|
3668
3749
|
//# sourceMappingURL=index.js.map
|