@poolse/react-native 2.15.1 → 2.16.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
@@ -1275,6 +1275,18 @@ interface CallScreenProps {
1275
1275
  onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
1276
1276
  /** Called when the call's video state changes. */
1277
1277
  onVideoChange?: (video: boolean) => void;
1278
+ /**
1279
+ * `react-native-incall-manager`, imported by your app.
1280
+ *
1281
+ * Only used here for the ring tones — the earpiece purr while an
1282
+ * outbound call rings, and the ringtone for an inbound one. Without
1283
+ * it a call is completely silent until somebody answers, which reads
1284
+ * as the app having failed to place it at all.
1285
+ *
1286
+ * Injected rather than imported for the same reason every other
1287
+ * native module is: Metro only bundles what it can see statically.
1288
+ */
1289
+ inCallManager?: RingToneModule | null;
1278
1290
  /**
1279
1291
  * Hide this screen while a call is merely ringing in.
1280
1292
  *
@@ -1286,6 +1298,18 @@ interface CallScreenProps {
1286
1298
  */
1287
1299
  nativeIncomingUi?: boolean;
1288
1300
  }
1301
+ /**
1302
+ * The slice of `react-native-incall-manager` used for ring tones.
1303
+ *
1304
+ * Every method optional: older versions lack some, and a missing tone
1305
+ * must never take a call down.
1306
+ */
1307
+ interface RingToneModule {
1308
+ startRingback?: (tone?: string) => void;
1309
+ stopRingback?: () => void;
1310
+ startRingtone?: (tone?: string, vibrate?: number[], category?: string, seconds?: number) => void;
1311
+ stopRingtone?: () => void;
1312
+ }
1289
1313
  /**
1290
1314
  * WhatsApp-style call UI: a full-screen sheet that covers the app while
1291
1315
  * a call is ringing or connected, and renders nothing when idle.
@@ -1312,7 +1336,7 @@ interface CallScreenProps {
1312
1336
  * The fallback is automatic and silent by design. A deployment without
1313
1337
  * an SFU is a supported configuration, not a broken one.
1314
1338
  */
1315
- declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1339
+ declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1316
1340
 
1317
1341
  interface CallVideoGridProps {
1318
1342
  participants: CallParticipant[];
@@ -1776,4 +1800,4 @@ declare function isStalePush(sentAt: number | undefined, now: number, staleAfter
1776
1800
  */
1777
1801
  declare function useVoipCalls({ voipPush, callKeep, calls, onAnswer, onDecline, appName, apnsEnvironment, staleAfterMs, }: UseVoipCallsOptions): void;
1778
1802
 
1779
- 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, 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 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 };
1803
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -1275,6 +1275,18 @@ interface CallScreenProps {
1275
1275
  onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
1276
1276
  /** Called when the call's video state changes. */
1277
1277
  onVideoChange?: (video: boolean) => void;
1278
+ /**
1279
+ * `react-native-incall-manager`, imported by your app.
1280
+ *
1281
+ * Only used here for the ring tones — the earpiece purr while an
1282
+ * outbound call rings, and the ringtone for an inbound one. Without
1283
+ * it a call is completely silent until somebody answers, which reads
1284
+ * as the app having failed to place it at all.
1285
+ *
1286
+ * Injected rather than imported for the same reason every other
1287
+ * native module is: Metro only bundles what it can see statically.
1288
+ */
1289
+ inCallManager?: RingToneModule | null;
1278
1290
  /**
1279
1291
  * Hide this screen while a call is merely ringing in.
1280
1292
  *
@@ -1286,6 +1298,18 @@ interface CallScreenProps {
1286
1298
  */
1287
1299
  nativeIncomingUi?: boolean;
1288
1300
  }
1301
+ /**
1302
+ * The slice of `react-native-incall-manager` used for ring tones.
1303
+ *
1304
+ * Every method optional: older versions lack some, and a missing tone
1305
+ * must never take a call down.
1306
+ */
1307
+ interface RingToneModule {
1308
+ startRingback?: (tone?: string) => void;
1309
+ stopRingback?: () => void;
1310
+ startRingtone?: (tone?: string, vibrate?: number[], category?: string, seconds?: number) => void;
1311
+ stopRingtone?: () => void;
1312
+ }
1289
1313
  /**
1290
1314
  * WhatsApp-style call UI: a full-screen sheet that covers the app while
1291
1315
  * a call is ringing or connected, and renders nothing when idle.
@@ -1312,7 +1336,7 @@ interface CallScreenProps {
1312
1336
  * The fallback is automatic and silent by design. A deployment without
1313
1337
  * an SFU is a supported configuration, not a broken one.
1314
1338
  */
1315
- declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1339
+ declare function CallScreen({ userId, labelFor, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
1316
1340
 
1317
1341
  interface CallVideoGridProps {
1318
1342
  participants: CallParticipant[];
@@ -1776,4 +1800,4 @@ declare function isStalePush(sentAt: number | undefined, now: number, staleAfter
1776
1800
  */
1777
1801
  declare function useVoipCalls({ voipPush, callKeep, calls, onAnswer, onDecline, appName, apnsEnvironment, staleAfterMs, }: UseVoipCallsOptions): void;
1778
1802
 
1779
- 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, 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 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 };
1803
+ 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, 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 };
package/dist/index.js CHANGED
@@ -5517,6 +5517,7 @@ function LocalVideoPip({
5517
5517
  label,
5518
5518
  avatarSize: 48,
5519
5519
  hideName: true,
5520
+ bleed: true,
5520
5521
  style: styles28.fill
5521
5522
  }
5522
5523
  ) })
@@ -5532,7 +5533,10 @@ var styles28 = StyleSheet.create({
5532
5533
  left: 0,
5533
5534
  width: PIP_WIDTH,
5534
5535
  height: PIP_HEIGHT,
5535
- borderRadius: 16,
5536
+ // Generous enough to read as a bubble rather than a cropped
5537
+ // rectangle. The video is clipped to it, so this is the only
5538
+ // rounding in play.
5539
+ borderRadius: 22,
5536
5540
  overflow: "hidden",
5537
5541
  // Lifted off the video so it reads as floating rather than inset.
5538
5542
  shadowColor: "#000",
@@ -5815,6 +5819,7 @@ function CallScreen({
5815
5819
  onStatusChange,
5816
5820
  onTransportChange,
5817
5821
  onVideoChange,
5822
+ inCallManager,
5818
5823
  nativeIncomingUi
5819
5824
  }) {
5820
5825
  const insets = useSafeAreaInsets();
@@ -5825,7 +5830,7 @@ function CallScreen({
5825
5830
  () => meshAvailable && webrtc ? { webrtc: createNativeWebRtcAdapter(webrtc) } : {},
5826
5831
  [meshAvailable, webrtc]
5827
5832
  );
5828
- const conversationId = calls.phase === "active" ? calls.activeConversationId : null;
5833
+ const conversationId = calls.phase === "active" ? calls.activeConversationId : calls.phase === "ringing-out" ? calls.outgoing?.conversationId ?? null : null;
5829
5834
  const isVideoCall = calls.media === "video";
5830
5835
  const sfu = useCallRoom(livekit ? conversationId : null, {
5831
5836
  livekit,
@@ -5836,7 +5841,8 @@ function CallScreen({
5836
5841
  const status = usingSfu ? toVoiceStatus(sfu.status) : mesh.status;
5837
5842
  const connected = calls.phase === "active" && status === "connected";
5838
5843
  useEffect(() => {
5839
- if (calls.phase !== "active" || !conversationId) return;
5844
+ const wants = calls.phase === "active" || calls.phase === "ringing-out";
5845
+ if (!wants || !conversationId) return;
5840
5846
  let cancelled = false;
5841
5847
  void (async () => {
5842
5848
  const joined = livekit ? await sfu.join() : false;
@@ -5864,6 +5870,23 @@ function CallScreen({
5864
5870
  livekitReactNative
5865
5871
  });
5866
5872
  const [routesOpen, setRoutesOpen] = useState(false);
5873
+ const showingIncoming = calls.phase === "ringing-in" && !nativeIncomingUi;
5874
+ useEffect(() => {
5875
+ const ringing = calls.phase === "ringing-out";
5876
+ if (!ringing && !showingIncoming) return;
5877
+ try {
5878
+ if (ringing) inCallManager?.startRingback?.("_DEFAULT_");
5879
+ else inCallManager?.startRingtone?.("_DEFAULT_");
5880
+ } catch {
5881
+ }
5882
+ return () => {
5883
+ try {
5884
+ inCallManager?.stopRingback?.();
5885
+ inCallManager?.stopRingtone?.();
5886
+ } catch {
5887
+ }
5888
+ };
5889
+ }, [calls.phase, showingIncoming, inCallManager]);
5867
5890
  const [chromeVisible, setChromeVisible] = useState(true);
5868
5891
  const [lastWake, setLastWake] = useState(0);
5869
5892
  const chromeHides = connected && isVideoCall;
@@ -5874,6 +5897,13 @@ function CallScreen({
5874
5897
  return () => clearTimeout(timer);
5875
5898
  }, [chromeHides, lastWake]);
5876
5899
  const wakeChrome = useCallback(() => setLastWake(Date.now()), []);
5900
+ const toggleChrome = useCallback(() => {
5901
+ setChromeVisible((visible2) => {
5902
+ if (visible2) return false;
5903
+ setLastWake(Date.now());
5904
+ return true;
5905
+ });
5906
+ }, []);
5877
5907
  const withWake = useCallback(
5878
5908
  (fn) => () => {
5879
5909
  wakeChrome();
@@ -5932,7 +5962,7 @@ function CallScreen({
5932
5962
  onRequestClose: hangUp,
5933
5963
  children: [
5934
5964
  /* @__PURE__ */ jsx(StatusBar, { barStyle: "light-content" }),
5935
- /* @__PURE__ */ jsxs(Pressable, { style: styles30.screen, onPress: wakeChrome, accessible: false, children: [
5965
+ /* @__PURE__ */ jsxs(Pressable, { style: styles30.screen, onPress: toggleChrome, accessible: false, children: [
5936
5966
  showStage ? /* @__PURE__ */ jsx(
5937
5967
  CallVideoGrid,
5938
5968
  {