@poolse/react-native 3.10.0 → 3.10.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 +14 -0
- package/README.md +12 -3
- package/dist/index.cjs +83 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -10
- package/dist/index.d.ts +50 -10
- package/dist/index.js +84 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
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
|
+
## [3.10.1] - 2026-11-23
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `useNativeBreakouts(conversationId, callId, { moveToRoom })` (CL5):
|
|
12
|
+
`useBreakouts` that moves the @poolse/native call into your breakout
|
|
13
|
+
room as the split opens and back as it closes (`auto`, default on);
|
|
14
|
+
`inBreakout`, `joinRoom`, `returnToMainRoom`. `BreakoutBanner` takes it
|
|
15
|
+
and uses it for Join room / Return to main.
|
|
16
|
+
- `AnnotationOverlay` draws (CL4): `annotations` (from
|
|
17
|
+
`useScreenAnnotations`) with `drawing` and `color` make a finger draw
|
|
18
|
+
lines everyone in the call sees. With @poolse/native's `callData` the
|
|
19
|
+
overlay and `useCallReactions` work on phones.
|
|
20
|
+
|
|
7
21
|
## [3.10.0] - 2026-11-23
|
|
8
22
|
|
|
9
23
|
### Added
|
package/README.md
CHANGED
|
@@ -303,11 +303,17 @@ const lobby = useLobby(conversationId, callId);
|
|
|
303
303
|
<StagePanel stage={stage} participants={people} selfUserId={me.id} />
|
|
304
304
|
<QuestionsPanel questions={questions} canModerate={stage.isModerator} />
|
|
305
305
|
<LobbyAdmitList lobby={lobby} />
|
|
306
|
-
<BreakoutBanner breakouts={
|
|
306
|
+
<BreakoutBanner breakouts={useNativeBreakouts(conversationId, callId, { moveToRoom })} />
|
|
307
307
|
<AgendaPanel agenda={useAgenda(conversationId, callId)} canEdit />
|
|
308
308
|
<MarkMomentButton moments={useMoments(conversationId, callId)} />
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
+
With `@poolse/native`, `useNativeBreakouts` (pass its `moveToRoom`) joins
|
|
312
|
+
your breakout room as the split opens and brings you back as it closes;
|
|
313
|
+
the phone's call never ends, only its media changes rooms. The banner's
|
|
314
|
+
Join room / Return to main buttons use it too. With the JS `CallRoom`, use
|
|
315
|
+
`useBreakouts` and connect to the session in `onJoined`.
|
|
316
|
+
|
|
311
317
|
`participants` is `{ userId, name?, guest?, avatarUrl? }[]` from your call
|
|
312
318
|
roster; names fall back to the `MessageExtrasProvider`'s `nameForUserId`,
|
|
313
319
|
then "Someone" — never a raw id. Guests carry a Guest mark.
|
|
@@ -325,7 +331,7 @@ Overlays for the call screen:
|
|
|
325
331
|
const t = useLiveTranscript(callId, { enabled: captionsOn });
|
|
326
332
|
{captionsOn && <CaptionsOverlay segments={t.segments} />}
|
|
327
333
|
|
|
328
|
-
const reactions = useCallReactions(media.room); //
|
|
334
|
+
const reactions = useCallReactions(media.room); // or callData from @poolse/native
|
|
329
335
|
<ReactionsOverlay reactions={reactions.reactions} />
|
|
330
336
|
<ReactionPickerBar onReact={reactions.send} />
|
|
331
337
|
|
|
@@ -336,7 +342,9 @@ const reactions = useCallReactions(media.room); // JS CallRoom only
|
|
|
336
342
|
```
|
|
337
343
|
|
|
338
344
|
The whiteboard and screen annotations are view-only on phones by default
|
|
339
|
-
(`WhiteboardView` draws pen strokes when given `model` and `readOnly={false}
|
|
345
|
+
(`WhiteboardView` draws pen strokes when given `model` and `readOnly={false}`;
|
|
346
|
+
`AnnotationOverlay` draws lines everyone sees when given `annotations` and
|
|
347
|
+
`drawing`):
|
|
340
348
|
|
|
341
349
|
```tsx
|
|
342
350
|
import * as Y from 'yjs';
|
|
@@ -346,6 +354,7 @@ const board = useWhiteboard(callId, Y, { selfUserId: me.id });
|
|
|
346
354
|
<View>
|
|
347
355
|
<CallVideoView source="screen" fit="contain" />
|
|
348
356
|
<AnnotationOverlay state={useScreenAnnotations(media.room, sharerId).state} />
|
|
357
|
+
{/* @poolse/native: useScreenAnnotations(callData, sharerId) */}
|
|
349
358
|
</View>
|
|
350
359
|
```
|
|
351
360
|
|
package/dist/index.cjs
CHANGED
|
@@ -11995,11 +11995,13 @@ function QuestionsPanel({
|
|
|
11995
11995
|
}
|
|
11996
11996
|
function BreakoutBanner({
|
|
11997
11997
|
breakouts,
|
|
11998
|
-
inBreakout
|
|
11998
|
+
inBreakout: inBreakoutProp,
|
|
11999
11999
|
onJoined,
|
|
12000
12000
|
onReturned,
|
|
12001
12001
|
style
|
|
12002
12002
|
}) {
|
|
12003
|
+
const native = "joinRoom" in breakouts ? breakouts : null;
|
|
12004
|
+
const inBreakout = inBreakoutProp ?? native?.inBreakout ?? false;
|
|
12003
12005
|
const { theme, text, muted, card } = useText2();
|
|
12004
12006
|
const s2 = breakouts.session;
|
|
12005
12007
|
const room = breakouts.myRoom;
|
|
@@ -12031,6 +12033,7 @@ function BreakoutBanner({
|
|
|
12031
12033
|
primary: true,
|
|
12032
12034
|
disabled: breakouts.pending,
|
|
12033
12035
|
onPress: async () => {
|
|
12036
|
+
if (native) return void await native.joinRoom(room.id);
|
|
12034
12037
|
const session = await breakouts.join(room.id);
|
|
12035
12038
|
if (session) onJoined?.(session);
|
|
12036
12039
|
}
|
|
@@ -12042,6 +12045,7 @@ function BreakoutBanner({
|
|
|
12042
12045
|
label: "Return to main",
|
|
12043
12046
|
disabled: breakouts.pending,
|
|
12044
12047
|
onPress: async () => {
|
|
12048
|
+
if (native) return void await native.returnToMainRoom();
|
|
12045
12049
|
const session = await breakouts.returnToMain();
|
|
12046
12050
|
if (session) onReturned?.(session);
|
|
12047
12051
|
}
|
|
@@ -12051,6 +12055,39 @@ function BreakoutBanner({
|
|
|
12051
12055
|
}
|
|
12052
12056
|
);
|
|
12053
12057
|
}
|
|
12058
|
+
function useNativeBreakouts(conversationId, callId, opts) {
|
|
12059
|
+
const optsRef = react.useRef(opts);
|
|
12060
|
+
optsRef.current = opts;
|
|
12061
|
+
const [inBreakout, setInBreakout] = react.useState(false);
|
|
12062
|
+
const move = react.useCallback(async (session, into) => {
|
|
12063
|
+
if (!session) return false;
|
|
12064
|
+
const ok = await optsRef.current.moveToRoom(session).catch(() => false);
|
|
12065
|
+
if (ok) setInBreakout(into);
|
|
12066
|
+
return ok;
|
|
12067
|
+
}, []);
|
|
12068
|
+
const breakouts = react$1.useBreakouts(conversationId, callId, {
|
|
12069
|
+
auto: opts.auto ?? true,
|
|
12070
|
+
onJoinRoom: (session, room) => {
|
|
12071
|
+
void move(session, true);
|
|
12072
|
+
optsRef.current.onJoinRoom?.(session, room);
|
|
12073
|
+
},
|
|
12074
|
+
onReturn: (session) => {
|
|
12075
|
+
void move(session, false);
|
|
12076
|
+
optsRef.current.onReturn?.(session);
|
|
12077
|
+
}
|
|
12078
|
+
});
|
|
12079
|
+
react.useEffect(() => setInBreakout(false), [callId]);
|
|
12080
|
+
const { join, returnToMain } = breakouts;
|
|
12081
|
+
const joinRoom = react.useCallback(
|
|
12082
|
+
async (roomId) => move(await join(roomId), true),
|
|
12083
|
+
[join, move]
|
|
12084
|
+
);
|
|
12085
|
+
const returnToMainRoom = react.useCallback(
|
|
12086
|
+
async () => move(await returnToMain(), false),
|
|
12087
|
+
[returnToMain, move]
|
|
12088
|
+
);
|
|
12089
|
+
return { ...breakouts, inBreakout, joinRoom, returnToMainRoom };
|
|
12090
|
+
}
|
|
12054
12091
|
function LobbyWaiting({ name, status, title, onLeave, style }) {
|
|
12055
12092
|
const { theme, text, muted } = useText2();
|
|
12056
12093
|
const headline = status === "denied" ? "The host didn\u2019t let you in" : status === "ended" ? "This meeting has ended" : status === "admitted" ? "You\u2019re in \u2014 joining\u2026" : "Waiting for the host to let you in";
|
|
@@ -12745,14 +12782,56 @@ function WhiteboardView({
|
|
|
12745
12782
|
}
|
|
12746
12783
|
);
|
|
12747
12784
|
}
|
|
12748
|
-
function AnnotationOverlay({
|
|
12785
|
+
function AnnotationOverlay({
|
|
12786
|
+
state,
|
|
12787
|
+
annotations,
|
|
12788
|
+
drawing = false,
|
|
12789
|
+
color = "#e5484d",
|
|
12790
|
+
style
|
|
12791
|
+
}) {
|
|
12749
12792
|
const [box, setBox] = react.useState({ w: 0, h: 0 });
|
|
12793
|
+
const stroke = react.useRef(null);
|
|
12794
|
+
const canDraw = drawing && !!annotations && box.w > 0 && box.h > 0;
|
|
12795
|
+
const pan = react.useMemo(
|
|
12796
|
+
() => reactNative.PanResponder.create({
|
|
12797
|
+
onStartShouldSetPanResponder: () => canDraw,
|
|
12798
|
+
onMoveShouldSetPanResponder: () => canDraw,
|
|
12799
|
+
onPanResponderGrant: (e) => {
|
|
12800
|
+
if (!annotations) return;
|
|
12801
|
+
const id = annotations.begin({ color });
|
|
12802
|
+
stroke.current = id;
|
|
12803
|
+
annotations.extend(id, e.nativeEvent.locationX / box.w, e.nativeEvent.locationY / box.h);
|
|
12804
|
+
},
|
|
12805
|
+
onPanResponderMove: (e) => {
|
|
12806
|
+
if (!annotations || !stroke.current) return;
|
|
12807
|
+
annotations.extend(
|
|
12808
|
+
stroke.current,
|
|
12809
|
+
e.nativeEvent.locationX / box.w,
|
|
12810
|
+
e.nativeEvent.locationY / box.h
|
|
12811
|
+
);
|
|
12812
|
+
},
|
|
12813
|
+
onPanResponderRelease: () => {
|
|
12814
|
+
if (annotations && stroke.current) annotations.end(stroke.current);
|
|
12815
|
+
stroke.current = null;
|
|
12816
|
+
},
|
|
12817
|
+
onPanResponderTerminate: () => {
|
|
12818
|
+
if (annotations && stroke.current) annotations.end(stroke.current);
|
|
12819
|
+
stroke.current = null;
|
|
12820
|
+
}
|
|
12821
|
+
}),
|
|
12822
|
+
[canDraw, annotations, color, box.w, box.h]
|
|
12823
|
+
);
|
|
12750
12824
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
12751
12825
|
reactNative.View,
|
|
12752
12826
|
{
|
|
12753
12827
|
style: [reactNative.StyleSheet.absoluteFill, style],
|
|
12754
|
-
pointerEvents: "none",
|
|
12828
|
+
pointerEvents: canDraw ? "auto" : "none",
|
|
12755
12829
|
onLayout: (e) => setBox({ w: e.nativeEvent.layout.width, h: e.nativeEvent.layout.height }),
|
|
12830
|
+
...canDraw ? {
|
|
12831
|
+
...pan.panHandlers,
|
|
12832
|
+
accessible: true,
|
|
12833
|
+
accessibilityLabel: "Shared screen. Draw with one finger"
|
|
12834
|
+
} : {},
|
|
12756
12835
|
children: state && box.w > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(reactNativeSvg.Svg, { width: box.w, height: box.h, children: [
|
|
12757
12836
|
state.strokes.map((s2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
12758
12837
|
reactNativeSvg.Path,
|
|
@@ -14218,6 +14297,7 @@ exports.useBackgroundClients = useBackgroundClients;
|
|
|
14218
14297
|
exports.useCallDuration = useCallDuration;
|
|
14219
14298
|
exports.useDisplayName = useDisplayName;
|
|
14220
14299
|
exports.useMessageExtras = useMessageExtras;
|
|
14300
|
+
exports.useNativeBreakouts = useNativeBreakouts;
|
|
14221
14301
|
exports.usePoolseTheme = usePoolseTheme;
|
|
14222
14302
|
exports.useTheme = useTheme;
|
|
14223
14303
|
//# sourceMappingURL=index.cjs.map
|