@poolse/react-native 2.25.1 → 2.26.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/LICENSE +21 -0
- package/dist/index.cjs +400 -273
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -5
- package/dist/index.d.ts +43 -5
- package/dist/index.js +401 -275
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement, ComponentType } from 'react';
|
|
3
|
-
import { Conversation, Uuid, Message, AttachmentUploadInput, Membership, Attachment, WebRtcAdapter, VoiceStatus, LiveKitModule, CallParticipant, CallMedia } from '@poolse/sdk';
|
|
3
|
+
import { Conversation, Uuid, Message, LiveCall, AttachmentUploadInput, Membership, Attachment, WebRtcAdapter, VoiceStatus, LiveKitModule, CallParticipant, CallMedia } from '@poolse/sdk';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { UseCalls } from '@poolse/react';
|
|
6
6
|
import { ViewStyle } from 'react-native';
|
|
@@ -139,8 +139,25 @@ interface ConversationViewProps {
|
|
|
139
139
|
* consumers pass it manually.
|
|
140
140
|
*/
|
|
141
141
|
keyboardOffset?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Offer "Call back" on call-log rows the viewer missed or declined,
|
|
144
|
+
* or placed with no answer. Receives the call's media; place the call
|
|
145
|
+
* on this conversation.
|
|
146
|
+
*/
|
|
147
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
148
|
+
/**
|
|
149
|
+
* Show a "Call in progress · Join" banner while a call runs on this
|
|
150
|
+
* conversation that the viewer is not on. Called with the live call
|
|
151
|
+
* when they tap Join.
|
|
152
|
+
*/
|
|
153
|
+
onJoinCall?: (call: LiveCall) => void;
|
|
154
|
+
/**
|
|
155
|
+
* The call this device is already on, if any — its banner is hidden
|
|
156
|
+
* (the viewer is in the room, or ringing out as its caller).
|
|
157
|
+
*/
|
|
158
|
+
currentCallId?: string | null;
|
|
142
159
|
}
|
|
143
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
160
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
144
161
|
|
|
145
162
|
interface ChatHeaderProps {
|
|
146
163
|
conversationId: Uuid;
|
|
@@ -294,6 +311,8 @@ interface MessageRowProps {
|
|
|
294
311
|
showAvatar?: boolean;
|
|
295
312
|
/** Avatar resolver — same signature as `<MemberList avatarFor>`. */
|
|
296
313
|
avatarFor?: (externalId: string) => string | null;
|
|
314
|
+
/** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
|
|
315
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
297
316
|
}
|
|
298
317
|
declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
|
|
299
318
|
|
|
@@ -302,8 +321,13 @@ interface CallLogRowProps {
|
|
|
302
321
|
msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
|
|
303
322
|
deleted_at?: string | null;
|
|
304
323
|
};
|
|
305
|
-
/** Current user's id — decides
|
|
324
|
+
/** Current user's id — decides how the call is worded for them. */
|
|
306
325
|
meId: string | null;
|
|
326
|
+
/**
|
|
327
|
+
* Offer "Call back" on calls the viewer missed or declined, or placed
|
|
328
|
+
* with no answer. Receives the call's media. Omit to show no action.
|
|
329
|
+
*/
|
|
330
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
307
331
|
}
|
|
308
332
|
/**
|
|
309
333
|
* Centered, compact timeline line for call-log system messages
|
|
@@ -314,7 +338,21 @@ interface CallLogRowProps {
|
|
|
314
338
|
*
|
|
315
339
|
* `<MessageRow>` renders this automatically for call-log messages.
|
|
316
340
|
*/
|
|
317
|
-
declare function CallLogRow({ msg, meId }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
341
|
+
declare function CallLogRow({ msg, meId, onCallBack }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
342
|
+
|
|
343
|
+
interface LiveCallBannerProps {
|
|
344
|
+
call: LiveCall;
|
|
345
|
+
/** How many people are in the room right now. */
|
|
346
|
+
inCall: number;
|
|
347
|
+
onJoin: (call: LiveCall) => void;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* "Voice call in progress · 2 on the call [Join]" — a strip across the
|
|
351
|
+
* top of a conversation while a call runs that the viewer is not on.
|
|
352
|
+
* `<ConversationView onJoinCall>` renders it for you; use it directly
|
|
353
|
+
* to place it elsewhere (with `useLiveCall`).
|
|
354
|
+
*/
|
|
355
|
+
declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
|
|
318
356
|
|
|
319
357
|
interface MessageComposerProps {
|
|
320
358
|
/**
|
|
@@ -1863,4 +1901,4 @@ declare function isStalePush(sentAt: number | undefined, now: number, staleAfter
|
|
|
1863
1901
|
*/
|
|
1864
1902
|
declare function useVoipCalls({ voipPush, callKeep, calls, onAnswer, onDecline, appName, apnsEnvironment, staleAfterMs, }: UseVoipCallsOptions): void;
|
|
1865
1903
|
|
|
1866
|
-
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, type CallAudio, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, type CallKeepModule, CallLogRow, type CallLogRowProps, CallParticipantTile, type CallParticipantTileProps, CallScreen, type CallScreenProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, type LiveKitAudioSession, type LiveKitReactNativeModule, LocalVideoPip, type LocalVideoPipProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type NativeWebRtcModule, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type RingToneModule, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, type UseCallAudioOptions, type UseVoipCallsOptions, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, type VoipIncomingCall, type VoipPushModule, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|
|
1904
|
+
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, type CallAudio, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, type CallKeepModule, CallLogRow, type CallLogRowProps, CallParticipantTile, type CallParticipantTileProps, CallScreen, type CallScreenProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, type LiveKitAudioSession, type LiveKitReactNativeModule, LocalVideoPip, type LocalVideoPipProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type NativeWebRtcModule, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type RingToneModule, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, type UseCallAudioOptions, type UseVoipCallsOptions, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, type VoipIncomingCall, type VoipPushModule, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ReactElement, ComponentType } from 'react';
|
|
3
|
-
import { Conversation, Uuid, Message, AttachmentUploadInput, Membership, Attachment, WebRtcAdapter, VoiceStatus, LiveKitModule, CallParticipant, CallMedia } from '@poolse/sdk';
|
|
3
|
+
import { Conversation, Uuid, Message, LiveCall, AttachmentUploadInput, Membership, Attachment, WebRtcAdapter, VoiceStatus, LiveKitModule, CallParticipant, CallMedia } from '@poolse/sdk';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { UseCalls } from '@poolse/react';
|
|
6
6
|
import { ViewStyle } from 'react-native';
|
|
@@ -139,8 +139,25 @@ interface ConversationViewProps {
|
|
|
139
139
|
* consumers pass it manually.
|
|
140
140
|
*/
|
|
141
141
|
keyboardOffset?: number;
|
|
142
|
+
/**
|
|
143
|
+
* Offer "Call back" on call-log rows the viewer missed or declined,
|
|
144
|
+
* or placed with no answer. Receives the call's media; place the call
|
|
145
|
+
* on this conversation.
|
|
146
|
+
*/
|
|
147
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
148
|
+
/**
|
|
149
|
+
* Show a "Call in progress · Join" banner while a call runs on this
|
|
150
|
+
* conversation that the viewer is not on. Called with the live call
|
|
151
|
+
* when they tap Join.
|
|
152
|
+
*/
|
|
153
|
+
onJoinCall?: (call: LiveCall) => void;
|
|
154
|
+
/**
|
|
155
|
+
* The call this device is already on, if any — its banner is hidden
|
|
156
|
+
* (the viewer is in the room, or ringing out as its caller).
|
|
157
|
+
*/
|
|
158
|
+
currentCallId?: string | null;
|
|
142
159
|
}
|
|
143
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
160
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, avatarFor, header, onHeaderMembersPress, onHeaderPress, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, senderLabels, avatars, onMarkedRead, onSent, keyboardOffset, onCallBack, onJoinCall, currentCallId, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
144
161
|
|
|
145
162
|
interface ChatHeaderProps {
|
|
146
163
|
conversationId: Uuid;
|
|
@@ -294,6 +311,8 @@ interface MessageRowProps {
|
|
|
294
311
|
showAvatar?: boolean;
|
|
295
312
|
/** Avatar resolver — same signature as `<MemberList avatarFor>`. */
|
|
296
313
|
avatarFor?: (externalId: string) => string | null;
|
|
314
|
+
/** Call-log rows: offer "Call back" (see `<CallLogRow onCallBack>`). */
|
|
315
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
297
316
|
}
|
|
298
317
|
declare function MessageRow(props: MessageRowProps): react_jsx_runtime.JSX.Element | null;
|
|
299
318
|
|
|
@@ -302,8 +321,13 @@ interface CallLogRowProps {
|
|
|
302
321
|
msg: Pick<Message, 'type' | 'body' | 'inserted_at'> & {
|
|
303
322
|
deleted_at?: string | null;
|
|
304
323
|
};
|
|
305
|
-
/** Current user's id — decides
|
|
324
|
+
/** Current user's id — decides how the call is worded for them. */
|
|
306
325
|
meId: string | null;
|
|
326
|
+
/**
|
|
327
|
+
* Offer "Call back" on calls the viewer missed or declined, or placed
|
|
328
|
+
* with no answer. Receives the call's media. Omit to show no action.
|
|
329
|
+
*/
|
|
330
|
+
onCallBack?: (media: 'audio' | 'video') => void;
|
|
307
331
|
}
|
|
308
332
|
/**
|
|
309
333
|
* Centered, compact timeline line for call-log system messages
|
|
@@ -314,7 +338,21 @@ interface CallLogRowProps {
|
|
|
314
338
|
*
|
|
315
339
|
* `<MessageRow>` renders this automatically for call-log messages.
|
|
316
340
|
*/
|
|
317
|
-
declare function CallLogRow({ msg, meId }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
341
|
+
declare function CallLogRow({ msg, meId, onCallBack }: CallLogRowProps): react_jsx_runtime.JSX.Element | null;
|
|
342
|
+
|
|
343
|
+
interface LiveCallBannerProps {
|
|
344
|
+
call: LiveCall;
|
|
345
|
+
/** How many people are in the room right now. */
|
|
346
|
+
inCall: number;
|
|
347
|
+
onJoin: (call: LiveCall) => void;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* "Voice call in progress · 2 on the call [Join]" — a strip across the
|
|
351
|
+
* top of a conversation while a call runs that the viewer is not on.
|
|
352
|
+
* `<ConversationView onJoinCall>` renders it for you; use it directly
|
|
353
|
+
* to place it elsewhere (with `useLiveCall`).
|
|
354
|
+
*/
|
|
355
|
+
declare function LiveCallBanner({ call, inCall, onJoin }: LiveCallBannerProps): react_jsx_runtime.JSX.Element;
|
|
318
356
|
|
|
319
357
|
interface MessageComposerProps {
|
|
320
358
|
/**
|
|
@@ -1863,4 +1901,4 @@ declare function isStalePush(sentAt: number | undefined, now: number, staleAfter
|
|
|
1863
1901
|
*/
|
|
1864
1902
|
declare function useVoipCalls({ voipPush, callKeep, calls, onAnswer, onDecline, appName, apnsEnvironment, staleAfterMs, }: UseVoipCallsOptions): void;
|
|
1865
1903
|
|
|
1866
|
-
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, type CallAudio, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, type CallKeepModule, CallLogRow, type CallLogRowProps, CallParticipantTile, type CallParticipantTileProps, CallScreen, type CallScreenProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, type LiveKitAudioSession, type LiveKitReactNativeModule, LocalVideoPip, type LocalVideoPipProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type NativeWebRtcModule, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type RingToneModule, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, type UseCallAudioOptions, type UseVoipCallsOptions, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, type VoipIncomingCall, type VoipPushModule, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|
|
1904
|
+
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, type AudioRoute, type AudioRouteKind, AudioRouteSheet, type AudioRouteSheetProps, Avatar, type AvatarProps, type CallAudio, CallAvatar, type CallAvatarProps, CallControlButton, type CallControlButtonProps, type CallKeepModule, CallLogRow, type CallLogRowProps, CallParticipantTile, type CallParticipantTileProps, CallScreen, type CallScreenProps, CallVideoGrid, type CallVideoGridProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, LiveCallBanner, type LiveCallBannerProps, type LiveKitAudioSession, type LiveKitReactNativeModule, LocalVideoPip, type LocalVideoPipProps, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, type NativeWebRtcModule, PoolseIcon, type PoolseIconProps, PoolseInbox, type PoolseInboxHandle, type PoolseInboxProps, PoolseLogo, type PoolseLogoProps, type PoolseLogoVariant, type PoolseRNTheme, type PoolseRNThemeOverrides, PoolseTheme, type PoolseThemeProps, primitives as Primitives, ReactionPicker, type ReactionPickerProps, ReactionStrip, type ReactionStripProps, type RingToneModule, type ThemeColors, type ThemeRadii, type ThemeShadows, type ThemeSpacing, type ThemeType, ThreadView, type ThreadViewProps, TypingIndicator, type TypingIndicatorProps, UploadQueueStrip, type UseCallAudioOptions, type UseVoipCallsOptions, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, type VoipIncomingCall, type VoipPushModule, callColors, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, describeRoute, isNativeWebRtcAvailable, isStalePush, useAppStateLifecycle, useCallAudio, useCallDuration, useDisplayName, usePoolseTheme, useVoipCalls };
|