@poolse/react-native 2.23.1 → 2.24.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/CHANGELOG.md CHANGED
@@ -4,6 +4,20 @@ All notable changes to `@poolse/react-native` are documented here.
4
4
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/);
5
5
  versions follow [semver](https://semver.org).
6
6
 
7
+ ## [2.24.0] — 2026-10-14
8
+
9
+ ### Fixed
10
+
11
+ - **The call UI finally respects Android's navigation bar.** A Modal
12
+ is its own Android window, and safe-area insets inherited from the
13
+ root provider are stale or zero inside it — so the dock, grid and
14
+ controls all sat under the system bar while every non-modal screen
15
+ behaved. CallScreen now mounts its own SafeAreaProvider inside the
16
+ Modal and measures insets there.
17
+ - CallScreen feeds `reportOthersOnCall` so EVERY hang-up path — not
18
+ just its own button — knows a group call must survive a leaver (see
19
+ @poolse/react 2.24.0).
20
+
7
21
  ## [2.23.1] — 2026-10-14
8
22
 
9
23
  ### Fixed
package/dist/index.cjs CHANGED
@@ -6059,7 +6059,7 @@ function CallScreen({
6059
6059
  inCallManager,
6060
6060
  nativeIncomingUi
6061
6061
  }) {
6062
- const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
6062
+ const [insets, setInsets] = react.useState({ top: 0, bottom: 0, left: 0, right: 0 });
6063
6063
  const ownCalls = react$1.useCalls(callsProp ? null : userId);
6064
6064
  const calls = callsProp ?? ownCalls;
6065
6065
  const meshAvailable = isNativeWebRtcAvailable(webrtc);
@@ -6152,14 +6152,16 @@ function CallScreen({
6152
6152
  [wakeChrome]
6153
6153
  );
6154
6154
  const hangUp = react.useCallback(() => {
6155
- const othersOnCall = (usingSfu ? sfu.participants : mesh.participants).filter(
6156
- (p) => !p.isSelf
6157
- ).length;
6158
6155
  sfu.leave();
6159
6156
  mesh.leave();
6160
- if (calls.phase === "active" && othersOnCall >= 2) calls.reset();
6161
- else void calls.hangUp();
6162
- }, [sfu, mesh, calls, usingSfu]);
6157
+ void calls.hangUp();
6158
+ }, [sfu, mesh, calls]);
6159
+ const othersNow = (usingSfu ? sfu.participants : mesh.participants).filter(
6160
+ (p) => !p.isSelf
6161
+ ).length;
6162
+ react.useEffect(() => {
6163
+ calls.reportOthersOnCall?.(othersNow);
6164
+ }, [calls, othersNow]);
6163
6165
  const alone = usingSfu ? sfu.alone : mesh.alone;
6164
6166
  const endedOnEmpty = react.useRef(false);
6165
6167
  if (calls.phase !== "active") endedOnEmpty.current = false;
@@ -6216,165 +6218,177 @@ function CallScreen({
6216
6218
  onRequestClose: hangUp,
6217
6219
  children: [
6218
6220
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.StatusBar, { barStyle: "light-content" }),
6219
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles31.screen, onPress: toggleChrome, accessible: false, children: [
6220
- /* @__PURE__ */ jsxRuntime.jsx(CallBackdrop, {}),
6221
- showStage ? /* @__PURE__ */ jsxRuntime.jsx(
6222
- CallVideoGrid,
6223
- {
6224
- participants,
6225
- livekitReactNative,
6226
- labelFor: label,
6227
- onLocalPress: () => void sfu.switchCamera(),
6228
- chromeInsets,
6229
- safeArea: { top: insets.top, bottom: insets.bottom }
6230
- }
6231
- ) : (
6232
- // Audio (and pre-media) calls carry their identity in the
6233
- // middle of the scene — name under the avatar, status in a
6234
- // pill — rather than a bar pinned to the top of a void.
6235
- /* @__PURE__ */ jsxRuntime.jsxs(
6221
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNativeSafeAreaContext.SafeAreaProvider, { children: [
6222
+ /* @__PURE__ */ jsxRuntime.jsx(InsetsProbe, { onChange: setInsets }),
6223
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Pressable, { style: styles31.screen, onPress: toggleChrome, accessible: false, children: [
6224
+ /* @__PURE__ */ jsxRuntime.jsx(CallBackdrop, {}),
6225
+ showStage ? /* @__PURE__ */ jsxRuntime.jsx(
6226
+ CallVideoGrid,
6227
+ {
6228
+ participants,
6229
+ livekitReactNative,
6230
+ labelFor: label,
6231
+ onLocalPress: () => void sfu.switchCamera(),
6232
+ chromeInsets,
6233
+ safeArea: { top: insets.top, bottom: insets.bottom }
6234
+ }
6235
+ ) : (
6236
+ // Audio (and pre-media) calls carry their identity in the
6237
+ // middle of the scene — name under the avatar, status in a
6238
+ // pill — rather than a bar pinned to the top of a void.
6239
+ /* @__PURE__ */ jsxRuntime.jsxs(
6240
+ reactNative.View,
6241
+ {
6242
+ style: [styles31.identity, { paddingBottom: insets.bottom + 160 }],
6243
+ pointerEvents: "none",
6244
+ children: [
6245
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.avatarStage, children: [
6246
+ (ringingIn || ringingOut) && /* @__PURE__ */ jsxRuntime.jsx(PulseRings, { size: 132, color: callColors.glow }),
6247
+ /* @__PURE__ */ jsxRuntime.jsx(
6248
+ CallAvatar,
6249
+ {
6250
+ name: peerIds.length === 1 ? label(peerIds[0]) : title,
6251
+ seed: titleConversationId ?? peerIds[0] ?? "call",
6252
+ size: 132
6253
+ }
6254
+ )
6255
+ ] }),
6256
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 2, style: styles31.identityTitle, children: title }),
6257
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.statusPill, children: [
6258
+ connected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.statusDot }),
6259
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.statusText, children: subtitle })
6260
+ ] })
6261
+ ]
6262
+ }
6263
+ )
6264
+ ),
6265
+ chromeVisible && showStage && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles31.header, { paddingTop: insets.top + 14 }], pointerEvents: "box-none", children: [
6266
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles31.title, children: title }),
6267
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.subtitleRow, children: [
6268
+ isGroup && /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 14, color: callColors.textDim, label: null }),
6269
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.subtitle, children: isGroup ? `${participants.length} \xB7 ${subtitle}` : subtitle })
6270
+ ] })
6271
+ ] }),
6272
+ chromeVisible && /* @__PURE__ */ jsxRuntime.jsxs(
6236
6273
  reactNative.View,
6237
6274
  {
6238
- style: [styles31.identity, { paddingBottom: insets.bottom + 160 }],
6239
- pointerEvents: "none",
6275
+ style: [styles31.controls, { paddingBottom: insets.bottom + 22 }],
6276
+ pointerEvents: "box-none",
6240
6277
  children: [
6241
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.avatarStage, children: [
6242
- (ringingIn || ringingOut) && /* @__PURE__ */ jsxRuntime.jsx(PulseRings, { size: 132, color: callColors.glow }),
6243
- /* @__PURE__ */ jsxRuntime.jsx(
6244
- CallAvatar,
6245
- {
6246
- name: peerIds.length === 1 ? label(peerIds[0]) : title,
6247
- seed: titleConversationId ?? peerIds[0] ?? "call",
6248
- size: 132
6249
- }
6250
- )
6251
- ] }),
6252
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 2, style: styles31.identityTitle, children: title }),
6253
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.statusPill, children: [
6254
- connected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.statusDot }),
6255
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.statusText, children: subtitle })
6256
- ] })
6257
- ]
6258
- }
6259
- )
6260
- ),
6261
- chromeVisible && showStage && /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles31.header, { paddingTop: insets.top + 14 }], pointerEvents: "box-none", children: [
6262
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: styles31.title, children: title }),
6263
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.subtitleRow, children: [
6264
- isGroup && /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 14, color: callColors.textDim, label: null }),
6265
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.subtitle, children: isGroup ? `${participants.length} \xB7 ${subtitle}` : subtitle })
6266
- ] })
6267
- ] }),
6268
- chromeVisible && /* @__PURE__ */ jsxRuntime.jsxs(
6269
- reactNative.View,
6270
- {
6271
- style: [styles31.controls, { paddingBottom: insets.bottom + 22 }],
6272
- pointerEvents: "box-none",
6273
- children: [
6274
- error && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.error, children: error.message }),
6275
- !meshAvailable && !livekit && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.error, children: "No WebRTC module supplied \u2014 this call has no audio." }),
6276
- ringingIn ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.answerRow, children: [
6277
- /* @__PURE__ */ jsxRuntime.jsx(
6278
- CallControlButton,
6279
- {
6280
- icon: "phone-off",
6281
- tone: "danger",
6282
- large: true,
6283
- label: "Decline",
6284
- onPress: () => void calls.decline(),
6285
- accessibilityLabel: "Decline call"
6286
- }
6287
- ),
6288
- /* @__PURE__ */ jsxRuntime.jsx(
6289
- CallControlButton,
6290
- {
6291
- icon: isVideoCall ? "video" : "phone",
6292
- tone: "accept",
6293
- large: true,
6294
- label: "Accept",
6295
- onPress: () => void calls.accept(),
6296
- accessibilityLabel: "Accept call"
6297
- }
6298
- )
6299
- ] }) : ended ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.row, children: /* @__PURE__ */ jsxRuntime.jsx(
6300
- CallControlButton,
6301
- {
6302
- icon: "close",
6303
- onPress: calls.reset,
6304
- label: "Close",
6305
- accessibilityLabel: "Close"
6306
- }
6307
- ) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6308
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.dock, children: [
6278
+ error && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.error, children: error.message }),
6279
+ !meshAvailable && !livekit && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles31.error, children: "No WebRTC module supplied \u2014 this call has no audio." }),
6280
+ ringingIn ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.answerRow, children: [
6309
6281
  /* @__PURE__ */ jsxRuntime.jsx(
6310
6282
  CallControlButton,
6311
6283
  {
6312
- icon: micOn ? "mic" : "mic-off",
6313
- label: micOn ? "Mute" : "Unmute",
6314
- active: !micOn,
6315
- onPress: withWake(toggleMic),
6316
- accessibilityLabel: micOn ? "Mute microphone" : "Unmute microphone"
6284
+ icon: "phone-off",
6285
+ tone: "danger",
6286
+ large: true,
6287
+ label: "Decline",
6288
+ onPress: () => void calls.decline(),
6289
+ accessibilityLabel: "Decline call"
6317
6290
  }
6318
6291
  ),
6319
6292
  /* @__PURE__ */ jsxRuntime.jsx(
6320
6293
  CallControlButton,
6321
6294
  {
6322
- icon: speakerIcon(audio),
6323
- label: speakerLabel(audio),
6324
- active: audio.speakerOn,
6325
- onPress: withWake(onSpeakerPress),
6326
- accessibilityLabel: "Audio output"
6327
- }
6328
- ),
6329
- usingSfu && /* @__PURE__ */ jsxRuntime.jsx(
6330
- CallControlButton,
6331
- {
6332
- icon: videoOn ? "video" : "video-off",
6333
- label: "Camera",
6334
- active: !videoOn,
6335
- onPress: withWake(() => void sfu.toggleCamera()),
6336
- accessibilityLabel: videoOn ? "Turn camera off" : "Turn camera on"
6337
- }
6338
- ),
6339
- usingSfu && videoOn && /* @__PURE__ */ jsxRuntime.jsx(
6340
- CallControlButton,
6341
- {
6342
- icon: "camera-flip",
6343
- label: "Flip",
6344
- onPress: withWake(() => void sfu.switchCamera()),
6345
- accessibilityLabel: "Switch camera"
6295
+ icon: isVideoCall ? "video" : "phone",
6296
+ tone: "accept",
6297
+ large: true,
6298
+ label: "Accept",
6299
+ onPress: () => void calls.accept(),
6300
+ accessibilityLabel: "Accept call"
6346
6301
  }
6347
6302
  )
6348
- ] }),
6349
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.hangUpRow, children: /* @__PURE__ */ jsxRuntime.jsx(
6303
+ ] }) : ended ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.row, children: /* @__PURE__ */ jsxRuntime.jsx(
6350
6304
  CallControlButton,
6351
6305
  {
6352
- icon: "phone-off",
6353
- tone: "danger",
6354
- large: true,
6355
- onPress: ringingOut ? () => void calls.cancel() : hangUp,
6356
- accessibilityLabel: ringingOut ? "Cancel call" : "Hang up"
6306
+ icon: "close",
6307
+ onPress: calls.reset,
6308
+ label: "Close",
6309
+ accessibilityLabel: "Close"
6357
6310
  }
6358
- ) })
6359
- ] })
6360
- ]
6361
- }
6362
- ),
6363
- /* @__PURE__ */ jsxRuntime.jsx(
6364
- AudioRouteSheet,
6365
- {
6366
- visible: routesOpen,
6367
- routes: audio.routes,
6368
- selectedRouteId: audio.selectedRouteId,
6369
- onSelect: audio.selectRoute,
6370
- onClose: () => setRoutesOpen(false)
6371
- }
6372
- )
6311
+ ) }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6312
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.dock, children: [
6313
+ /* @__PURE__ */ jsxRuntime.jsx(
6314
+ CallControlButton,
6315
+ {
6316
+ icon: micOn ? "mic" : "mic-off",
6317
+ label: micOn ? "Mute" : "Unmute",
6318
+ active: !micOn,
6319
+ onPress: withWake(toggleMic),
6320
+ accessibilityLabel: micOn ? "Mute microphone" : "Unmute microphone"
6321
+ }
6322
+ ),
6323
+ /* @__PURE__ */ jsxRuntime.jsx(
6324
+ CallControlButton,
6325
+ {
6326
+ icon: speakerIcon(audio),
6327
+ label: speakerLabel(audio),
6328
+ active: audio.speakerOn,
6329
+ onPress: withWake(onSpeakerPress),
6330
+ accessibilityLabel: "Audio output"
6331
+ }
6332
+ ),
6333
+ usingSfu && /* @__PURE__ */ jsxRuntime.jsx(
6334
+ CallControlButton,
6335
+ {
6336
+ icon: videoOn ? "video" : "video-off",
6337
+ label: "Camera",
6338
+ active: !videoOn,
6339
+ onPress: withWake(() => void sfu.toggleCamera()),
6340
+ accessibilityLabel: videoOn ? "Turn camera off" : "Turn camera on"
6341
+ }
6342
+ ),
6343
+ usingSfu && videoOn && /* @__PURE__ */ jsxRuntime.jsx(
6344
+ CallControlButton,
6345
+ {
6346
+ icon: "camera-flip",
6347
+ label: "Flip",
6348
+ onPress: withWake(() => void sfu.switchCamera()),
6349
+ accessibilityLabel: "Switch camera"
6350
+ }
6351
+ )
6352
+ ] }),
6353
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles31.hangUpRow, children: /* @__PURE__ */ jsxRuntime.jsx(
6354
+ CallControlButton,
6355
+ {
6356
+ icon: "phone-off",
6357
+ tone: "danger",
6358
+ large: true,
6359
+ onPress: ringingOut ? () => void calls.cancel() : hangUp,
6360
+ accessibilityLabel: ringingOut ? "Cancel call" : "Hang up"
6361
+ }
6362
+ ) })
6363
+ ] })
6364
+ ]
6365
+ }
6366
+ ),
6367
+ /* @__PURE__ */ jsxRuntime.jsx(
6368
+ AudioRouteSheet,
6369
+ {
6370
+ visible: routesOpen,
6371
+ routes: audio.routes,
6372
+ selectedRouteId: audio.selectedRouteId,
6373
+ onSelect: audio.selectRoute,
6374
+ onClose: () => setRoutesOpen(false)
6375
+ }
6376
+ )
6377
+ ] })
6373
6378
  ] })
6374
6379
  ]
6375
6380
  }
6376
6381
  );
6377
6382
  }
6383
+ function InsetsProbe({
6384
+ onChange
6385
+ }) {
6386
+ const insets = reactNativeSafeAreaContext.useSafeAreaInsets();
6387
+ react.useEffect(() => {
6388
+ onChange({ top: insets.top, bottom: insets.bottom, left: insets.left, right: insets.right });
6389
+ }, [insets.top, insets.bottom, insets.left, insets.right, onChange]);
6390
+ return null;
6391
+ }
6378
6392
  function speakerIcon(audio) {
6379
6393
  if (audio.externalDevice) return "headphones";
6380
6394
  return audio.speakerOn ? "speaker" : "speaker-off";