@poolse/react-ui 2.10.1 → 2.12.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 +40 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
2
|
+
import { CallParticipant, Uuid, Message, 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';
|
|
6
6
|
|
|
7
|
+
interface CallVideoGridProps {
|
|
8
|
+
participants: CallParticipant[];
|
|
9
|
+
labelFor?: (userId: string) => string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function CallVideoGrid({ participants, labelFor, className }: CallVideoGridProps): react_jsx_runtime.JSX.Element | null;
|
|
13
|
+
|
|
7
14
|
interface ConversationViewProps {
|
|
8
15
|
conversationId: Uuid;
|
|
9
16
|
/** Placeholder when there are no messages. */
|
|
@@ -808,4 +815,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
808
815
|
*/
|
|
809
816
|
declare function PoolseFonts(): null;
|
|
810
817
|
|
|
811
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, 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, useDisplayName, usePoolseFonts };
|
|
818
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, 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, useDisplayName, usePoolseFonts };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { Uuid, Message, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
|
|
2
|
+
import { CallParticipant, Uuid, Message, 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';
|
|
6
6
|
|
|
7
|
+
interface CallVideoGridProps {
|
|
8
|
+
participants: CallParticipant[];
|
|
9
|
+
labelFor?: (userId: string) => string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function CallVideoGrid({ participants, labelFor, className }: CallVideoGridProps): react_jsx_runtime.JSX.Element | null;
|
|
13
|
+
|
|
7
14
|
interface ConversationViewProps {
|
|
8
15
|
conversationId: Uuid;
|
|
9
16
|
/** Placeholder when there are no messages. */
|
|
@@ -808,4 +815,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
|
|
|
808
815
|
*/
|
|
809
816
|
declare function PoolseFonts(): null;
|
|
810
817
|
|
|
811
|
-
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, 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, useDisplayName, usePoolseFonts };
|
|
818
|
+
export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, 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, useDisplayName, usePoolseFonts };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,48 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useMembers, useAttachmentUpload, useMe, useConversations, useUser, useConversation, usePresence, useMessages, useTyping, useRealtimeStatus, computeGroupPosition, sameDay, formatDayLabel, useReactions, useThread, useAttachmentUrl } from '@poolse/react';
|
|
3
2
|
import { forwardRef, useState, useRef, useCallback, useImperativeHandle, useEffect, useMemo, Fragment as Fragment$1 } from 'react';
|
|
4
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useMembers, useAttachmentUpload, useMe, useConversations, useUser, useConversation, usePresence, useMessages, useTyping, useRealtimeStatus, computeGroupPosition, sameDay, formatDayLabel, useReactions, useThread, useAttachmentUrl } from '@poolse/react';
|
|
5
5
|
import ReactMarkdown from 'react-markdown';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
7
7
|
|
|
8
|
-
// src/
|
|
8
|
+
// src/CallVideoGrid.tsx
|
|
9
|
+
function CallVideoGrid({ participants, labelFor, className }) {
|
|
10
|
+
const label = labelFor ?? ((id) => `User ${id.slice(0, 6)}`);
|
|
11
|
+
if (participants.length === 0) return null;
|
|
12
|
+
return /* @__PURE__ */ jsx("div", { className: className ?? "callgrid", children: participants.map((participant) => /* @__PURE__ */ jsx(CallVideoTile, { participant, label }, participant.userId)) });
|
|
13
|
+
}
|
|
14
|
+
function CallVideoTile({
|
|
15
|
+
participant,
|
|
16
|
+
label
|
|
17
|
+
}) {
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
const track = participant.videoTrack;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const element = ref.current;
|
|
22
|
+
if (!element || !track) return;
|
|
23
|
+
track.attach(element);
|
|
24
|
+
return () => {
|
|
25
|
+
track.detach(element);
|
|
26
|
+
};
|
|
27
|
+
}, [track]);
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: `callgrid__tile${participant.speaking ? " callgrid__tile--speaking" : ""}`, children: [
|
|
29
|
+
track ? /* @__PURE__ */ jsx(
|
|
30
|
+
"video",
|
|
31
|
+
{
|
|
32
|
+
ref,
|
|
33
|
+
className: "callgrid__video",
|
|
34
|
+
autoPlay: true,
|
|
35
|
+
playsInline: true,
|
|
36
|
+
muted: participant.isSelf,
|
|
37
|
+
style: participant.isSelf ? { transform: "scaleX(-1)" } : void 0
|
|
38
|
+
}
|
|
39
|
+
) : /* @__PURE__ */ jsx("div", { className: "callgrid__placeholder", "aria-hidden": "true", children: label(participant.userId).slice(0, 1).toUpperCase() }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "callgrid__caption", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("span", { className: "callgrid__name", children: participant.isSelf ? "You" : participant.name ?? label(participant.userId) }),
|
|
42
|
+
!participant.micEnabled && /* @__PURE__ */ jsx("span", { className: "callgrid__muted", children: "muted" })
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
9
46
|
var FONT_HREF = "https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=Hanken+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";
|
|
10
47
|
var FONT_HREF_PRECONNECT_GOOGLE = "https://fonts.googleapis.com";
|
|
11
48
|
var FONT_HREF_PRECONNECT_STATIC = "https://fonts.gstatic.com";
|
|
@@ -3003,6 +3040,6 @@ function PoolseLogo({
|
|
|
3003
3040
|
);
|
|
3004
3041
|
}
|
|
3005
3042
|
|
|
3006
|
-
export { AttachmentPreview, Avatar, ChatHeader, ConversationList, ConversationView, EditableMessageBubble, GroupDetailsSheet, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, PoolseFonts, PoolseIcon, PoolseInbox, PoolseLogo, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, UserPickerSheet, useDisplayName, usePoolseFonts };
|
|
3043
|
+
export { AttachmentPreview, Avatar, CallVideoGrid, ChatHeader, ConversationList, ConversationView, EditableMessageBubble, GroupDetailsSheet, MemberList, MentionInput, MessageActions, MessageBubble, MessageComposer, PoolseFonts, PoolseIcon, PoolseInbox, PoolseLogo, ReactionPicker, ReactionStrip, ThreadView, TypingIndicator, UploadQueueStrip, UserName, UserPickerSheet, useDisplayName, usePoolseFonts };
|
|
3007
3044
|
//# sourceMappingURL=index.js.map
|
|
3008
3045
|
//# sourceMappingURL=index.js.map
|