@poolse/react-native 2.2.0 → 2.3.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 +21 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -33
- package/dist/index.d.ts +75 -33
- package/dist/index.js +21 -26
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -977,8 +977,74 @@ declare const defaultDarkTheme: PoolseRNTheme;
|
|
|
977
977
|
*/
|
|
978
978
|
declare function useAppStateLifecycle(): void;
|
|
979
979
|
|
|
980
|
+
/**
|
|
981
|
+
* React Native WebRTC binding, backed by `react-native-webrtc`.
|
|
982
|
+
*
|
|
983
|
+
* The module is passed IN rather than required here, and that is
|
|
984
|
+
* deliberate. Metro resolves dependencies statically, and this package
|
|
985
|
+
* is published through tsup, which rewrites a literal `require(...)`
|
|
986
|
+
* into a `__require(...)` call it cannot see — so bundling
|
|
987
|
+
* `react-native-webrtc` from inside this file never worked. It wasn't
|
|
988
|
+
* merely unavailable in Expo Go; it was absent from every bundle,
|
|
989
|
+
* development builds included, and surfaced as
|
|
990
|
+
* "Requiring unknown module react-native-webrtc" at runtime.
|
|
991
|
+
*
|
|
992
|
+
* Importing it in the app fixes that: Metro sees a static import in
|
|
993
|
+
* your source and bundles it. Optionality then lives where it belongs —
|
|
994
|
+
* an app that doesn't want voice simply never imports it, and never
|
|
995
|
+
* installs the native dependency.
|
|
996
|
+
*
|
|
997
|
+
* import * as webrtc from 'react-native-webrtc';
|
|
998
|
+
* <VoiceRoomBar conversationId={id} webrtc={webrtc} />
|
|
999
|
+
*
|
|
1000
|
+
* Media streams on native aren't attached to an element the way they
|
|
1001
|
+
* are on the web — audio-only calls route to the device's audio session
|
|
1002
|
+
* once the peer connection is live, so the sink is a no-op. Video would
|
|
1003
|
+
* render the stream through `<RTCView>` via the `toURL()` it exposes.
|
|
1004
|
+
*/
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* The shape this binding needs from `react-native-webrtc`. The module's
|
|
1008
|
+
* own namespace satisfies it, so `import * as webrtc` type-checks
|
|
1009
|
+
* straight through.
|
|
1010
|
+
*/
|
|
1011
|
+
interface NativeWebRtcModule {
|
|
1012
|
+
RTCPeerConnection: new (...args: never[]) => unknown;
|
|
1013
|
+
mediaDevices: {
|
|
1014
|
+
getUserMedia: (...args: never[]) => Promise<unknown>;
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* True when `mod` looks like a usable `react-native-webrtc`.
|
|
1019
|
+
*
|
|
1020
|
+
* Guards against a half-linked native module: in a bare Expo Go client
|
|
1021
|
+
* the JS may load while the native side is missing, leaving
|
|
1022
|
+
* `RTCPeerConnection` undefined.
|
|
1023
|
+
*/
|
|
1024
|
+
declare function isNativeWebRtcAvailable(mod: NativeWebRtcModule | null | undefined): boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Adapter for `useVoiceRoom`'s `webrtc` option.
|
|
1027
|
+
*
|
|
1028
|
+
* @param mod the `react-native-webrtc` module, imported by your app.
|
|
1029
|
+
* @throws when `mod` isn't a usable binding — check
|
|
1030
|
+
* {@link isNativeWebRtcAvailable} first if that's reachable in
|
|
1031
|
+
* your UI.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function createNativeWebRtcAdapter(mod: NativeWebRtcModule): WebRtcAdapter;
|
|
1034
|
+
|
|
980
1035
|
interface VoiceRoomBarProps {
|
|
981
1036
|
conversationId: string;
|
|
1037
|
+
/**
|
|
1038
|
+
* The `react-native-webrtc` module, imported by your app:
|
|
1039
|
+
*
|
|
1040
|
+
* import * as webrtc from 'react-native-webrtc';
|
|
1041
|
+
*
|
|
1042
|
+
* Required for audio. Metro only bundles what it can see statically,
|
|
1043
|
+
* so this package cannot import it for you — see `voice/webrtc-native`.
|
|
1044
|
+
* Omit it and the bar renders its unavailable state, which is what you
|
|
1045
|
+
* want in Expo Go.
|
|
1046
|
+
*/
|
|
1047
|
+
webrtc?: NativeWebRtcModule | null;
|
|
982
1048
|
/** Resolves a user id to a display label. Defaults to a short id. */
|
|
983
1049
|
labelFor?: (userId: string) => string;
|
|
984
1050
|
/**
|
|
@@ -995,7 +1061,7 @@ interface VoiceRoomBarProps {
|
|
|
995
1061
|
* always-on voice channel. For ringing a specific person, use
|
|
996
1062
|
* `<IncomingCallSheet>` together with `useCalls`.
|
|
997
1063
|
*/
|
|
998
|
-
declare function VoiceRoomBar({ conversationId, labelFor, unavailableSlot }: VoiceRoomBarProps): react_jsx_runtime.JSX.Element;
|
|
1064
|
+
declare function VoiceRoomBar({ conversationId, labelFor, unavailableSlot, webrtc, }: VoiceRoomBarProps): react_jsx_runtime.JSX.Element;
|
|
999
1065
|
|
|
1000
1066
|
interface CallScreenProps {
|
|
1001
1067
|
/** The signed-in user's id — the topic calls are delivered on. */
|
|
@@ -1008,6 +1074,12 @@ interface CallScreenProps {
|
|
|
1008
1074
|
* component manages its own.
|
|
1009
1075
|
*/
|
|
1010
1076
|
calls?: UseCalls;
|
|
1077
|
+
/**
|
|
1078
|
+
* The `react-native-webrtc` module, imported by your app. Required for
|
|
1079
|
+
* call audio; without it the screen still rings and connects but warns
|
|
1080
|
+
* that there is no audio. See {@link VoiceRoomBarProps.webrtc}.
|
|
1081
|
+
*/
|
|
1082
|
+
webrtc?: NativeWebRtcModule | null;
|
|
1011
1083
|
}
|
|
1012
1084
|
/**
|
|
1013
1085
|
* WhatsApp-style call UI: a full-screen sheet that covers the app while
|
|
@@ -1024,36 +1096,6 @@ interface CallScreenProps {
|
|
|
1024
1096
|
* to whatever button your UI wants. Pass the same instance in via
|
|
1025
1097
|
* `calls` so both halves share one state machine.
|
|
1026
1098
|
*/
|
|
1027
|
-
declare function CallScreen({ userId, labelFor, calls: external }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* React Native WebRTC binding, backed by `react-native-webrtc`.
|
|
1031
|
-
*
|
|
1032
|
-
* That package ships native code, so it can't run in Expo Go and not
|
|
1033
|
-
* every app wants it. It's therefore an OPTIONAL peer dependency,
|
|
1034
|
-
* resolved with a guarded `require` at call time rather than a static
|
|
1035
|
-
* import: an app that never places a call doesn't need it installed,
|
|
1036
|
-
* and one that does gets a clear message instead of a redbox at import.
|
|
1037
|
-
*
|
|
1038
|
-
* Media streams on native aren't attached to an element the way they
|
|
1039
|
-
* are on the web — audio-only calls route to the device's audio session
|
|
1040
|
-
* automatically once the peer connection is live, so the sink is a
|
|
1041
|
-
* no-op. Video would render the stream through `<RTCView>` using the
|
|
1042
|
-
* `toURL()` the stream exposes.
|
|
1043
|
-
*/
|
|
1044
|
-
|
|
1045
|
-
/**
|
|
1046
|
-
* Whether this app can actually carry call audio. Use it to disable a
|
|
1047
|
-
* call button rather than letting the user tap into a failure.
|
|
1048
|
-
*/
|
|
1049
|
-
declare function isNativeWebRtcAvailable(): boolean;
|
|
1050
|
-
/**
|
|
1051
|
-
* Adapter for {@link useVoiceRoom}'s `webrtc` option.
|
|
1052
|
-
*
|
|
1053
|
-
* @throws when `react-native-webrtc` isn't installed — check
|
|
1054
|
-
* {@link isNativeWebRtcAvailable} first if that's reachable in
|
|
1055
|
-
* your UI.
|
|
1056
|
-
*/
|
|
1057
|
-
declare function createNativeWebRtcAdapter(): WebRtcAdapter;
|
|
1099
|
+
declare function CallScreen({ userId, labelFor, calls: external, webrtc }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1058
1100
|
|
|
1059
|
-
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallScreen, type CallScreenProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, 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, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, isNativeWebRtcAvailable, useAppStateLifecycle, useDisplayName, usePoolseTheme };
|
|
1101
|
+
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallScreen, type CallScreenProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, 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, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, isNativeWebRtcAvailable, useAppStateLifecycle, useDisplayName, usePoolseTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -977,8 +977,74 @@ declare const defaultDarkTheme: PoolseRNTheme;
|
|
|
977
977
|
*/
|
|
978
978
|
declare function useAppStateLifecycle(): void;
|
|
979
979
|
|
|
980
|
+
/**
|
|
981
|
+
* React Native WebRTC binding, backed by `react-native-webrtc`.
|
|
982
|
+
*
|
|
983
|
+
* The module is passed IN rather than required here, and that is
|
|
984
|
+
* deliberate. Metro resolves dependencies statically, and this package
|
|
985
|
+
* is published through tsup, which rewrites a literal `require(...)`
|
|
986
|
+
* into a `__require(...)` call it cannot see — so bundling
|
|
987
|
+
* `react-native-webrtc` from inside this file never worked. It wasn't
|
|
988
|
+
* merely unavailable in Expo Go; it was absent from every bundle,
|
|
989
|
+
* development builds included, and surfaced as
|
|
990
|
+
* "Requiring unknown module react-native-webrtc" at runtime.
|
|
991
|
+
*
|
|
992
|
+
* Importing it in the app fixes that: Metro sees a static import in
|
|
993
|
+
* your source and bundles it. Optionality then lives where it belongs —
|
|
994
|
+
* an app that doesn't want voice simply never imports it, and never
|
|
995
|
+
* installs the native dependency.
|
|
996
|
+
*
|
|
997
|
+
* import * as webrtc from 'react-native-webrtc';
|
|
998
|
+
* <VoiceRoomBar conversationId={id} webrtc={webrtc} />
|
|
999
|
+
*
|
|
1000
|
+
* Media streams on native aren't attached to an element the way they
|
|
1001
|
+
* are on the web — audio-only calls route to the device's audio session
|
|
1002
|
+
* once the peer connection is live, so the sink is a no-op. Video would
|
|
1003
|
+
* render the stream through `<RTCView>` via the `toURL()` it exposes.
|
|
1004
|
+
*/
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* The shape this binding needs from `react-native-webrtc`. The module's
|
|
1008
|
+
* own namespace satisfies it, so `import * as webrtc` type-checks
|
|
1009
|
+
* straight through.
|
|
1010
|
+
*/
|
|
1011
|
+
interface NativeWebRtcModule {
|
|
1012
|
+
RTCPeerConnection: new (...args: never[]) => unknown;
|
|
1013
|
+
mediaDevices: {
|
|
1014
|
+
getUserMedia: (...args: never[]) => Promise<unknown>;
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* True when `mod` looks like a usable `react-native-webrtc`.
|
|
1019
|
+
*
|
|
1020
|
+
* Guards against a half-linked native module: in a bare Expo Go client
|
|
1021
|
+
* the JS may load while the native side is missing, leaving
|
|
1022
|
+
* `RTCPeerConnection` undefined.
|
|
1023
|
+
*/
|
|
1024
|
+
declare function isNativeWebRtcAvailable(mod: NativeWebRtcModule | null | undefined): boolean;
|
|
1025
|
+
/**
|
|
1026
|
+
* Adapter for `useVoiceRoom`'s `webrtc` option.
|
|
1027
|
+
*
|
|
1028
|
+
* @param mod the `react-native-webrtc` module, imported by your app.
|
|
1029
|
+
* @throws when `mod` isn't a usable binding — check
|
|
1030
|
+
* {@link isNativeWebRtcAvailable} first if that's reachable in
|
|
1031
|
+
* your UI.
|
|
1032
|
+
*/
|
|
1033
|
+
declare function createNativeWebRtcAdapter(mod: NativeWebRtcModule): WebRtcAdapter;
|
|
1034
|
+
|
|
980
1035
|
interface VoiceRoomBarProps {
|
|
981
1036
|
conversationId: string;
|
|
1037
|
+
/**
|
|
1038
|
+
* The `react-native-webrtc` module, imported by your app:
|
|
1039
|
+
*
|
|
1040
|
+
* import * as webrtc from 'react-native-webrtc';
|
|
1041
|
+
*
|
|
1042
|
+
* Required for audio. Metro only bundles what it can see statically,
|
|
1043
|
+
* so this package cannot import it for you — see `voice/webrtc-native`.
|
|
1044
|
+
* Omit it and the bar renders its unavailable state, which is what you
|
|
1045
|
+
* want in Expo Go.
|
|
1046
|
+
*/
|
|
1047
|
+
webrtc?: NativeWebRtcModule | null;
|
|
982
1048
|
/** Resolves a user id to a display label. Defaults to a short id. */
|
|
983
1049
|
labelFor?: (userId: string) => string;
|
|
984
1050
|
/**
|
|
@@ -995,7 +1061,7 @@ interface VoiceRoomBarProps {
|
|
|
995
1061
|
* always-on voice channel. For ringing a specific person, use
|
|
996
1062
|
* `<IncomingCallSheet>` together with `useCalls`.
|
|
997
1063
|
*/
|
|
998
|
-
declare function VoiceRoomBar({ conversationId, labelFor, unavailableSlot }: VoiceRoomBarProps): react_jsx_runtime.JSX.Element;
|
|
1064
|
+
declare function VoiceRoomBar({ conversationId, labelFor, unavailableSlot, webrtc, }: VoiceRoomBarProps): react_jsx_runtime.JSX.Element;
|
|
999
1065
|
|
|
1000
1066
|
interface CallScreenProps {
|
|
1001
1067
|
/** The signed-in user's id — the topic calls are delivered on. */
|
|
@@ -1008,6 +1074,12 @@ interface CallScreenProps {
|
|
|
1008
1074
|
* component manages its own.
|
|
1009
1075
|
*/
|
|
1010
1076
|
calls?: UseCalls;
|
|
1077
|
+
/**
|
|
1078
|
+
* The `react-native-webrtc` module, imported by your app. Required for
|
|
1079
|
+
* call audio; without it the screen still rings and connects but warns
|
|
1080
|
+
* that there is no audio. See {@link VoiceRoomBarProps.webrtc}.
|
|
1081
|
+
*/
|
|
1082
|
+
webrtc?: NativeWebRtcModule | null;
|
|
1011
1083
|
}
|
|
1012
1084
|
/**
|
|
1013
1085
|
* WhatsApp-style call UI: a full-screen sheet that covers the app while
|
|
@@ -1024,36 +1096,6 @@ interface CallScreenProps {
|
|
|
1024
1096
|
* to whatever button your UI wants. Pass the same instance in via
|
|
1025
1097
|
* `calls` so both halves share one state machine.
|
|
1026
1098
|
*/
|
|
1027
|
-
declare function CallScreen({ userId, labelFor, calls: external }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* React Native WebRTC binding, backed by `react-native-webrtc`.
|
|
1031
|
-
*
|
|
1032
|
-
* That package ships native code, so it can't run in Expo Go and not
|
|
1033
|
-
* every app wants it. It's therefore an OPTIONAL peer dependency,
|
|
1034
|
-
* resolved with a guarded `require` at call time rather than a static
|
|
1035
|
-
* import: an app that never places a call doesn't need it installed,
|
|
1036
|
-
* and one that does gets a clear message instead of a redbox at import.
|
|
1037
|
-
*
|
|
1038
|
-
* Media streams on native aren't attached to an element the way they
|
|
1039
|
-
* are on the web — audio-only calls route to the device's audio session
|
|
1040
|
-
* automatically once the peer connection is live, so the sink is a
|
|
1041
|
-
* no-op. Video would render the stream through `<RTCView>` using the
|
|
1042
|
-
* `toURL()` the stream exposes.
|
|
1043
|
-
*/
|
|
1044
|
-
|
|
1045
|
-
/**
|
|
1046
|
-
* Whether this app can actually carry call audio. Use it to disable a
|
|
1047
|
-
* call button rather than letting the user tap into a failure.
|
|
1048
|
-
*/
|
|
1049
|
-
declare function isNativeWebRtcAvailable(): boolean;
|
|
1050
|
-
/**
|
|
1051
|
-
* Adapter for {@link useVoiceRoom}'s `webrtc` option.
|
|
1052
|
-
*
|
|
1053
|
-
* @throws when `react-native-webrtc` isn't installed — check
|
|
1054
|
-
* {@link isNativeWebRtcAvailable} first if that's reachable in
|
|
1055
|
-
* your UI.
|
|
1056
|
-
*/
|
|
1057
|
-
declare function createNativeWebRtcAdapter(): WebRtcAdapter;
|
|
1099
|
+
declare function CallScreen({ userId, labelFor, calls: external, webrtc }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1058
1100
|
|
|
1059
|
-
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallScreen, type CallScreenProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, MemberList, type MemberListProps, MentionInput, type MentionInputProps, MessageActions, type MessageActionsProps, MessageBubble, type MessageBubbleProps, MessageComposer, type MessageComposerProps, MessageList, type MessageListItem, type MessageListProps, MessageRow, type MessageRowProps, 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, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, isNativeWebRtcAvailable, useAppStateLifecycle, useDisplayName, usePoolseTheme };
|
|
1101
|
+
export { AttachmentPicker, type AttachmentPickerProps, AttachmentPreview, type AttachmentPreviewProps, Avatar, type AvatarProps, CallScreen, type CallScreenProps, ChatHeader, type ChatHeaderProps, ConversationList, type ConversationListProps, ConversationView, type ConversationViewProps, DaySeparator, type DaySeparatorProps, GroupDetailsSheet, type GroupDetailsSheetProps, type IconName, ImageMosaic, type ImageMosaicProps, type InboxUser, 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, UserName, type UserNameProps, VoiceRoomBar, type VoiceRoomBarProps, createNativeWebRtcAdapter, defaultDarkTheme, defaultLightTheme, isNativeWebRtcAvailable, useAppStateLifecycle, useDisplayName, usePoolseTheme };
|
package/dist/index.js
CHANGED
|
@@ -4915,32 +4915,22 @@ function useAppStateLifecycle() {
|
|
|
4915
4915
|
}
|
|
4916
4916
|
|
|
4917
4917
|
// src/voice/webrtc-native.ts
|
|
4918
|
-
|
|
4919
|
-
function
|
|
4920
|
-
if (cached !== void 0) return cached;
|
|
4921
|
-
try {
|
|
4922
|
-
cached = __require("react-native-webrtc");
|
|
4923
|
-
} catch {
|
|
4924
|
-
cached = null;
|
|
4925
|
-
}
|
|
4926
|
-
return cached;
|
|
4927
|
-
}
|
|
4928
|
-
function isNativeWebRtcAvailable() {
|
|
4929
|
-
return loadNativeWebRtc() != null;
|
|
4918
|
+
function isNativeWebRtcAvailable(mod) {
|
|
4919
|
+
return typeof mod?.RTCPeerConnection === "function" && mod?.mediaDevices != null;
|
|
4930
4920
|
}
|
|
4931
|
-
function createNativeWebRtcAdapter() {
|
|
4932
|
-
|
|
4933
|
-
if (!native) {
|
|
4921
|
+
function createNativeWebRtcAdapter(mod) {
|
|
4922
|
+
if (!isNativeWebRtcAvailable(mod)) {
|
|
4934
4923
|
throw new Error(
|
|
4935
|
-
"react-native-webrtc is not
|
|
4924
|
+
"react-native-webrtc is missing or not linked. Install it and rebuild:\n npx expo install react-native-webrtc\nIt contains native code, so it needs a development build \u2014 it will not run in Expo Go."
|
|
4936
4925
|
);
|
|
4937
4926
|
}
|
|
4927
|
+
const rtc = mod;
|
|
4938
4928
|
return {
|
|
4939
4929
|
createPeerConnection(iceServers) {
|
|
4940
|
-
return new
|
|
4930
|
+
return new rtc.RTCPeerConnection({ iceServers });
|
|
4941
4931
|
},
|
|
4942
4932
|
getUserMedia() {
|
|
4943
|
-
return
|
|
4933
|
+
return rtc.mediaDevices.getUserMedia({
|
|
4944
4934
|
audio: { echoCancellation: true, noiseSuppression: true },
|
|
4945
4935
|
video: false
|
|
4946
4936
|
});
|
|
@@ -4951,12 +4941,17 @@ function createNativeWebRtcAdapter() {
|
|
|
4951
4941
|
}
|
|
4952
4942
|
};
|
|
4953
4943
|
}
|
|
4954
|
-
function VoiceRoomBar({
|
|
4944
|
+
function VoiceRoomBar({
|
|
4945
|
+
conversationId,
|
|
4946
|
+
labelFor,
|
|
4947
|
+
unavailableSlot,
|
|
4948
|
+
webrtc
|
|
4949
|
+
}) {
|
|
4955
4950
|
const theme = usePoolseTheme();
|
|
4956
|
-
const available = isNativeWebRtcAvailable();
|
|
4951
|
+
const available = isNativeWebRtcAvailable(webrtc);
|
|
4957
4952
|
const opts = useMemo(
|
|
4958
|
-
() => available ? { webrtc: createNativeWebRtcAdapter() } : {},
|
|
4959
|
-
[available]
|
|
4953
|
+
() => available && webrtc ? { webrtc: createNativeWebRtcAdapter(webrtc) } : {},
|
|
4954
|
+
[available, webrtc]
|
|
4960
4955
|
);
|
|
4961
4956
|
const { status, participants, muted, join, leave, toggleMute, error } = useVoiceRoom(
|
|
4962
4957
|
available ? conversationId : null,
|
|
@@ -5084,14 +5079,14 @@ var styles23 = StyleSheet.create({
|
|
|
5084
5079
|
hint: { fontSize: 13, flexShrink: 1 },
|
|
5085
5080
|
error: { fontSize: 12, marginTop: 6 }
|
|
5086
5081
|
});
|
|
5087
|
-
function CallScreen({ userId, labelFor, calls: external }) {
|
|
5082
|
+
function CallScreen({ userId, labelFor, calls: external, webrtc }) {
|
|
5088
5083
|
const theme = usePoolseTheme();
|
|
5089
5084
|
const own = useCalls(external ? null : userId);
|
|
5090
5085
|
const calls = external ?? own;
|
|
5091
|
-
const available = isNativeWebRtcAvailable();
|
|
5086
|
+
const available = isNativeWebRtcAvailable(webrtc);
|
|
5092
5087
|
const opts = useMemo(
|
|
5093
|
-
() => available ? { webrtc: createNativeWebRtcAdapter() } : {},
|
|
5094
|
-
[available]
|
|
5088
|
+
() => available && webrtc ? { webrtc: createNativeWebRtcAdapter(webrtc) } : {},
|
|
5089
|
+
[available, webrtc]
|
|
5095
5090
|
);
|
|
5096
5091
|
const voice = useVoiceRoom(
|
|
5097
5092
|
calls.phase === "active" && available ? calls.activeConversationId : null,
|