@poolse/react 3.2.0-dev.1 → 3.2.0-dev.2
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 +7 -0
- package/dist/index.cjs +26 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -2
- package/dist/index.d.ts +18 -2
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ All notable changes to `@poolse/react` are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[semver](https://semver.org).
|
|
6
6
|
|
|
7
|
+
## [3.2.0-dev.2] — 2026-11-16 (prerelease, npm tag `dev`)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `useCallRoom` returns `screenSharing`, `sharingParticipant`, `canShareScreen`,
|
|
12
|
+
`setScreenShareEnabled()` and `toggleScreenShare()`.
|
|
13
|
+
|
|
7
14
|
## [3.2.0-dev.1] — 2026-11-04 (prerelease, npm tag `dev`)
|
|
8
15
|
|
|
9
16
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -1161,6 +1161,8 @@ function useCallRoom(conversationId, opts) {
|
|
|
1161
1161
|
const [participants, setParticipants] = react.useState([]);
|
|
1162
1162
|
const [cameraEnabled, setCamera] = react.useState(false);
|
|
1163
1163
|
const [micEnabled, setMic] = react.useState(false);
|
|
1164
|
+
const [screenSharing, setScreen] = react.useState(false);
|
|
1165
|
+
const [canShareScreen, setCanShare] = react.useState(false);
|
|
1164
1166
|
const [facingMode, setFacing] = react.useState(opts.facing ?? "user");
|
|
1165
1167
|
const [alone, setAlone] = react.useState(false);
|
|
1166
1168
|
const [devices, setDevices] = react.useState({
|
|
@@ -1204,6 +1206,8 @@ function useCallRoom(conversationId, opts) {
|
|
|
1204
1206
|
if (!target) return;
|
|
1205
1207
|
setCamera(target.isCameraEnabled());
|
|
1206
1208
|
setMic(target.isMicrophoneEnabled());
|
|
1209
|
+
setScreen(target.isScreenShareEnabled());
|
|
1210
|
+
setCanShare(target.canShareScreen());
|
|
1207
1211
|
setFacing(target.getFacingMode());
|
|
1208
1212
|
}, []);
|
|
1209
1213
|
react.useEffect(() => {
|
|
@@ -1287,6 +1291,22 @@ function useCallRoom(conversationId, opts) {
|
|
|
1287
1291
|
if (!room) return;
|
|
1288
1292
|
await setMicrophoneEnabled(!room.isMicrophoneEnabled());
|
|
1289
1293
|
}, [room, setMicrophoneEnabled]);
|
|
1294
|
+
const setScreenShareEnabled = react.useCallback(
|
|
1295
|
+
async (enabled) => {
|
|
1296
|
+
if (!room) return;
|
|
1297
|
+
await room.setScreenShareEnabled(enabled);
|
|
1298
|
+
sync(room);
|
|
1299
|
+
},
|
|
1300
|
+
[room, sync]
|
|
1301
|
+
);
|
|
1302
|
+
const toggleScreenShare = react.useCallback(async () => {
|
|
1303
|
+
if (!room) return;
|
|
1304
|
+
await setScreenShareEnabled(!room.isScreenShareEnabled());
|
|
1305
|
+
}, [room, setScreenShareEnabled]);
|
|
1306
|
+
const sharingParticipant = react.useMemo(
|
|
1307
|
+
() => participants.find((p) => p.screenSharing) ?? null,
|
|
1308
|
+
[participants]
|
|
1309
|
+
);
|
|
1290
1310
|
const switchCamera = react.useCallback(async () => {
|
|
1291
1311
|
if (!room) return;
|
|
1292
1312
|
await room.switchCamera();
|
|
@@ -1311,6 +1331,9 @@ function useCallRoom(conversationId, opts) {
|
|
|
1311
1331
|
participants,
|
|
1312
1332
|
cameraEnabled,
|
|
1313
1333
|
micEnabled,
|
|
1334
|
+
screenSharing,
|
|
1335
|
+
sharingParticipant,
|
|
1336
|
+
canShareScreen,
|
|
1314
1337
|
facingMode,
|
|
1315
1338
|
alone,
|
|
1316
1339
|
devices,
|
|
@@ -1325,7 +1348,9 @@ function useCallRoom(conversationId, opts) {
|
|
|
1325
1348
|
switchCamera,
|
|
1326
1349
|
selectDevice,
|
|
1327
1350
|
setMicrophoneEnabled,
|
|
1328
|
-
toggleMic
|
|
1351
|
+
toggleMic,
|
|
1352
|
+
setScreenShareEnabled,
|
|
1353
|
+
toggleScreenShare
|
|
1329
1354
|
};
|
|
1330
1355
|
}
|
|
1331
1356
|
function useLiveCall(conversationId) {
|