@poolse/react-ui 3.2.0-dev.2 → 3.2.0-dev.3
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 +11 -0
- package/dist/index.cjs +228 -123
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +228 -123
- package/dist/index.js.map +1 -1
- package/dist/styles.css +60 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -78,6 +78,14 @@ declare const ICONS: {
|
|
|
78
78
|
readonly vb: "0 0 24 24";
|
|
79
79
|
readonly 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\"/>";
|
|
80
80
|
};
|
|
81
|
+
readonly fullscreen: {
|
|
82
|
+
readonly vb: "0 0 24 24";
|
|
83
|
+
readonly 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\"/>";
|
|
84
|
+
};
|
|
85
|
+
readonly 'fullscreen-exit': {
|
|
86
|
+
readonly vb: "0 0 24 24";
|
|
87
|
+
readonly 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\"/>";
|
|
88
|
+
};
|
|
81
89
|
readonly headphones: {
|
|
82
90
|
readonly vb: "0 0 24 24";
|
|
83
91
|
readonly 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\"/>";
|
|
@@ -234,7 +242,7 @@ declare const ICONS: {
|
|
|
234
242
|
type IconName = keyof typeof ICONS;
|
|
235
243
|
|
|
236
244
|
interface PoolseIconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {
|
|
237
|
-
/** Icon name — see {@link IconName} for the full list of
|
|
245
|
+
/** Icon name — see {@link IconName} for the full list of 45 icons. */
|
|
238
246
|
name: IconName;
|
|
239
247
|
/** Width + height in pixels. Defaults to `1.2em` so the icon scales with surrounding text. */
|
|
240
248
|
size?: number | string;
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,14 @@ declare const ICONS: {
|
|
|
78
78
|
readonly vb: "0 0 24 24";
|
|
79
79
|
readonly 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\"/>";
|
|
80
80
|
};
|
|
81
|
+
readonly fullscreen: {
|
|
82
|
+
readonly vb: "0 0 24 24";
|
|
83
|
+
readonly 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\"/>";
|
|
84
|
+
};
|
|
85
|
+
readonly 'fullscreen-exit': {
|
|
86
|
+
readonly vb: "0 0 24 24";
|
|
87
|
+
readonly 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\"/>";
|
|
88
|
+
};
|
|
81
89
|
readonly headphones: {
|
|
82
90
|
readonly vb: "0 0 24 24";
|
|
83
91
|
readonly 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\"/>";
|
|
@@ -234,7 +242,7 @@ declare const ICONS: {
|
|
|
234
242
|
type IconName = keyof typeof ICONS;
|
|
235
243
|
|
|
236
244
|
interface PoolseIconProps extends Omit<SVGProps<SVGSVGElement>, 'children'> {
|
|
237
|
-
/** Icon name — see {@link IconName} for the full list of
|
|
245
|
+
/** Icon name — see {@link IconName} for the full list of 45 icons. */
|
|
238
246
|
name: IconName;
|
|
239
247
|
/** Width + height in pixels. Defaults to `1.2em` so the icon scales with surrounding text. */
|
|
240
248
|
size?: number | string;
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,14 @@ var ICONS = {
|
|
|
73
73
|
vb: "0 0 24 24",
|
|
74
74
|
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"/>'
|
|
75
75
|
},
|
|
76
|
+
fullscreen: {
|
|
77
|
+
vb: "0 0 24 24",
|
|
78
|
+
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"/>'
|
|
79
|
+
},
|
|
80
|
+
"fullscreen-exit": {
|
|
81
|
+
vb: "0 0 24 24",
|
|
82
|
+
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"/>'
|
|
83
|
+
},
|
|
76
84
|
headphones: {
|
|
77
85
|
vb: "0 0 24 24",
|
|
78
86
|
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"/>'
|
|
@@ -263,6 +271,47 @@ function PoolseIcon({
|
|
|
263
271
|
}
|
|
264
272
|
);
|
|
265
273
|
}
|
|
274
|
+
function fullscreenElement() {
|
|
275
|
+
return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
|
|
276
|
+
}
|
|
277
|
+
function elementFullscreenEnabled() {
|
|
278
|
+
if (typeof document === "undefined") return false;
|
|
279
|
+
return Boolean(
|
|
280
|
+
document.fullscreenEnabled || document.webkitFullscreenEnabled
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
function useFullscreen(target, fallbackVideo) {
|
|
284
|
+
const [active, setActive] = useState(false);
|
|
285
|
+
const [supported, setSupported] = useState(false);
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
setSupported(elementFullscreenEnabled() || Boolean(fallbackVideo));
|
|
288
|
+
const sync = () => setActive(target.current != null && fullscreenElement() === target.current);
|
|
289
|
+
document.addEventListener("fullscreenchange", sync);
|
|
290
|
+
document.addEventListener("webkitfullscreenchange", sync);
|
|
291
|
+
return () => {
|
|
292
|
+
document.removeEventListener("fullscreenchange", sync);
|
|
293
|
+
document.removeEventListener("webkitfullscreenchange", sync);
|
|
294
|
+
};
|
|
295
|
+
}, [target, fallbackVideo]);
|
|
296
|
+
const toggle = useCallback(() => {
|
|
297
|
+
const el = target.current;
|
|
298
|
+
if (!el) return;
|
|
299
|
+
if (fullscreenElement() === el) {
|
|
300
|
+
if (document.exitFullscreen) void document.exitFullscreen().catch(() => {
|
|
301
|
+
});
|
|
302
|
+
else document.webkitExitFullscreen?.();
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (elementFullscreenEnabled()) {
|
|
306
|
+
if (el.requestFullscreen) void el.requestFullscreen().catch(() => {
|
|
307
|
+
});
|
|
308
|
+
else el.webkitRequestFullscreen?.();
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
fallbackVideo?.current?.webkitEnterFullscreen?.();
|
|
312
|
+
}, [target, fallbackVideo]);
|
|
313
|
+
return { active, supported, toggle };
|
|
314
|
+
}
|
|
266
315
|
|
|
267
316
|
// src/userColor.ts
|
|
268
317
|
var PALETTE = [
|
|
@@ -397,6 +446,8 @@ function ScreenTile({
|
|
|
397
446
|
label
|
|
398
447
|
}) {
|
|
399
448
|
const ref = useRef(null);
|
|
449
|
+
const tile = useRef(null);
|
|
450
|
+
const fullscreen = useFullscreen(tile, ref);
|
|
400
451
|
const track = participant.screenTrack;
|
|
401
452
|
const name = participant.isSelf ? "Your screen" : `${participant.name ?? label(participant.userId)}'s screen`;
|
|
402
453
|
useEffect(() => {
|
|
@@ -407,23 +458,49 @@ function ScreenTile({
|
|
|
407
458
|
track.detach(element);
|
|
408
459
|
};
|
|
409
460
|
}, [track]);
|
|
410
|
-
return /* @__PURE__ */ jsxs(
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
461
|
+
return /* @__PURE__ */ jsxs(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
ref: tile,
|
|
465
|
+
className: "callpresent__screen",
|
|
466
|
+
onDoubleClick: fullscreen.supported ? fullscreen.toggle : void 0,
|
|
467
|
+
children: [
|
|
468
|
+
/* @__PURE__ */ jsx(
|
|
469
|
+
"video",
|
|
470
|
+
{
|
|
471
|
+
ref,
|
|
472
|
+
className: "callgrid__video",
|
|
473
|
+
autoPlay: true,
|
|
474
|
+
playsInline: true,
|
|
475
|
+
muted: true,
|
|
476
|
+
style: { objectFit: "contain" }
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
/* @__PURE__ */ jsxs("div", { className: "callgrid__caption", children: [
|
|
480
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: "screen-share", size: 13, label: null }),
|
|
481
|
+
/* @__PURE__ */ jsx("span", { className: "callgrid__name", children: name })
|
|
482
|
+
] }),
|
|
483
|
+
fullscreen.supported && /* @__PURE__ */ jsx(
|
|
484
|
+
"button",
|
|
485
|
+
{
|
|
486
|
+
type: "button",
|
|
487
|
+
className: "callpresent__fullscreen",
|
|
488
|
+
onClick: fullscreen.toggle,
|
|
489
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
490
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
491
|
+
children: /* @__PURE__ */ jsx(
|
|
492
|
+
PoolseIcon,
|
|
493
|
+
{
|
|
494
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
495
|
+
size: 18,
|
|
496
|
+
label: null
|
|
497
|
+
}
|
|
498
|
+
)
|
|
499
|
+
}
|
|
500
|
+
)
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
);
|
|
427
504
|
}
|
|
428
505
|
function FloatingSelf({
|
|
429
506
|
children,
|
|
@@ -3549,6 +3626,8 @@ function RoomJoinBar({ room, allowStart = true }) {
|
|
|
3549
3626
|
}
|
|
3550
3627
|
function RoomStage({ room, title, labelFor, className }) {
|
|
3551
3628
|
const media = room.media;
|
|
3629
|
+
const stage = useRef(null);
|
|
3630
|
+
const fullscreen = useFullscreen(stage);
|
|
3552
3631
|
const [menu, setMenu] = useState(null);
|
|
3553
3632
|
const elapsed = useElapsed(room.live?.started_at ?? null, media.status === "connected");
|
|
3554
3633
|
const openMenu = useCallback(
|
|
@@ -3561,114 +3640,140 @@ function RoomStage({ room, title, labelFor, className }) {
|
|
|
3561
3640
|
const count = media.participants.length;
|
|
3562
3641
|
const canShare = media.canShareScreen && room.live?.screen_share_allowed !== false;
|
|
3563
3642
|
const status = media.status === "connecting" || room.joining ? "Connecting\u2026" : `${count} in the room${elapsed ? ` \xB7 ${elapsed}` : ""}`;
|
|
3564
|
-
return /* @__PURE__ */ jsxs(
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
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
|
-
menu === "audioinput" && /* @__PURE__ */ jsx(
|
|
3597
|
-
CallDeviceMenu,
|
|
3598
|
-
{
|
|
3599
|
-
title: "Microphone",
|
|
3600
|
-
devices: media.devices.audioinput,
|
|
3601
|
-
activeId: media.activeDevices.audioinput,
|
|
3602
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3603
|
-
onClose: () => setMenu(null)
|
|
3604
|
-
}
|
|
3605
|
-
)
|
|
3606
|
-
] }),
|
|
3607
|
-
/* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3608
|
-
/* @__PURE__ */ jsx(
|
|
3609
|
-
CallControlButton,
|
|
3610
|
-
{
|
|
3611
|
-
icon: media.cameraEnabled ? "video" : "video-off",
|
|
3612
|
-
active: !media.cameraEnabled,
|
|
3613
|
-
label: media.cameraEnabled ? "Camera" : "Camera off",
|
|
3614
|
-
onClick: () => void media.toggleCamera(),
|
|
3615
|
-
disabled: media.devices.videoinput.length === 0 && !media.cameraEnabled,
|
|
3616
|
-
hasMenu: media.devices.videoinput.length > 0,
|
|
3617
|
-
onMenuClick: () => openMenu("videoinput")
|
|
3618
|
-
}
|
|
3619
|
-
),
|
|
3620
|
-
menu === "videoinput" && /* @__PURE__ */ jsx(
|
|
3621
|
-
CallDeviceMenu,
|
|
3622
|
-
{
|
|
3623
|
-
title: "Camera",
|
|
3624
|
-
devices: media.devices.videoinput,
|
|
3625
|
-
activeId: media.activeDevices.videoinput,
|
|
3626
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3627
|
-
onClose: () => setMenu(null)
|
|
3628
|
-
}
|
|
3629
|
-
)
|
|
3630
|
-
] }),
|
|
3631
|
-
(canShare || media.screenSharing) && /* @__PURE__ */ jsx(
|
|
3632
|
-
CallControlButton,
|
|
3633
|
-
{
|
|
3634
|
-
icon: media.screenSharing ? "screen-share-off" : "screen-share",
|
|
3635
|
-
active: media.screenSharing,
|
|
3636
|
-
label: media.screenSharing ? "Stop sharing" : "Share screen",
|
|
3637
|
-
onClick: () => void media.toggleScreenShare()
|
|
3638
|
-
}
|
|
3639
|
-
),
|
|
3640
|
-
media.devices.audiooutput.length > 0 && /* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3641
|
-
/* @__PURE__ */ jsx(
|
|
3642
|
-
CallControlButton,
|
|
3643
|
-
{
|
|
3644
|
-
icon: "speaker",
|
|
3645
|
-
label: "Speaker",
|
|
3646
|
-
onClick: () => openMenu("audiooutput")
|
|
3647
|
-
}
|
|
3648
|
-
),
|
|
3649
|
-
menu === "audiooutput" && /* @__PURE__ */ jsx(
|
|
3650
|
-
CallDeviceMenu,
|
|
3643
|
+
return /* @__PURE__ */ jsxs(
|
|
3644
|
+
"section",
|
|
3645
|
+
{
|
|
3646
|
+
ref: stage,
|
|
3647
|
+
className: ["poolse-room", className].filter(Boolean).join(" "),
|
|
3648
|
+
"aria-label": "Room",
|
|
3649
|
+
children: [
|
|
3650
|
+
/* @__PURE__ */ jsxs("header", { className: "poolse-room__head", children: [
|
|
3651
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-room__title", children: title ?? "Room" }),
|
|
3652
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-room__status", children: status }),
|
|
3653
|
+
fullscreen.supported && /* @__PURE__ */ jsx(
|
|
3654
|
+
"button",
|
|
3655
|
+
{
|
|
3656
|
+
type: "button",
|
|
3657
|
+
className: "poolse-room__fullscreen",
|
|
3658
|
+
onClick: fullscreen.toggle,
|
|
3659
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3660
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3661
|
+
children: /* @__PURE__ */ jsx(
|
|
3662
|
+
PoolseIcon,
|
|
3663
|
+
{
|
|
3664
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
3665
|
+
size: 17,
|
|
3666
|
+
label: null
|
|
3667
|
+
}
|
|
3668
|
+
)
|
|
3669
|
+
}
|
|
3670
|
+
)
|
|
3671
|
+
] }),
|
|
3672
|
+
/* @__PURE__ */ jsx("div", { className: "poolse-room__stage", children: count > 0 ? /* @__PURE__ */ jsx(
|
|
3673
|
+
CallVideoGrid,
|
|
3651
3674
|
{
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3656
|
-
onClose: () => setMenu(null)
|
|
3675
|
+
participants: media.participants,
|
|
3676
|
+
...labelFor ? { labelFor } : {},
|
|
3677
|
+
onLocalClick: media.cameraEnabled ? () => void media.switchCamera() : void 0
|
|
3657
3678
|
}
|
|
3658
|
-
)
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3679
|
+
) : /* @__PURE__ */ jsx("div", { className: "poolse-room__waiting", children: "Connecting\u2026" }) }),
|
|
3680
|
+
media.screenSharing && /* @__PURE__ */ jsxs("div", { className: "poolse-room__sharing", role: "status", children: [
|
|
3681
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: "screen-share", size: 15, label: null }),
|
|
3682
|
+
/* @__PURE__ */ jsx("span", { children: "You are sharing your screen" }),
|
|
3683
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => void media.setScreenShareEnabled(false), children: "Stop sharing" })
|
|
3684
|
+
] }),
|
|
3685
|
+
room.error && /* @__PURE__ */ jsx("p", { className: "poolse-room__error", children: room.error.message }),
|
|
3686
|
+
/* @__PURE__ */ jsxs("div", { className: "poolse-room__bar", children: [
|
|
3687
|
+
/* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3688
|
+
/* @__PURE__ */ jsx(
|
|
3689
|
+
CallControlButton,
|
|
3690
|
+
{
|
|
3691
|
+
icon: media.micEnabled ? "mic" : "mic-off",
|
|
3692
|
+
active: !media.micEnabled,
|
|
3693
|
+
label: media.micEnabled ? "Mute" : "Unmute",
|
|
3694
|
+
onClick: () => void media.toggleMic(),
|
|
3695
|
+
hasMenu: media.devices.audioinput.length > 0,
|
|
3696
|
+
onMenuClick: () => openMenu("audioinput")
|
|
3697
|
+
}
|
|
3698
|
+
),
|
|
3699
|
+
menu === "audioinput" && /* @__PURE__ */ jsx(
|
|
3700
|
+
CallDeviceMenu,
|
|
3701
|
+
{
|
|
3702
|
+
title: "Microphone",
|
|
3703
|
+
devices: media.devices.audioinput,
|
|
3704
|
+
activeId: media.activeDevices.audioinput,
|
|
3705
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3706
|
+
onClose: () => setMenu(null)
|
|
3707
|
+
}
|
|
3708
|
+
)
|
|
3709
|
+
] }),
|
|
3710
|
+
/* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3711
|
+
/* @__PURE__ */ jsx(
|
|
3712
|
+
CallControlButton,
|
|
3713
|
+
{
|
|
3714
|
+
icon: media.cameraEnabled ? "video" : "video-off",
|
|
3715
|
+
active: !media.cameraEnabled,
|
|
3716
|
+
label: media.cameraEnabled ? "Camera" : "Camera off",
|
|
3717
|
+
onClick: () => void media.toggleCamera(),
|
|
3718
|
+
disabled: media.devices.videoinput.length === 0 && !media.cameraEnabled,
|
|
3719
|
+
hasMenu: media.devices.videoinput.length > 0,
|
|
3720
|
+
onMenuClick: () => openMenu("videoinput")
|
|
3721
|
+
}
|
|
3722
|
+
),
|
|
3723
|
+
menu === "videoinput" && /* @__PURE__ */ jsx(
|
|
3724
|
+
CallDeviceMenu,
|
|
3725
|
+
{
|
|
3726
|
+
title: "Camera",
|
|
3727
|
+
devices: media.devices.videoinput,
|
|
3728
|
+
activeId: media.activeDevices.videoinput,
|
|
3729
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3730
|
+
onClose: () => setMenu(null)
|
|
3731
|
+
}
|
|
3732
|
+
)
|
|
3733
|
+
] }),
|
|
3734
|
+
(canShare || media.screenSharing) && /* @__PURE__ */ jsx(
|
|
3735
|
+
CallControlButton,
|
|
3736
|
+
{
|
|
3737
|
+
icon: media.screenSharing ? "screen-share-off" : "screen-share",
|
|
3738
|
+
active: media.screenSharing,
|
|
3739
|
+
label: media.screenSharing ? "Stop sharing" : "Share screen",
|
|
3740
|
+
onClick: () => void media.toggleScreenShare()
|
|
3741
|
+
}
|
|
3742
|
+
),
|
|
3743
|
+
media.devices.audiooutput.length > 0 && /* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3744
|
+
/* @__PURE__ */ jsx(
|
|
3745
|
+
CallControlButton,
|
|
3746
|
+
{
|
|
3747
|
+
icon: "speaker",
|
|
3748
|
+
label: "Speaker",
|
|
3749
|
+
onClick: () => openMenu("audiooutput")
|
|
3750
|
+
}
|
|
3751
|
+
),
|
|
3752
|
+
menu === "audiooutput" && /* @__PURE__ */ jsx(
|
|
3753
|
+
CallDeviceMenu,
|
|
3754
|
+
{
|
|
3755
|
+
title: "Speaker",
|
|
3756
|
+
devices: media.devices.audiooutput,
|
|
3757
|
+
activeId: media.activeDevices.audiooutput,
|
|
3758
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3759
|
+
onClose: () => setMenu(null)
|
|
3760
|
+
}
|
|
3761
|
+
)
|
|
3762
|
+
] }),
|
|
3763
|
+
/* @__PURE__ */ jsx(
|
|
3764
|
+
CallControlButton,
|
|
3765
|
+
{
|
|
3766
|
+
icon: "phone-off",
|
|
3767
|
+
tone: "danger",
|
|
3768
|
+
large: true,
|
|
3769
|
+
label: "Leave",
|
|
3770
|
+
onClick: room.leave
|
|
3771
|
+
}
|
|
3772
|
+
)
|
|
3773
|
+
] })
|
|
3774
|
+
]
|
|
3775
|
+
}
|
|
3776
|
+
);
|
|
3672
3777
|
}
|
|
3673
3778
|
function useElapsed(startedAt, running) {
|
|
3674
3779
|
const [, tick] = useState(0);
|