@poolse/react-native 2.21.1 → 2.22.1
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/CHANGELOG.md +22 -0
- package/dist/index.cjs +60 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +60 -47
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -243,9 +243,9 @@ interface MessageBubbleProps {
|
|
|
243
243
|
/**
|
|
244
244
|
* One message bubble, structured as stacked sections rather than one
|
|
245
245
|
* padded box: media bleeds to a 3px frame, text carries its own
|
|
246
|
-
* padding, and the timestamp
|
|
247
|
-
*
|
|
248
|
-
*
|
|
246
|
+
* padding, and the timestamp shares the last text line when measured
|
|
247
|
+
* room allows — which is what makes "ok" a one-line bubble instead of
|
|
248
|
+
* a squat rectangle.
|
|
249
249
|
*/
|
|
250
250
|
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
251
251
|
|
|
@@ -1317,6 +1317,13 @@ interface CallScreenProps {
|
|
|
1317
1317
|
onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
|
|
1318
1318
|
/** Called when the call's video state changes. */
|
|
1319
1319
|
onVideoChange?: (video: boolean) => void;
|
|
1320
|
+
/**
|
|
1321
|
+
* Called when the audio route changes: speaker on/off, or an
|
|
1322
|
+
* external device (headset, Bluetooth) taking over. Hosts use this
|
|
1323
|
+
* to drive the proximity sensor — the screen should only go dark
|
|
1324
|
+
* near an ear when the sound is actually AT the ear.
|
|
1325
|
+
*/
|
|
1326
|
+
onSpeakerChange?: (speakerOn: boolean, externalDevice: boolean) => void;
|
|
1320
1327
|
/**
|
|
1321
1328
|
* `react-native-incall-manager`, imported by your app.
|
|
1322
1329
|
*
|
|
@@ -1352,7 +1359,7 @@ interface RingToneModule {
|
|
|
1352
1359
|
startRingtone?: (...args: never[]) => void;
|
|
1353
1360
|
stopRingtone?: (...args: never[]) => void;
|
|
1354
1361
|
}
|
|
1355
|
-
declare function CallScreen({ userId, labelFor, conversationLabel, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1362
|
+
declare function CallScreen({ userId, labelFor, conversationLabel, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, onSpeakerChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1356
1363
|
|
|
1357
1364
|
interface CallVideoGridProps {
|
|
1358
1365
|
participants: CallParticipant[];
|
package/dist/index.d.ts
CHANGED
|
@@ -243,9 +243,9 @@ interface MessageBubbleProps {
|
|
|
243
243
|
/**
|
|
244
244
|
* One message bubble, structured as stacked sections rather than one
|
|
245
245
|
* padded box: media bleeds to a 3px frame, text carries its own
|
|
246
|
-
* padding, and the timestamp
|
|
247
|
-
*
|
|
248
|
-
*
|
|
246
|
+
* padding, and the timestamp shares the last text line when measured
|
|
247
|
+
* room allows — which is what makes "ok" a one-line bubble instead of
|
|
248
|
+
* a squat rectangle.
|
|
249
249
|
*/
|
|
250
250
|
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, showSenderName, actionsTrigger, showAttachments, markdown, onLongPress, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
251
251
|
|
|
@@ -1317,6 +1317,13 @@ interface CallScreenProps {
|
|
|
1317
1317
|
onTransportChange?: (transport: 'sfu' | 'mesh' | null) => void;
|
|
1318
1318
|
/** Called when the call's video state changes. */
|
|
1319
1319
|
onVideoChange?: (video: boolean) => void;
|
|
1320
|
+
/**
|
|
1321
|
+
* Called when the audio route changes: speaker on/off, or an
|
|
1322
|
+
* external device (headset, Bluetooth) taking over. Hosts use this
|
|
1323
|
+
* to drive the proximity sensor — the screen should only go dark
|
|
1324
|
+
* near an ear when the sound is actually AT the ear.
|
|
1325
|
+
*/
|
|
1326
|
+
onSpeakerChange?: (speakerOn: boolean, externalDevice: boolean) => void;
|
|
1320
1327
|
/**
|
|
1321
1328
|
* `react-native-incall-manager`, imported by your app.
|
|
1322
1329
|
*
|
|
@@ -1352,7 +1359,7 @@ interface RingToneModule {
|
|
|
1352
1359
|
startRingtone?: (...args: never[]) => void;
|
|
1353
1360
|
stopRingtone?: (...args: never[]) => void;
|
|
1354
1361
|
}
|
|
1355
|
-
declare function CallScreen({ userId, labelFor, conversationLabel, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1362
|
+
declare function CallScreen({ userId, labelFor, conversationLabel, calls: callsProp, webrtc, livekit, livekitReactNative, onStatusChange, onTransportChange, onVideoChange, onSpeakerChange, inCallManager, nativeIncomingUi, }: CallScreenProps): react_jsx_runtime.JSX.Element;
|
|
1356
1363
|
|
|
1357
1364
|
interface CallVideoGridProps {
|
|
1358
1365
|
participants: CallParticipant[];
|
package/dist/index.js
CHANGED
|
@@ -2759,6 +2759,9 @@ function MessageBubble({
|
|
|
2759
2759
|
const { width: screenWidth } = useWindowDimensions();
|
|
2760
2760
|
const isSelf = currentUserId !== null && message.sender_id === currentUserId;
|
|
2761
2761
|
const [expanded, setExpanded] = useState(false);
|
|
2762
|
+
const [lastLineWidth, setLastLineWidth] = useState(null);
|
|
2763
|
+
const [textBoxWidth, setTextBoxWidth] = useState(null);
|
|
2764
|
+
const [metaWidth, setMetaWidth] = useState(null);
|
|
2762
2765
|
const bubbleMaxWidth = Math.floor(screenWidth * 0.78);
|
|
2763
2766
|
const mediaWidth = Math.min(bubbleMaxWidth - 6, 420);
|
|
2764
2767
|
const sender = useUser(!isSelf ? message.sender_external_id : null);
|
|
@@ -2794,7 +2797,7 @@ function MessageBubble({
|
|
|
2794
2797
|
const jumboCount = hasBody && !hasMedia && !hasFiles && !message.quoted_message_id ? emojiOnlyCount(body) : 0;
|
|
2795
2798
|
const inlineMeta = hasBody && jumboCount === 0 && !trimmable && (!markdown || !hasMarkdown(truncated));
|
|
2796
2799
|
const sectionAbove = hasMedia || hasFiles || !!message.quoted_message || isDeleted;
|
|
2797
|
-
const
|
|
2800
|
+
const metaFits = lastLineWidth !== null && textBoxWidth !== null && metaWidth !== null && lastLineWidth + metaWidth + 14 <= textBoxWidth;
|
|
2798
2801
|
const metaRow = (variant) => {
|
|
2799
2802
|
const color = variant === "overlay" ? "#FFFFFF" : variant === "jumbo" ? theme.colors.ink3 : mutedOnBubble;
|
|
2800
2803
|
return /* @__PURE__ */ jsxs(
|
|
@@ -2803,6 +2806,7 @@ function MessageBubble({
|
|
|
2803
2806
|
style: [
|
|
2804
2807
|
styles15.metaRow,
|
|
2805
2808
|
variant === "inline" && styles15.metaInline,
|
|
2809
|
+
variant === "wrapped" && styles15.metaWrapped,
|
|
2806
2810
|
variant === "overlay" && styles15.metaOverlay,
|
|
2807
2811
|
variant === "block" && styles15.metaBlock,
|
|
2808
2812
|
// File-only bubble: the meta row follows the cards directly —
|
|
@@ -2810,6 +2814,7 @@ function MessageBubble({
|
|
|
2810
2814
|
variant === "block" && hasFiles && !hasBody && styles15.metaBlockAfterFiles,
|
|
2811
2815
|
variant === "jumbo" && styles15.metaJumbo
|
|
2812
2816
|
],
|
|
2817
|
+
onLayout: variant === "inline" || variant === "wrapped" ? (e) => setMetaWidth(e.nativeEvent.layout.width) : void 0,
|
|
2813
2818
|
pointerEvents: "none",
|
|
2814
2819
|
children: [
|
|
2815
2820
|
isEdited ? /* @__PURE__ */ jsx(Text, { style: [styles15.editedTag, { color, opacity: 0.8 }], children: "edited" }) : null,
|
|
@@ -2907,51 +2912,53 @@ function MessageBubble({
|
|
|
2907
2912
|
children: body
|
|
2908
2913
|
}
|
|
2909
2914
|
) }) : null,
|
|
2910
|
-
hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxs(
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
return false;
|
|
2920
|
-
}
|
|
2921
|
-
}) : /* @__PURE__ */ jsxs(
|
|
2922
|
-
Text,
|
|
2923
|
-
{
|
|
2924
|
-
style: {
|
|
2925
|
-
color: textColor,
|
|
2915
|
+
hasBody && jumboCount === 0 ? /* @__PURE__ */ jsxs(
|
|
2916
|
+
View,
|
|
2917
|
+
{
|
|
2918
|
+
style: [styles15.textBlock, sectionAbove && styles15.textBlockAfter],
|
|
2919
|
+
onLayout: inlineMeta ? (e) => setTextBoxWidth(e.nativeEvent.layout.width - 24) : void 0,
|
|
2920
|
+
children: [
|
|
2921
|
+
markdown && !inlineMeta ? renderMarkdown(truncated, {
|
|
2922
|
+
textColor,
|
|
2923
|
+
linkColor: isSelf ? theme.colors.onBrand : theme.colors.brand,
|
|
2926
2924
|
fontFamily: theme.type.fontBody,
|
|
2927
2925
|
fontSize: theme.type.bodySize,
|
|
2928
|
-
lineHeight: theme.type.lineHeight
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2926
|
+
lineHeight: theme.type.lineHeight,
|
|
2927
|
+
onLinkPress: (url) => {
|
|
2928
|
+
void Linking.openURL(url).catch(() => void 0);
|
|
2929
|
+
return false;
|
|
2930
|
+
}
|
|
2931
|
+
}) : /* @__PURE__ */ jsx(
|
|
2932
|
+
Text,
|
|
2933
|
+
{
|
|
2934
|
+
style: {
|
|
2935
|
+
color: textColor,
|
|
2936
|
+
fontFamily: theme.type.fontBody,
|
|
2937
|
+
fontSize: theme.type.bodySize,
|
|
2938
|
+
lineHeight: theme.type.lineHeight
|
|
2939
|
+
},
|
|
2940
|
+
onTextLayout: inlineMeta ? (e) => {
|
|
2941
|
+
const lines = e.nativeEvent.lines;
|
|
2942
|
+
const last = lines[lines.length - 1];
|
|
2943
|
+
setLastLineWidth(last ? Math.ceil(last.width) : 0);
|
|
2944
|
+
} : void 0,
|
|
2945
|
+
children: truncated
|
|
2946
|
+
}
|
|
2947
|
+
),
|
|
2948
|
+
trimmable ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setExpanded((e) => !e), children: /* @__PURE__ */ jsx(
|
|
2949
|
+
Text,
|
|
2950
|
+
{
|
|
2951
|
+
style: [
|
|
2952
|
+
styles15.readMore,
|
|
2953
|
+
{ color: isSelf ? theme.colors.onBrand : theme.colors.brand }
|
|
2954
|
+
],
|
|
2955
|
+
children: expanded ? "Show less" : "Read more"
|
|
2956
|
+
}
|
|
2957
|
+
) }) : null,
|
|
2958
|
+
inlineMeta ? metaRow(metaFits ? "inline" : "wrapped") : null
|
|
2959
|
+
]
|
|
2960
|
+
}
|
|
2961
|
+
) : null,
|
|
2955
2962
|
!inlineMeta && !metaOverlay && jumboCount === 0 ? metaRow("block") : null,
|
|
2956
2963
|
actionsTrigger ? /* @__PURE__ */ jsx(View, { style: styles15.actionsSlot, children: actionsTrigger }) : null
|
|
2957
2964
|
]
|
|
@@ -3047,9 +3054,11 @@ var styles15 = StyleSheet.create({
|
|
|
3047
3054
|
jumboBlock: {
|
|
3048
3055
|
paddingVertical: 2
|
|
3049
3056
|
},
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3057
|
+
// The meta on its own line inside the text block, flush right —
|
|
3058
|
+
// the fallback whenever the last text line has no room for it.
|
|
3059
|
+
metaWrapped: {
|
|
3060
|
+
alignSelf: "flex-end",
|
|
3061
|
+
marginTop: 3
|
|
3053
3062
|
},
|
|
3054
3063
|
readMore: {
|
|
3055
3064
|
fontSize: 12,
|
|
@@ -6008,6 +6017,7 @@ function CallScreen({
|
|
|
6008
6017
|
onStatusChange,
|
|
6009
6018
|
onTransportChange,
|
|
6010
6019
|
onVideoChange,
|
|
6020
|
+
onSpeakerChange,
|
|
6011
6021
|
inCallManager,
|
|
6012
6022
|
nativeIncomingUi
|
|
6013
6023
|
}) {
|
|
@@ -6059,6 +6069,9 @@ function CallScreen({
|
|
|
6059
6069
|
livekitReactNative
|
|
6060
6070
|
});
|
|
6061
6071
|
const [routesOpen, setRoutesOpen] = useState(false);
|
|
6072
|
+
useEffect(() => {
|
|
6073
|
+
onSpeakerChange?.(audio.speakerOn, audio.externalDevice);
|
|
6074
|
+
}, [audio.speakerOn, audio.externalDevice, onSpeakerChange]);
|
|
6062
6075
|
const showingIncoming = calls.phase === "ringing-in" && !nativeIncomingUi;
|
|
6063
6076
|
useEffect(() => {
|
|
6064
6077
|
const ringing = calls.phase === "ringing-out";
|