@poolse/react-ui 3.2.0-dev.2 → 3.2.0-dev.4
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 +35 -0
- package/dist/index.cjs +308 -152
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -2
- package/dist/index.d.ts +48 -2
- package/dist/index.js +308 -152
- package/dist/index.js.map +1 -1
- package/dist/styles.css +302 -55
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,41 @@ All notable changes to `@poolse/react-ui` 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.4] — 2026-11-16 (prerelease, npm tag `dev`)
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- A redesigned call screen. `RoomStage`'s controls are one floating dock of
|
|
12
|
+
round glass buttons with filled icons; they never wrap to a second row, so
|
|
13
|
+
Leave stays on screen on a phone, and they shrink when the room is narrow.
|
|
14
|
+
A control you turned off (muted, camera off) turns red; screen sharing
|
|
15
|
+
lights up blue. Device menus open from a chevron in the same pill as their
|
|
16
|
+
button. Labels became tooltips and accessible names.
|
|
17
|
+
- The room's header shows a live clock with a red dot and a people count as
|
|
18
|
+
chips. Tiles are rounder, the speaking ring sits inside the tile, and the
|
|
19
|
+
name captions are frosted.
|
|
20
|
+
- A shared screen stacks above the faces whenever the room is narrow, not
|
|
21
|
+
only when the window is.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- `CallControlButton` takes `highlight` for something you turned on, and
|
|
26
|
+
shows its label as a tooltip.
|
|
27
|
+
- Filled call icons: `mic-fill`, `mic-off-fill`, `video-fill`,
|
|
28
|
+
`video-off-fill`, `screen-share-fill`, `screen-share-off-fill`,
|
|
29
|
+
`phone-off-fill`, `speaker-fill`.
|
|
30
|
+
|
|
31
|
+
## [3.2.0-dev.3] — 2026-11-16 (prerelease, npm tag `dev`)
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- Full screen in calls. `RoomStage` has a Full screen button in its header that
|
|
36
|
+
takes the whole room (video, controls) full screen; a shared screen has its
|
|
37
|
+
own button (and double-click) to watch just the screen full screen. On iPhone
|
|
38
|
+
Safari, which has no element full screen, the screen opens in the native video
|
|
39
|
+
player. The button is hidden where neither works.
|
|
40
|
+
- Icons `fullscreen` and `fullscreen-exit`.
|
|
41
|
+
|
|
7
42
|
## [3.2.0-dev.2] — 2026-11-16 (prerelease, npm tag `dev`)
|
|
8
43
|
|
|
9
44
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -80,6 +80,14 @@ var ICONS = {
|
|
|
80
80
|
vb: "0 0 24 24",
|
|
81
81
|
d: '<circle cx="12" cy="12" r="8.6"/><circle cx="9" cy="10" r="1" fill="currentColor" stroke="none"/><circle cx="15" cy="10" r="1" fill="currentColor" stroke="none"/><path d="M8.4 14.2a4.6 4.6 0 0 0 7.2 0"/>'
|
|
82
82
|
},
|
|
83
|
+
fullscreen: {
|
|
84
|
+
vb: "0 0 24 24",
|
|
85
|
+
d: '<path d="M4 9V5.5A1.5 1.5 0 0 1 5.5 4H9"/><path d="M15 4h3.5A1.5 1.5 0 0 1 20 5.5V9"/><path d="M20 15v3.5a1.5 1.5 0 0 1-1.5 1.5H15"/><path d="M9 20H5.5A1.5 1.5 0 0 1 4 18.5V15"/>'
|
|
86
|
+
},
|
|
87
|
+
"fullscreen-exit": {
|
|
88
|
+
vb: "0 0 24 24",
|
|
89
|
+
d: '<path d="M9 4v3.5A1.5 1.5 0 0 1 7.5 9H4"/><path d="M20 9h-3.5A1.5 1.5 0 0 1 15 7.5V4"/><path d="M15 20v-3.5a1.5 1.5 0 0 1 1.5-1.5H20"/><path d="M4 15h3.5A1.5 1.5 0 0 1 9 16.5V20"/>'
|
|
90
|
+
},
|
|
83
91
|
headphones: {
|
|
84
92
|
vb: "0 0 24 24",
|
|
85
93
|
d: '<path d="M4 14v-2a8 8 0 0 1 16 0v2"/><path d="M4 14h2.6a1.4 1.4 0 0 1 1.4 1.4v3.2A1.4 1.4 0 0 1 6.6 20H5.4A1.4 1.4 0 0 1 4 18.6Z"/><path d="M20 14h-2.6a1.4 1.4 0 0 0-1.4 1.4v3.2A1.4 1.4 0 0 0 17.4 20h1.2A1.4 1.4 0 0 0 20 18.6Z"/>'
|
|
@@ -120,10 +128,18 @@ var ICONS = {
|
|
|
120
128
|
vb: "0 0 24 24",
|
|
121
129
|
d: '<rect x="9" y="2.6" width="6" height="11.2" rx="3"/><path d="M5.6 11.2a6.4 6.4 0 0 0 12.8 0"/><path d="M12 17.6v3.4"/><path d="M8.6 21h6.8"/>'
|
|
122
130
|
},
|
|
131
|
+
"mic-fill": {
|
|
132
|
+
vb: "0 0 24 24",
|
|
133
|
+
d: '<rect x="8.5" y="2.5" width="7" height="12" rx="3.5" fill="currentColor" stroke="none"/><path d="M5.5 11a6.5 6.5 0 0 0 13 0"/><path d="M12 17.5V21"/>'
|
|
134
|
+
},
|
|
123
135
|
"mic-off": {
|
|
124
136
|
vb: "0 0 24 24",
|
|
125
137
|
d: '<rect x="9" y="2.6" width="6" height="11.2" rx="3"/><path d="M5.6 11.2a6.4 6.4 0 0 0 12.8 0"/><path d="M12 17.6v3.4"/><path d="M8.6 21h6.8"/><path d="M3.6 3.2 20.4 20.8"/>'
|
|
126
138
|
},
|
|
139
|
+
"mic-off-fill": {
|
|
140
|
+
vb: "0 0 24 24",
|
|
141
|
+
d: '<defs><mask id="poolse-cut-mic" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff" stroke="none"/><path d="M3.5 3.5 20.5 20.5" stroke="#000" stroke-width="5"/></mask></defs><g mask="url(#poolse-cut-mic)"><rect x="8.5" y="2.5" width="7" height="12" rx="3.5" fill="currentColor" stroke="none"/><path d="M5.5 11a6.5 6.5 0 0 0 13 0"/><path d="M12 17.5V21"/></g><path d="M3.5 3.5 20.5 20.5"/>'
|
|
142
|
+
},
|
|
127
143
|
"more-h": {
|
|
128
144
|
vb: "0 0 24 24",
|
|
129
145
|
d: '<circle cx="5.4" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.6" fill="currentColor" stroke="none"/><circle cx="18.6" cy="12" r="1.6" fill="currentColor" stroke="none"/>'
|
|
@@ -140,6 +156,10 @@ var ICONS = {
|
|
|
140
156
|
vb: "0 0 24 24",
|
|
141
157
|
d: '<g transform="rotate(135 12 12)"><path d="M6.6 3.5h3l1.5 3.7-1.9 1.4a12.5 12.5 0 0 0 6.2 6.2l1.4-1.9 3.7 1.5v3a2 2 0 0 1-2.2 2A16.8 16.8 0 0 1 4.6 5.7a2 2 0 0 1 2-2.2Z"/></g>'
|
|
142
158
|
},
|
|
159
|
+
"phone-off-fill": {
|
|
160
|
+
vb: "0 0 24 24",
|
|
161
|
+
d: '<g transform="rotate(135 12 12)"><path d="M6.6 3.5h3l1.5 3.7-1.9 1.4a12.5 12.5 0 0 0 6.2 6.2l1.4-1.9 3.7 1.5v3a2 2 0 0 1-2.2 2A16.8 16.8 0 0 1 4.6 5.7a2 2 0 0 1 2-2.2Z" fill="currentColor" stroke-width="1.2"/></g>'
|
|
162
|
+
},
|
|
143
163
|
pin: {
|
|
144
164
|
vb: "0 0 24 24",
|
|
145
165
|
d: '<path d="M9 3.4h6v1.8l-1 5.6 3 3.2H7l3-3.2-1-5.6V3.4Z"/><path d="M12 17v3.6"/>'
|
|
@@ -164,10 +184,18 @@ var ICONS = {
|
|
|
164
184
|
vb: "0 0 24 24",
|
|
165
185
|
d: '<rect x="2.6" y="4" width="18.8" height="12.6" rx="2"/><path d="M8.4 20.4h7.2"/><path d="M12 16.6v3.8"/><path d="M12 13V7.4"/><path d="M9.4 9.8 12 7.2l2.6 2.6"/>'
|
|
166
186
|
},
|
|
187
|
+
"screen-share-fill": {
|
|
188
|
+
vb: "0 0 24 24",
|
|
189
|
+
d: '<defs><mask id="poolse-cut-share" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff" stroke="none"/><path d="M12 14.2V7.8M9 10.6l3-3 3 3" stroke="#000" stroke-width="2" fill="none"/></mask></defs><g mask="url(#poolse-cut-share)"><rect x="2.4" y="3.8" width="19.2" height="13.4" rx="2.6" fill="currentColor" stroke="none"/><path d="M8.6 20.6h6.8"/></g>'
|
|
190
|
+
},
|
|
167
191
|
"screen-share-off": {
|
|
168
192
|
vb: "0 0 24 24",
|
|
169
193
|
d: '<rect x="2.6" y="4" width="18.8" height="12.6" rx="2"/><path d="M8.4 20.4h7.2"/><path d="M12 16.6v3.8"/><path d="M9.6 8 14.4 12.6"/><path d="M14.4 8 9.6 12.6"/>'
|
|
170
194
|
},
|
|
195
|
+
"screen-share-off-fill": {
|
|
196
|
+
vb: "0 0 24 24",
|
|
197
|
+
d: '<defs><mask id="poolse-cut-unshare" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff" stroke="none"/><path d="M9.4 7.9l5.2 5.2M14.6 7.9l-5.2 5.2" stroke="#000" stroke-width="2" fill="none"/></mask></defs><g mask="url(#poolse-cut-unshare)"><rect x="2.4" y="3.8" width="19.2" height="13.4" rx="2.6" fill="currentColor" stroke="none"/><path d="M8.6 20.6h6.8"/></g>'
|
|
198
|
+
},
|
|
171
199
|
search: {
|
|
172
200
|
vb: "0 0 24 24",
|
|
173
201
|
d: '<circle cx="11" cy="11" r="6.8"/><path d="M20.8 20.8 16 16"/>'
|
|
@@ -192,6 +220,10 @@ var ICONS = {
|
|
|
192
220
|
vb: "0 0 24 24",
|
|
193
221
|
d: '<path d="M4 9.5h3.2L12 5.4v13.2L7.2 14.5H4a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1Z"/><path d="M15.6 9.2a4 4 0 0 1 0 5.6"/><path d="M18.2 6.6a7.7 7.7 0 0 1 0 10.8"/>'
|
|
194
222
|
},
|
|
223
|
+
"speaker-fill": {
|
|
224
|
+
vb: "0 0 24 24",
|
|
225
|
+
d: '<path d="M3.5 9.4h3.3L11.4 5a.6.6 0 0 1 1 .44v13.12a.6.6 0 0 1-1 .44L6.8 14.6H3.5a1 1 0 0 1-1-1V10.4a1 1 0 0 1 1-1Z" fill="currentColor" stroke="none"/><path d="M15.6 9.2a4 4 0 0 1 0 5.6"/><path d="M18.3 6.5a7.8 7.8 0 0 1 0 11"/>'
|
|
226
|
+
},
|
|
195
227
|
"speaker-off": {
|
|
196
228
|
vb: "0 0 24 24",
|
|
197
229
|
d: '<path d="M4 9.5h3.2L12 5.4v13.2L7.2 14.5H4a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1Z"/><path d="M16.4 9.6 21.4 14.4"/><path d="M21.4 9.6 16.4 14.4"/>'
|
|
@@ -224,10 +256,18 @@ var ICONS = {
|
|
|
224
256
|
vb: "0 0 24 24",
|
|
225
257
|
d: '<rect x="2.6" y="6" width="13" height="12" rx="2.4"/><path d="M15.6 11.2 21.4 8v8l-5.8-3.2Z"/>'
|
|
226
258
|
},
|
|
259
|
+
"video-fill": {
|
|
260
|
+
vb: "0 0 24 24",
|
|
261
|
+
d: '<rect x="2" y="6" width="13.6" height="12" rx="3" fill="currentColor" stroke="none"/><path d="M17.1 10.3 21 7.8a.7.7 0 0 1 1.1.6v7.2a.7.7 0 0 1-1.1.6l-3.9-2.5Z" fill="currentColor" stroke="none"/>'
|
|
262
|
+
},
|
|
227
263
|
"video-off": {
|
|
228
264
|
vb: "0 0 24 24",
|
|
229
265
|
d: '<rect x="2.6" y="6" width="13" height="12" rx="2.4"/><path d="M15.6 11.2 21.4 8v8l-5.8-3.2Z"/><path d="M3.6 3.2 20.4 20.8"/>'
|
|
230
266
|
},
|
|
267
|
+
"video-off-fill": {
|
|
268
|
+
vb: "0 0 24 24",
|
|
269
|
+
d: '<defs><mask id="poolse-cut-video" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24"><rect width="24" height="24" fill="#fff" stroke="none"/><path d="M3.5 3.5 20.5 20.5" stroke="#000" stroke-width="5"/></mask></defs><g mask="url(#poolse-cut-video)"><rect x="2" y="6" width="13.6" height="12" rx="3" fill="currentColor" stroke="none"/><path d="M17.1 10.3 21 7.8a.7.7 0 0 1 1.1.6v7.2a.7.7 0 0 1-1.1.6l-3.9-2.5Z" fill="currentColor" stroke="none"/></g><path d="M3.5 3.5 20.5 20.5"/>'
|
|
270
|
+
},
|
|
231
271
|
webhook: {
|
|
232
272
|
vb: "0 0 24 24",
|
|
233
273
|
d: '<circle cx="6" cy="6" r="2.6"/><circle cx="18" cy="9" r="2.6"/><circle cx="9.5" cy="18" r="2.6"/><path d="M7.9 7.9 12 12l3.7-1.5"/><path d="M11.6 12.7 9.8 16"/>'
|
|
@@ -270,6 +310,47 @@ function PoolseIcon({
|
|
|
270
310
|
}
|
|
271
311
|
);
|
|
272
312
|
}
|
|
313
|
+
function fullscreenElement() {
|
|
314
|
+
return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
|
|
315
|
+
}
|
|
316
|
+
function elementFullscreenEnabled() {
|
|
317
|
+
if (typeof document === "undefined") return false;
|
|
318
|
+
return Boolean(
|
|
319
|
+
document.fullscreenEnabled || document.webkitFullscreenEnabled
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
function useFullscreen(target, fallbackVideo) {
|
|
323
|
+
const [active, setActive] = react.useState(false);
|
|
324
|
+
const [supported, setSupported] = react.useState(false);
|
|
325
|
+
react.useEffect(() => {
|
|
326
|
+
setSupported(elementFullscreenEnabled() || Boolean(fallbackVideo));
|
|
327
|
+
const sync = () => setActive(target.current != null && fullscreenElement() === target.current);
|
|
328
|
+
document.addEventListener("fullscreenchange", sync);
|
|
329
|
+
document.addEventListener("webkitfullscreenchange", sync);
|
|
330
|
+
return () => {
|
|
331
|
+
document.removeEventListener("fullscreenchange", sync);
|
|
332
|
+
document.removeEventListener("webkitfullscreenchange", sync);
|
|
333
|
+
};
|
|
334
|
+
}, [target, fallbackVideo]);
|
|
335
|
+
const toggle = react.useCallback(() => {
|
|
336
|
+
const el = target.current;
|
|
337
|
+
if (!el) return;
|
|
338
|
+
if (fullscreenElement() === el) {
|
|
339
|
+
if (document.exitFullscreen) void document.exitFullscreen().catch(() => {
|
|
340
|
+
});
|
|
341
|
+
else document.webkitExitFullscreen?.();
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
if (elementFullscreenEnabled()) {
|
|
345
|
+
if (el.requestFullscreen) void el.requestFullscreen().catch(() => {
|
|
346
|
+
});
|
|
347
|
+
else el.webkitRequestFullscreen?.();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
fallbackVideo?.current?.webkitEnterFullscreen?.();
|
|
351
|
+
}, [target, fallbackVideo]);
|
|
352
|
+
return { active, supported, toggle };
|
|
353
|
+
}
|
|
273
354
|
|
|
274
355
|
// src/userColor.ts
|
|
275
356
|
var PALETTE = [
|
|
@@ -404,6 +485,8 @@ function ScreenTile({
|
|
|
404
485
|
label
|
|
405
486
|
}) {
|
|
406
487
|
const ref = react.useRef(null);
|
|
488
|
+
const tile = react.useRef(null);
|
|
489
|
+
const fullscreen = useFullscreen(tile, ref);
|
|
407
490
|
const track = participant.screenTrack;
|
|
408
491
|
const name = participant.isSelf ? "Your screen" : `${participant.name ?? label(participant.userId)}'s screen`;
|
|
409
492
|
react.useEffect(() => {
|
|
@@ -414,23 +497,49 @@ function ScreenTile({
|
|
|
414
497
|
track.detach(element);
|
|
415
498
|
};
|
|
416
499
|
}, [track]);
|
|
417
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
500
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
501
|
+
"div",
|
|
502
|
+
{
|
|
503
|
+
ref: tile,
|
|
504
|
+
className: "callpresent__screen",
|
|
505
|
+
onDoubleClick: fullscreen.supported ? fullscreen.toggle : void 0,
|
|
506
|
+
children: [
|
|
507
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
508
|
+
"video",
|
|
509
|
+
{
|
|
510
|
+
ref,
|
|
511
|
+
className: "callgrid__video",
|
|
512
|
+
autoPlay: true,
|
|
513
|
+
playsInline: true,
|
|
514
|
+
muted: true,
|
|
515
|
+
style: { objectFit: "contain" }
|
|
516
|
+
}
|
|
517
|
+
),
|
|
518
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "callgrid__caption", children: [
|
|
519
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "screen-share", size: 13, label: null }),
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "callgrid__name", children: name })
|
|
521
|
+
] }),
|
|
522
|
+
fullscreen.supported && /* @__PURE__ */ jsxRuntime.jsx(
|
|
523
|
+
"button",
|
|
524
|
+
{
|
|
525
|
+
type: "button",
|
|
526
|
+
className: "callpresent__fullscreen",
|
|
527
|
+
onClick: fullscreen.toggle,
|
|
528
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
529
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
531
|
+
PoolseIcon,
|
|
532
|
+
{
|
|
533
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
534
|
+
size: 18,
|
|
535
|
+
label: null
|
|
536
|
+
}
|
|
537
|
+
)
|
|
538
|
+
}
|
|
539
|
+
)
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
);
|
|
434
543
|
}
|
|
435
544
|
function FloatingSelf({
|
|
436
545
|
children,
|
|
@@ -500,6 +609,7 @@ function CallControlButton({
|
|
|
500
609
|
label,
|
|
501
610
|
onClick,
|
|
502
611
|
active = false,
|
|
612
|
+
highlight = false,
|
|
503
613
|
tone = "neutral",
|
|
504
614
|
large = false,
|
|
505
615
|
disabled = false,
|
|
@@ -510,37 +620,46 @@ function CallControlButton({
|
|
|
510
620
|
"callbtn",
|
|
511
621
|
tone !== "neutral" ? `callbtn--${tone}` : "",
|
|
512
622
|
active ? "callbtn--active" : "",
|
|
623
|
+
highlight ? "callbtn--highlight" : "",
|
|
513
624
|
large ? "callbtn--large" : ""
|
|
514
625
|
].filter(Boolean).join(" ");
|
|
515
626
|
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callbtn__slot", children: [
|
|
516
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
627
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
628
|
+
"span",
|
|
629
|
+
{
|
|
630
|
+
className: `callbtn__wrap${hasMenu ? " callbtn__wrap--menu" : ""}${active ? " callbtn__wrap--active" : ""}`,
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
633
|
+
"button",
|
|
634
|
+
{
|
|
635
|
+
type: "button",
|
|
636
|
+
className: classes,
|
|
637
|
+
onClick,
|
|
638
|
+
disabled,
|
|
639
|
+
"aria-pressed": tone === "neutral" ? active || highlight : void 0,
|
|
640
|
+
"aria-label": label,
|
|
641
|
+
title: label,
|
|
642
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: icon, size: large ? 26 : 22, label: null })
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
hasMenu && // A separate hit target, not a long-press: the toggle and the
|
|
646
|
+
// device list are different actions, and hiding one inside a
|
|
647
|
+
// timed gesture on the other is how people end up muting
|
|
648
|
+
// themselves while trying to change microphone.
|
|
649
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
650
|
+
"button",
|
|
651
|
+
{
|
|
652
|
+
type: "button",
|
|
653
|
+
className: "callbtn__caret",
|
|
654
|
+
onClick: onMenuClick,
|
|
655
|
+
"aria-label": `${label} options`,
|
|
656
|
+
title: `${label} options`,
|
|
657
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "chevron-up", size: 13, label: null })
|
|
658
|
+
}
|
|
659
|
+
)
|
|
660
|
+
]
|
|
661
|
+
}
|
|
662
|
+
),
|
|
544
663
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "callbtn__label", children: label })
|
|
545
664
|
] });
|
|
546
665
|
}
|
|
@@ -3556,6 +3675,8 @@ function RoomJoinBar({ room, allowStart = true }) {
|
|
|
3556
3675
|
}
|
|
3557
3676
|
function RoomStage({ room, title, labelFor, className }) {
|
|
3558
3677
|
const media = room.media;
|
|
3678
|
+
const stage = react.useRef(null);
|
|
3679
|
+
const fullscreen = useFullscreen(stage);
|
|
3559
3680
|
const [menu, setMenu] = react.useState(null);
|
|
3560
3681
|
const elapsed = useElapsed(room.live?.started_at ?? null, media.status === "connected");
|
|
3561
3682
|
const openMenu = react.useCallback(
|
|
@@ -3567,115 +3688,150 @@ function RoomStage({ room, title, labelFor, className }) {
|
|
|
3567
3688
|
);
|
|
3568
3689
|
const count = media.participants.length;
|
|
3569
3690
|
const canShare = media.canShareScreen && room.live?.screen_share_allowed !== false;
|
|
3570
|
-
const
|
|
3571
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
}
|
|
3612
|
-
)
|
|
3613
|
-
] }),
|
|
3614
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callsheet__control", children: [
|
|
3615
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3616
|
-
CallControlButton,
|
|
3617
|
-
{
|
|
3618
|
-
icon: media.cameraEnabled ? "video" : "video-off",
|
|
3619
|
-
active: !media.cameraEnabled,
|
|
3620
|
-
label: media.cameraEnabled ? "Camera" : "Camera off",
|
|
3621
|
-
onClick: () => void media.toggleCamera(),
|
|
3622
|
-
disabled: media.devices.videoinput.length === 0 && !media.cameraEnabled,
|
|
3623
|
-
hasMenu: media.devices.videoinput.length > 0,
|
|
3624
|
-
onMenuClick: () => openMenu("videoinput")
|
|
3625
|
-
}
|
|
3626
|
-
),
|
|
3627
|
-
menu === "videoinput" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3628
|
-
CallDeviceMenu,
|
|
3629
|
-
{
|
|
3630
|
-
title: "Camera",
|
|
3631
|
-
devices: media.devices.videoinput,
|
|
3632
|
-
activeId: media.activeDevices.videoinput,
|
|
3633
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3634
|
-
onClose: () => setMenu(null)
|
|
3635
|
-
}
|
|
3636
|
-
)
|
|
3637
|
-
] }),
|
|
3638
|
-
(canShare || media.screenSharing) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3639
|
-
CallControlButton,
|
|
3640
|
-
{
|
|
3641
|
-
icon: media.screenSharing ? "screen-share-off" : "screen-share",
|
|
3642
|
-
active: media.screenSharing,
|
|
3643
|
-
label: media.screenSharing ? "Stop sharing" : "Share screen",
|
|
3644
|
-
onClick: () => void media.toggleScreenShare()
|
|
3645
|
-
}
|
|
3646
|
-
),
|
|
3647
|
-
media.devices.audiooutput.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callsheet__control", children: [
|
|
3648
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3649
|
-
CallControlButton,
|
|
3650
|
-
{
|
|
3651
|
-
icon: "speaker",
|
|
3652
|
-
label: "Speaker",
|
|
3653
|
-
onClick: () => openMenu("audiooutput")
|
|
3654
|
-
}
|
|
3655
|
-
),
|
|
3656
|
-
menu === "audiooutput" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3657
|
-
CallDeviceMenu,
|
|
3691
|
+
const connecting = media.status === "connecting" || room.joining;
|
|
3692
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3693
|
+
"section",
|
|
3694
|
+
{
|
|
3695
|
+
ref: stage,
|
|
3696
|
+
className: ["poolse-room", className].filter(Boolean).join(" "),
|
|
3697
|
+
"aria-label": "Room",
|
|
3698
|
+
children: [
|
|
3699
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "poolse-room__head", children: [
|
|
3700
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-room__title", children: title ?? "Room" }),
|
|
3701
|
+
connecting ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-room__status", children: "Connecting\u2026" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "poolse-room__status", children: [
|
|
3702
|
+
elapsed && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "poolse-room__chip poolse-room__chip--live", children: [
|
|
3703
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "poolse-room__dot", "aria-hidden": "true" }),
|
|
3704
|
+
elapsed
|
|
3705
|
+
] }),
|
|
3706
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "poolse-room__chip", "aria-label": `${count} in the room`, children: [
|
|
3707
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "users", size: 14, label: null }),
|
|
3708
|
+
count
|
|
3709
|
+
] })
|
|
3710
|
+
] }),
|
|
3711
|
+
fullscreen.supported && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3712
|
+
"button",
|
|
3713
|
+
{
|
|
3714
|
+
type: "button",
|
|
3715
|
+
className: "poolse-room__fullscreen",
|
|
3716
|
+
onClick: fullscreen.toggle,
|
|
3717
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3718
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3719
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3720
|
+
PoolseIcon,
|
|
3721
|
+
{
|
|
3722
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
3723
|
+
size: 17,
|
|
3724
|
+
label: null
|
|
3725
|
+
}
|
|
3726
|
+
)
|
|
3727
|
+
}
|
|
3728
|
+
)
|
|
3729
|
+
] }),
|
|
3730
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-room__stage", children: count > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3731
|
+
CallVideoGrid,
|
|
3658
3732
|
{
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3663
|
-
onClose: () => setMenu(null)
|
|
3733
|
+
participants: media.participants,
|
|
3734
|
+
...labelFor ? { labelFor } : {},
|
|
3735
|
+
onLocalClick: media.cameraEnabled ? () => void media.switchCamera() : void 0
|
|
3664
3736
|
}
|
|
3665
|
-
)
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3737
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "poolse-room__waiting", children: "Connecting\u2026" }) }),
|
|
3738
|
+
media.screenSharing && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-room__sharing", role: "status", children: [
|
|
3739
|
+
/* @__PURE__ */ jsxRuntime.jsx(PoolseIcon, { name: "screen-share", size: 15, label: null }),
|
|
3740
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "You are sharing your screen" }),
|
|
3741
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => void media.setScreenShareEnabled(false), children: "Stop sharing" })
|
|
3742
|
+
] }),
|
|
3743
|
+
room.error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "poolse-room__error", children: room.error.message }),
|
|
3744
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "poolse-room__bar", children: [
|
|
3745
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callsheet__control", children: [
|
|
3746
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3747
|
+
CallControlButton,
|
|
3748
|
+
{
|
|
3749
|
+
icon: media.micEnabled ? "mic-fill" : "mic-off-fill",
|
|
3750
|
+
active: !media.micEnabled,
|
|
3751
|
+
label: media.micEnabled ? "Mute" : "Unmute",
|
|
3752
|
+
onClick: () => void media.toggleMic(),
|
|
3753
|
+
hasMenu: media.devices.audioinput.length > 0,
|
|
3754
|
+
onMenuClick: () => openMenu("audioinput")
|
|
3755
|
+
}
|
|
3756
|
+
),
|
|
3757
|
+
menu === "audioinput" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3758
|
+
CallDeviceMenu,
|
|
3759
|
+
{
|
|
3760
|
+
title: "Microphone",
|
|
3761
|
+
devices: media.devices.audioinput,
|
|
3762
|
+
activeId: media.activeDevices.audioinput,
|
|
3763
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3764
|
+
onClose: () => setMenu(null)
|
|
3765
|
+
}
|
|
3766
|
+
)
|
|
3767
|
+
] }),
|
|
3768
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callsheet__control", children: [
|
|
3769
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3770
|
+
CallControlButton,
|
|
3771
|
+
{
|
|
3772
|
+
icon: media.cameraEnabled ? "video-fill" : "video-off-fill",
|
|
3773
|
+
active: !media.cameraEnabled,
|
|
3774
|
+
label: media.cameraEnabled ? "Camera" : "Camera off",
|
|
3775
|
+
onClick: () => void media.toggleCamera(),
|
|
3776
|
+
disabled: media.devices.videoinput.length === 0 && !media.cameraEnabled,
|
|
3777
|
+
hasMenu: media.devices.videoinput.length > 0,
|
|
3778
|
+
onMenuClick: () => openMenu("videoinput")
|
|
3779
|
+
}
|
|
3780
|
+
),
|
|
3781
|
+
menu === "videoinput" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3782
|
+
CallDeviceMenu,
|
|
3783
|
+
{
|
|
3784
|
+
title: "Camera",
|
|
3785
|
+
devices: media.devices.videoinput,
|
|
3786
|
+
activeId: media.activeDevices.videoinput,
|
|
3787
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3788
|
+
onClose: () => setMenu(null)
|
|
3789
|
+
}
|
|
3790
|
+
)
|
|
3791
|
+
] }),
|
|
3792
|
+
(canShare || media.screenSharing) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
+
CallControlButton,
|
|
3794
|
+
{
|
|
3795
|
+
icon: media.screenSharing ? "screen-share-off-fill" : "screen-share-fill",
|
|
3796
|
+
highlight: media.screenSharing,
|
|
3797
|
+
label: media.screenSharing ? "Stop sharing" : "Share screen",
|
|
3798
|
+
onClick: () => void media.toggleScreenShare()
|
|
3799
|
+
}
|
|
3800
|
+
),
|
|
3801
|
+
media.devices.audiooutput.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "callsheet__control", children: [
|
|
3802
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3803
|
+
CallControlButton,
|
|
3804
|
+
{
|
|
3805
|
+
icon: "speaker-fill",
|
|
3806
|
+
label: "Speaker",
|
|
3807
|
+
onClick: () => openMenu("audiooutput")
|
|
3808
|
+
}
|
|
3809
|
+
),
|
|
3810
|
+
menu === "audiooutput" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3811
|
+
CallDeviceMenu,
|
|
3812
|
+
{
|
|
3813
|
+
title: "Speaker",
|
|
3814
|
+
devices: media.devices.audiooutput,
|
|
3815
|
+
activeId: media.activeDevices.audiooutput,
|
|
3816
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3817
|
+
onClose: () => setMenu(null)
|
|
3818
|
+
}
|
|
3819
|
+
)
|
|
3820
|
+
] }),
|
|
3821
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3822
|
+
CallControlButton,
|
|
3823
|
+
{
|
|
3824
|
+
icon: "phone-off-fill",
|
|
3825
|
+
tone: "danger",
|
|
3826
|
+
large: true,
|
|
3827
|
+
label: "Leave",
|
|
3828
|
+
onClick: room.leave
|
|
3829
|
+
}
|
|
3830
|
+
)
|
|
3831
|
+
] })
|
|
3832
|
+
]
|
|
3833
|
+
}
|
|
3834
|
+
);
|
|
3679
3835
|
}
|
|
3680
3836
|
function useElapsed(startedAt, running) {
|
|
3681
3837
|
const [, tick] = react.useState(0);
|