@poolse/react-ui 2.23.0 → 2.25.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.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
2
+ import { CallParticipant, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
3
3
  import * as react from 'react';
4
- import { ReactNode, SVGProps, ReactElement } from 'react';
5
- import { UploadItem, ReactionMap } from '@poolse/react';
4
+ import { SVGProps, ReactElement, ReactNode } from 'react';
5
+ import { UseRoom, UploadItem, ReactionMap } from '@poolse/react';
6
6
 
7
7
  interface CallVideoGridProps {
8
8
  participants: CallParticipant[];
@@ -13,71 +13,6 @@ interface CallVideoGridProps {
13
13
  }
14
14
  declare function CallVideoGrid({ participants, labelFor, className, onLocalClick, }: CallVideoGridProps): react_jsx_runtime.JSX.Element | null;
15
15
 
16
- interface CallInvite {
17
- /** Ring everyone in a conversation. */
18
- placeCall: (conversationId: string, media?: CallMedia) => void;
19
- /** A call is already in flight, so a new one cannot be placed. */
20
- busy: boolean;
21
- }
22
- /**
23
- * Place a call from anywhere under {@link CallProvider}.
24
- *
25
- * const { placeCall, busy } = useCallInvite();
26
- * <button disabled={busy} onClick={() => placeCall(id, 'video')}>Video</button>
27
- *
28
- * Separate from the call surface on purpose. The buttons belong in a
29
- * conversation header, the surface belongs at the root, and they must
30
- * share one state machine — see {@link CallProvider} for why that
31
- * matters more than it sounds.
32
- */
33
- declare function useCallInvite(): CallInvite;
34
- interface CallProviderProps {
35
- /** The signed-in user's poolse id — the topic calls arrive on. */
36
- userId: string | null;
37
- /**
38
- * `livekit-client`, imported by your app:
39
- *
40
- * import * as livekit from 'livekit-client';
41
- */
42
- livekit: LiveKitModule;
43
- /** Resolves a user id to a display label. */
44
- labelFor?: (userId: string) => string;
45
- children: ReactNode;
46
- }
47
- /**
48
- * Owns calling for a web app: ringing, answering, media and the call UI.
49
- *
50
- * ## Mount it ONCE, at the root
51
- *
52
- * Not inside a conversation view, and not behind a route that can
53
- * unmount. A call arrives on the user's own topic at any moment, and
54
- * this component is what listens — so anywhere it is not mounted, the
55
- * app simply cannot be called. Putting it inside a "is a conversation
56
- * open?" branch means the user is unreachable on the conversation list,
57
- * which looks exactly like calls being unreliable rather than like a
58
- * mounting mistake.
59
- *
60
- * <CallProvider userId={me.id} livekit={livekit}>
61
- * <YourApp />
62
- * </CallProvider>
63
- *
64
- * The buttons that place calls live wherever you want them, and reach
65
- * this through {@link useCallInvite}.
66
- *
67
- * ## Two media paths
68
- *
69
- * Media rides the SFU when the deployment has one — that is what makes
70
- * video and the mid-call camera toggle possible. Without one, calls fall
71
- * back to the peer-to-peer mesh, which carries audio only. The fallback
72
- * is automatic and silent by design.
73
- *
74
- * ## Styling
75
- *
76
- * Class-based, and no CSS ships with it. The host owns the look; the
77
- * class names are stable.
78
- */
79
- declare function CallProvider({ userId, livekit, labelFor, children }: CallProviderProps): react_jsx_runtime.JSX.Element;
80
-
81
16
  declare const ICONS: {
82
17
  readonly attachment: {
83
18
  readonly vb: "0 0 24 24";
@@ -664,6 +599,34 @@ interface LiveCallBannerProps {
664
599
  }
665
600
  declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
666
601
 
602
+ interface RoomJoinBarProps {
603
+ room: UseRoom;
604
+ /**
605
+ * Offer to start a room when none is live. Off, the bar shows only
606
+ * while a room (or call) is running — a pure "Join" banner.
607
+ */
608
+ allowStart?: boolean;
609
+ }
610
+ /**
611
+ * "Video room · 2 in the room · Join" while one runs; "Start a room ·
612
+ * Voice · Video" when none does. Renders nothing once you are in.
613
+ */
614
+ declare function RoomJoinBar({ room, allowStart }: RoomJoinBarProps): react_jsx_runtime.JSX.Element | null;
615
+ interface RoomStageProps {
616
+ room: UseRoom;
617
+ /** The conversation's name, shown at the top. */
618
+ title?: string;
619
+ labelFor?: (userId: string) => string;
620
+ className?: string;
621
+ }
622
+ /**
623
+ * The room you are in: everyone's video (or their initial while their
624
+ * camera is off), and the controls — microphone, camera and output, each
625
+ * with a device picker, and Leave. Fills its container: give it the
626
+ * space your layout has for the stage.
627
+ */
628
+ declare function RoomStage({ room, title, labelFor, className }: RoomStageProps): react_jsx_runtime.JSX.Element;
629
+
667
630
  interface EditableMessageBubbleProps {
668
631
  message: Message;
669
632
  currentUserId: string | null;
@@ -1011,4 +974,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
1011
974
  */
1012
975
  declare function PoolseFonts(): null;
1013
976
 
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 };
977
+ export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, CallLogRow, type CallLogRowProps, 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, RoomJoinBar, type RoomJoinBarProps, RoomStage, type RoomStageProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useDisplayName, usePoolseFonts };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CallParticipant, CallMedia, LiveKitModule, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
2
+ import { CallParticipant, CallDevice, CallDeviceKind, Uuid, Message, LiveCall, Conversation, Membership, Attachment, MessageCreateRequest } from '@poolse/sdk';
3
3
  import * as react from 'react';
4
- import { ReactNode, SVGProps, ReactElement } from 'react';
5
- import { UploadItem, ReactionMap } from '@poolse/react';
4
+ import { SVGProps, ReactElement, ReactNode } from 'react';
5
+ import { UseRoom, UploadItem, ReactionMap } from '@poolse/react';
6
6
 
7
7
  interface CallVideoGridProps {
8
8
  participants: CallParticipant[];
@@ -13,71 +13,6 @@ interface CallVideoGridProps {
13
13
  }
14
14
  declare function CallVideoGrid({ participants, labelFor, className, onLocalClick, }: CallVideoGridProps): react_jsx_runtime.JSX.Element | null;
15
15
 
16
- interface CallInvite {
17
- /** Ring everyone in a conversation. */
18
- placeCall: (conversationId: string, media?: CallMedia) => void;
19
- /** A call is already in flight, so a new one cannot be placed. */
20
- busy: boolean;
21
- }
22
- /**
23
- * Place a call from anywhere under {@link CallProvider}.
24
- *
25
- * const { placeCall, busy } = useCallInvite();
26
- * <button disabled={busy} onClick={() => placeCall(id, 'video')}>Video</button>
27
- *
28
- * Separate from the call surface on purpose. The buttons belong in a
29
- * conversation header, the surface belongs at the root, and they must
30
- * share one state machine — see {@link CallProvider} for why that
31
- * matters more than it sounds.
32
- */
33
- declare function useCallInvite(): CallInvite;
34
- interface CallProviderProps {
35
- /** The signed-in user's poolse id — the topic calls arrive on. */
36
- userId: string | null;
37
- /**
38
- * `livekit-client`, imported by your app:
39
- *
40
- * import * as livekit from 'livekit-client';
41
- */
42
- livekit: LiveKitModule;
43
- /** Resolves a user id to a display label. */
44
- labelFor?: (userId: string) => string;
45
- children: ReactNode;
46
- }
47
- /**
48
- * Owns calling for a web app: ringing, answering, media and the call UI.
49
- *
50
- * ## Mount it ONCE, at the root
51
- *
52
- * Not inside a conversation view, and not behind a route that can
53
- * unmount. A call arrives on the user's own topic at any moment, and
54
- * this component is what listens — so anywhere it is not mounted, the
55
- * app simply cannot be called. Putting it inside a "is a conversation
56
- * open?" branch means the user is unreachable on the conversation list,
57
- * which looks exactly like calls being unreliable rather than like a
58
- * mounting mistake.
59
- *
60
- * <CallProvider userId={me.id} livekit={livekit}>
61
- * <YourApp />
62
- * </CallProvider>
63
- *
64
- * The buttons that place calls live wherever you want them, and reach
65
- * this through {@link useCallInvite}.
66
- *
67
- * ## Two media paths
68
- *
69
- * Media rides the SFU when the deployment has one — that is what makes
70
- * video and the mid-call camera toggle possible. Without one, calls fall
71
- * back to the peer-to-peer mesh, which carries audio only. The fallback
72
- * is automatic and silent by design.
73
- *
74
- * ## Styling
75
- *
76
- * Class-based, and no CSS ships with it. The host owns the look; the
77
- * class names are stable.
78
- */
79
- declare function CallProvider({ userId, livekit, labelFor, children }: CallProviderProps): react_jsx_runtime.JSX.Element;
80
-
81
16
  declare const ICONS: {
82
17
  readonly attachment: {
83
18
  readonly vb: "0 0 24 24";
@@ -664,6 +599,34 @@ interface LiveCallBannerProps {
664
599
  }
665
600
  declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
666
601
 
602
+ interface RoomJoinBarProps {
603
+ room: UseRoom;
604
+ /**
605
+ * Offer to start a room when none is live. Off, the bar shows only
606
+ * while a room (or call) is running — a pure "Join" banner.
607
+ */
608
+ allowStart?: boolean;
609
+ }
610
+ /**
611
+ * "Video room · 2 in the room · Join" while one runs; "Start a room ·
612
+ * Voice · Video" when none does. Renders nothing once you are in.
613
+ */
614
+ declare function RoomJoinBar({ room, allowStart }: RoomJoinBarProps): react_jsx_runtime.JSX.Element | null;
615
+ interface RoomStageProps {
616
+ room: UseRoom;
617
+ /** The conversation's name, shown at the top. */
618
+ title?: string;
619
+ labelFor?: (userId: string) => string;
620
+ className?: string;
621
+ }
622
+ /**
623
+ * The room you are in: everyone's video (or their initial while their
624
+ * camera is off), and the controls — microphone, camera and output, each
625
+ * with a device picker, and Leave. Fills its container: give it the
626
+ * space your layout has for the stage.
627
+ */
628
+ declare function RoomStage({ room, title, labelFor, className }: RoomStageProps): react_jsx_runtime.JSX.Element;
629
+
667
630
  interface EditableMessageBubbleProps {
668
631
  message: Message;
669
632
  currentUserId: string | null;
@@ -1011,4 +974,4 @@ declare function usePoolseFonts(enabled?: boolean): void;
1011
974
  */
1012
975
  declare function PoolseFonts(): null;
1013
976
 
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 };
977
+ export { AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallControlButton, type CallControlButtonProps, CallDeviceMenu, type CallDeviceMenuProps, CallLogRow, type CallLogRowProps, 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, RoomJoinBar, type RoomJoinBarProps, RoomStage, type RoomStageProps, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, UserName, type UserNameProps, UserPickerSheet, type UserPickerSheetProps, useDisplayName, usePoolseFonts };