@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/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"/>'
|
|
@@ -113,10 +121,18 @@ var ICONS = {
|
|
|
113
121
|
vb: "0 0 24 24",
|
|
114
122
|
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"/>'
|
|
115
123
|
},
|
|
124
|
+
"mic-fill": {
|
|
125
|
+
vb: "0 0 24 24",
|
|
126
|
+
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"/>'
|
|
127
|
+
},
|
|
116
128
|
"mic-off": {
|
|
117
129
|
vb: "0 0 24 24",
|
|
118
130
|
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"/>'
|
|
119
131
|
},
|
|
132
|
+
"mic-off-fill": {
|
|
133
|
+
vb: "0 0 24 24",
|
|
134
|
+
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"/>'
|
|
135
|
+
},
|
|
120
136
|
"more-h": {
|
|
121
137
|
vb: "0 0 24 24",
|
|
122
138
|
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"/>'
|
|
@@ -133,6 +149,10 @@ var ICONS = {
|
|
|
133
149
|
vb: "0 0 24 24",
|
|
134
150
|
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>'
|
|
135
151
|
},
|
|
152
|
+
"phone-off-fill": {
|
|
153
|
+
vb: "0 0 24 24",
|
|
154
|
+
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>'
|
|
155
|
+
},
|
|
136
156
|
pin: {
|
|
137
157
|
vb: "0 0 24 24",
|
|
138
158
|
d: '<path d="M9 3.4h6v1.8l-1 5.6 3 3.2H7l3-3.2-1-5.6V3.4Z"/><path d="M12 17v3.6"/>'
|
|
@@ -157,10 +177,18 @@ var ICONS = {
|
|
|
157
177
|
vb: "0 0 24 24",
|
|
158
178
|
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"/>'
|
|
159
179
|
},
|
|
180
|
+
"screen-share-fill": {
|
|
181
|
+
vb: "0 0 24 24",
|
|
182
|
+
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>'
|
|
183
|
+
},
|
|
160
184
|
"screen-share-off": {
|
|
161
185
|
vb: "0 0 24 24",
|
|
162
186
|
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"/>'
|
|
163
187
|
},
|
|
188
|
+
"screen-share-off-fill": {
|
|
189
|
+
vb: "0 0 24 24",
|
|
190
|
+
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>'
|
|
191
|
+
},
|
|
164
192
|
search: {
|
|
165
193
|
vb: "0 0 24 24",
|
|
166
194
|
d: '<circle cx="11" cy="11" r="6.8"/><path d="M20.8 20.8 16 16"/>'
|
|
@@ -185,6 +213,10 @@ var ICONS = {
|
|
|
185
213
|
vb: "0 0 24 24",
|
|
186
214
|
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"/>'
|
|
187
215
|
},
|
|
216
|
+
"speaker-fill": {
|
|
217
|
+
vb: "0 0 24 24",
|
|
218
|
+
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"/>'
|
|
219
|
+
},
|
|
188
220
|
"speaker-off": {
|
|
189
221
|
vb: "0 0 24 24",
|
|
190
222
|
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"/>'
|
|
@@ -217,10 +249,18 @@ var ICONS = {
|
|
|
217
249
|
vb: "0 0 24 24",
|
|
218
250
|
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"/>'
|
|
219
251
|
},
|
|
252
|
+
"video-fill": {
|
|
253
|
+
vb: "0 0 24 24",
|
|
254
|
+
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"/>'
|
|
255
|
+
},
|
|
220
256
|
"video-off": {
|
|
221
257
|
vb: "0 0 24 24",
|
|
222
258
|
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"/>'
|
|
223
259
|
},
|
|
260
|
+
"video-off-fill": {
|
|
261
|
+
vb: "0 0 24 24",
|
|
262
|
+
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"/>'
|
|
263
|
+
},
|
|
224
264
|
webhook: {
|
|
225
265
|
vb: "0 0 24 24",
|
|
226
266
|
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"/>'
|
|
@@ -263,6 +303,47 @@ function PoolseIcon({
|
|
|
263
303
|
}
|
|
264
304
|
);
|
|
265
305
|
}
|
|
306
|
+
function fullscreenElement() {
|
|
307
|
+
return document.fullscreenElement ?? document.webkitFullscreenElement ?? null;
|
|
308
|
+
}
|
|
309
|
+
function elementFullscreenEnabled() {
|
|
310
|
+
if (typeof document === "undefined") return false;
|
|
311
|
+
return Boolean(
|
|
312
|
+
document.fullscreenEnabled || document.webkitFullscreenEnabled
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
function useFullscreen(target, fallbackVideo) {
|
|
316
|
+
const [active, setActive] = useState(false);
|
|
317
|
+
const [supported, setSupported] = useState(false);
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
setSupported(elementFullscreenEnabled() || Boolean(fallbackVideo));
|
|
320
|
+
const sync = () => setActive(target.current != null && fullscreenElement() === target.current);
|
|
321
|
+
document.addEventListener("fullscreenchange", sync);
|
|
322
|
+
document.addEventListener("webkitfullscreenchange", sync);
|
|
323
|
+
return () => {
|
|
324
|
+
document.removeEventListener("fullscreenchange", sync);
|
|
325
|
+
document.removeEventListener("webkitfullscreenchange", sync);
|
|
326
|
+
};
|
|
327
|
+
}, [target, fallbackVideo]);
|
|
328
|
+
const toggle = useCallback(() => {
|
|
329
|
+
const el = target.current;
|
|
330
|
+
if (!el) return;
|
|
331
|
+
if (fullscreenElement() === el) {
|
|
332
|
+
if (document.exitFullscreen) void document.exitFullscreen().catch(() => {
|
|
333
|
+
});
|
|
334
|
+
else document.webkitExitFullscreen?.();
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (elementFullscreenEnabled()) {
|
|
338
|
+
if (el.requestFullscreen) void el.requestFullscreen().catch(() => {
|
|
339
|
+
});
|
|
340
|
+
else el.webkitRequestFullscreen?.();
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
fallbackVideo?.current?.webkitEnterFullscreen?.();
|
|
344
|
+
}, [target, fallbackVideo]);
|
|
345
|
+
return { active, supported, toggle };
|
|
346
|
+
}
|
|
266
347
|
|
|
267
348
|
// src/userColor.ts
|
|
268
349
|
var PALETTE = [
|
|
@@ -397,6 +478,8 @@ function ScreenTile({
|
|
|
397
478
|
label
|
|
398
479
|
}) {
|
|
399
480
|
const ref = useRef(null);
|
|
481
|
+
const tile = useRef(null);
|
|
482
|
+
const fullscreen = useFullscreen(tile, ref);
|
|
400
483
|
const track = participant.screenTrack;
|
|
401
484
|
const name = participant.isSelf ? "Your screen" : `${participant.name ?? label(participant.userId)}'s screen`;
|
|
402
485
|
useEffect(() => {
|
|
@@ -407,23 +490,49 @@ function ScreenTile({
|
|
|
407
490
|
track.detach(element);
|
|
408
491
|
};
|
|
409
492
|
}, [track]);
|
|
410
|
-
return /* @__PURE__ */ jsxs(
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
493
|
+
return /* @__PURE__ */ jsxs(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
ref: tile,
|
|
497
|
+
className: "callpresent__screen",
|
|
498
|
+
onDoubleClick: fullscreen.supported ? fullscreen.toggle : void 0,
|
|
499
|
+
children: [
|
|
500
|
+
/* @__PURE__ */ jsx(
|
|
501
|
+
"video",
|
|
502
|
+
{
|
|
503
|
+
ref,
|
|
504
|
+
className: "callgrid__video",
|
|
505
|
+
autoPlay: true,
|
|
506
|
+
playsInline: true,
|
|
507
|
+
muted: true,
|
|
508
|
+
style: { objectFit: "contain" }
|
|
509
|
+
}
|
|
510
|
+
),
|
|
511
|
+
/* @__PURE__ */ jsxs("div", { className: "callgrid__caption", children: [
|
|
512
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: "screen-share", size: 13, label: null }),
|
|
513
|
+
/* @__PURE__ */ jsx("span", { className: "callgrid__name", children: name })
|
|
514
|
+
] }),
|
|
515
|
+
fullscreen.supported && /* @__PURE__ */ jsx(
|
|
516
|
+
"button",
|
|
517
|
+
{
|
|
518
|
+
type: "button",
|
|
519
|
+
className: "callpresent__fullscreen",
|
|
520
|
+
onClick: fullscreen.toggle,
|
|
521
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
522
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
523
|
+
children: /* @__PURE__ */ jsx(
|
|
524
|
+
PoolseIcon,
|
|
525
|
+
{
|
|
526
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
527
|
+
size: 18,
|
|
528
|
+
label: null
|
|
529
|
+
}
|
|
530
|
+
)
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
);
|
|
427
536
|
}
|
|
428
537
|
function FloatingSelf({
|
|
429
538
|
children,
|
|
@@ -493,6 +602,7 @@ function CallControlButton({
|
|
|
493
602
|
label,
|
|
494
603
|
onClick,
|
|
495
604
|
active = false,
|
|
605
|
+
highlight = false,
|
|
496
606
|
tone = "neutral",
|
|
497
607
|
large = false,
|
|
498
608
|
disabled = false,
|
|
@@ -503,37 +613,46 @@ function CallControlButton({
|
|
|
503
613
|
"callbtn",
|
|
504
614
|
tone !== "neutral" ? `callbtn--${tone}` : "",
|
|
505
615
|
active ? "callbtn--active" : "",
|
|
616
|
+
highlight ? "callbtn--highlight" : "",
|
|
506
617
|
large ? "callbtn--large" : ""
|
|
507
618
|
].filter(Boolean).join(" ");
|
|
508
619
|
return /* @__PURE__ */ jsxs("span", { className: "callbtn__slot", children: [
|
|
509
|
-
/* @__PURE__ */ jsxs(
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
{
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
620
|
+
/* @__PURE__ */ jsxs(
|
|
621
|
+
"span",
|
|
622
|
+
{
|
|
623
|
+
className: `callbtn__wrap${hasMenu ? " callbtn__wrap--menu" : ""}${active ? " callbtn__wrap--active" : ""}`,
|
|
624
|
+
children: [
|
|
625
|
+
/* @__PURE__ */ jsx(
|
|
626
|
+
"button",
|
|
627
|
+
{
|
|
628
|
+
type: "button",
|
|
629
|
+
className: classes,
|
|
630
|
+
onClick,
|
|
631
|
+
disabled,
|
|
632
|
+
"aria-pressed": tone === "neutral" ? active || highlight : void 0,
|
|
633
|
+
"aria-label": label,
|
|
634
|
+
title: label,
|
|
635
|
+
children: /* @__PURE__ */ jsx(PoolseIcon, { name: icon, size: large ? 26 : 22, label: null })
|
|
636
|
+
}
|
|
637
|
+
),
|
|
638
|
+
hasMenu && // A separate hit target, not a long-press: the toggle and the
|
|
639
|
+
// device list are different actions, and hiding one inside a
|
|
640
|
+
// timed gesture on the other is how people end up muting
|
|
641
|
+
// themselves while trying to change microphone.
|
|
642
|
+
/* @__PURE__ */ jsx(
|
|
643
|
+
"button",
|
|
644
|
+
{
|
|
645
|
+
type: "button",
|
|
646
|
+
className: "callbtn__caret",
|
|
647
|
+
onClick: onMenuClick,
|
|
648
|
+
"aria-label": `${label} options`,
|
|
649
|
+
title: `${label} options`,
|
|
650
|
+
children: /* @__PURE__ */ jsx(PoolseIcon, { name: "chevron-up", size: 13, label: null })
|
|
651
|
+
}
|
|
652
|
+
)
|
|
653
|
+
]
|
|
654
|
+
}
|
|
655
|
+
),
|
|
537
656
|
/* @__PURE__ */ jsx("span", { className: "callbtn__label", children: label })
|
|
538
657
|
] });
|
|
539
658
|
}
|
|
@@ -3549,6 +3668,8 @@ function RoomJoinBar({ room, allowStart = true }) {
|
|
|
3549
3668
|
}
|
|
3550
3669
|
function RoomStage({ room, title, labelFor, className }) {
|
|
3551
3670
|
const media = room.media;
|
|
3671
|
+
const stage = useRef(null);
|
|
3672
|
+
const fullscreen = useFullscreen(stage);
|
|
3552
3673
|
const [menu, setMenu] = useState(null);
|
|
3553
3674
|
const elapsed = useElapsed(room.live?.started_at ?? null, media.status === "connected");
|
|
3554
3675
|
const openMenu = useCallback(
|
|
@@ -3560,115 +3681,150 @@ function RoomStage({ room, title, labelFor, className }) {
|
|
|
3560
3681
|
);
|
|
3561
3682
|
const count = media.participants.length;
|
|
3562
3683
|
const canShare = media.canShareScreen && room.live?.screen_share_allowed !== false;
|
|
3563
|
-
const
|
|
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
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
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,
|
|
3684
|
+
const connecting = media.status === "connecting" || room.joining;
|
|
3685
|
+
return /* @__PURE__ */ jsxs(
|
|
3686
|
+
"section",
|
|
3687
|
+
{
|
|
3688
|
+
ref: stage,
|
|
3689
|
+
className: ["poolse-room", className].filter(Boolean).join(" "),
|
|
3690
|
+
"aria-label": "Room",
|
|
3691
|
+
children: [
|
|
3692
|
+
/* @__PURE__ */ jsxs("header", { className: "poolse-room__head", children: [
|
|
3693
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-room__title", children: title ?? "Room" }),
|
|
3694
|
+
connecting ? /* @__PURE__ */ jsx("span", { className: "poolse-room__status", children: "Connecting\u2026" }) : /* @__PURE__ */ jsxs("span", { className: "poolse-room__status", children: [
|
|
3695
|
+
elapsed && /* @__PURE__ */ jsxs("span", { className: "poolse-room__chip poolse-room__chip--live", children: [
|
|
3696
|
+
/* @__PURE__ */ jsx("span", { className: "poolse-room__dot", "aria-hidden": "true" }),
|
|
3697
|
+
elapsed
|
|
3698
|
+
] }),
|
|
3699
|
+
/* @__PURE__ */ jsxs("span", { className: "poolse-room__chip", "aria-label": `${count} in the room`, children: [
|
|
3700
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: "users", size: 14, label: null }),
|
|
3701
|
+
count
|
|
3702
|
+
] })
|
|
3703
|
+
] }),
|
|
3704
|
+
fullscreen.supported && /* @__PURE__ */ jsx(
|
|
3705
|
+
"button",
|
|
3706
|
+
{
|
|
3707
|
+
type: "button",
|
|
3708
|
+
className: "poolse-room__fullscreen",
|
|
3709
|
+
onClick: fullscreen.toggle,
|
|
3710
|
+
"aria-label": fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3711
|
+
title: fullscreen.active ? "Exit full screen" : "Full screen",
|
|
3712
|
+
children: /* @__PURE__ */ jsx(
|
|
3713
|
+
PoolseIcon,
|
|
3714
|
+
{
|
|
3715
|
+
name: fullscreen.active ? "fullscreen-exit" : "fullscreen",
|
|
3716
|
+
size: 17,
|
|
3717
|
+
label: null
|
|
3718
|
+
}
|
|
3719
|
+
)
|
|
3720
|
+
}
|
|
3721
|
+
)
|
|
3722
|
+
] }),
|
|
3723
|
+
/* @__PURE__ */ jsx("div", { className: "poolse-room__stage", children: count > 0 ? /* @__PURE__ */ jsx(
|
|
3724
|
+
CallVideoGrid,
|
|
3651
3725
|
{
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3656
|
-
onClose: () => setMenu(null)
|
|
3726
|
+
participants: media.participants,
|
|
3727
|
+
...labelFor ? { labelFor } : {},
|
|
3728
|
+
onLocalClick: media.cameraEnabled ? () => void media.switchCamera() : void 0
|
|
3657
3729
|
}
|
|
3658
|
-
)
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3730
|
+
) : /* @__PURE__ */ jsx("div", { className: "poolse-room__waiting", children: "Connecting\u2026" }) }),
|
|
3731
|
+
media.screenSharing && /* @__PURE__ */ jsxs("div", { className: "poolse-room__sharing", role: "status", children: [
|
|
3732
|
+
/* @__PURE__ */ jsx(PoolseIcon, { name: "screen-share", size: 15, label: null }),
|
|
3733
|
+
/* @__PURE__ */ jsx("span", { children: "You are sharing your screen" }),
|
|
3734
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: () => void media.setScreenShareEnabled(false), children: "Stop sharing" })
|
|
3735
|
+
] }),
|
|
3736
|
+
room.error && /* @__PURE__ */ jsx("p", { className: "poolse-room__error", children: room.error.message }),
|
|
3737
|
+
/* @__PURE__ */ jsxs("div", { className: "poolse-room__bar", children: [
|
|
3738
|
+
/* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3739
|
+
/* @__PURE__ */ jsx(
|
|
3740
|
+
CallControlButton,
|
|
3741
|
+
{
|
|
3742
|
+
icon: media.micEnabled ? "mic-fill" : "mic-off-fill",
|
|
3743
|
+
active: !media.micEnabled,
|
|
3744
|
+
label: media.micEnabled ? "Mute" : "Unmute",
|
|
3745
|
+
onClick: () => void media.toggleMic(),
|
|
3746
|
+
hasMenu: media.devices.audioinput.length > 0,
|
|
3747
|
+
onMenuClick: () => openMenu("audioinput")
|
|
3748
|
+
}
|
|
3749
|
+
),
|
|
3750
|
+
menu === "audioinput" && /* @__PURE__ */ jsx(
|
|
3751
|
+
CallDeviceMenu,
|
|
3752
|
+
{
|
|
3753
|
+
title: "Microphone",
|
|
3754
|
+
devices: media.devices.audioinput,
|
|
3755
|
+
activeId: media.activeDevices.audioinput,
|
|
3756
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3757
|
+
onClose: () => setMenu(null)
|
|
3758
|
+
}
|
|
3759
|
+
)
|
|
3760
|
+
] }),
|
|
3761
|
+
/* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3762
|
+
/* @__PURE__ */ jsx(
|
|
3763
|
+
CallControlButton,
|
|
3764
|
+
{
|
|
3765
|
+
icon: media.cameraEnabled ? "video-fill" : "video-off-fill",
|
|
3766
|
+
active: !media.cameraEnabled,
|
|
3767
|
+
label: media.cameraEnabled ? "Camera" : "Camera off",
|
|
3768
|
+
onClick: () => void media.toggleCamera(),
|
|
3769
|
+
disabled: media.devices.videoinput.length === 0 && !media.cameraEnabled,
|
|
3770
|
+
hasMenu: media.devices.videoinput.length > 0,
|
|
3771
|
+
onMenuClick: () => openMenu("videoinput")
|
|
3772
|
+
}
|
|
3773
|
+
),
|
|
3774
|
+
menu === "videoinput" && /* @__PURE__ */ jsx(
|
|
3775
|
+
CallDeviceMenu,
|
|
3776
|
+
{
|
|
3777
|
+
title: "Camera",
|
|
3778
|
+
devices: media.devices.videoinput,
|
|
3779
|
+
activeId: media.activeDevices.videoinput,
|
|
3780
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3781
|
+
onClose: () => setMenu(null)
|
|
3782
|
+
}
|
|
3783
|
+
)
|
|
3784
|
+
] }),
|
|
3785
|
+
(canShare || media.screenSharing) && /* @__PURE__ */ jsx(
|
|
3786
|
+
CallControlButton,
|
|
3787
|
+
{
|
|
3788
|
+
icon: media.screenSharing ? "screen-share-off-fill" : "screen-share-fill",
|
|
3789
|
+
highlight: media.screenSharing,
|
|
3790
|
+
label: media.screenSharing ? "Stop sharing" : "Share screen",
|
|
3791
|
+
onClick: () => void media.toggleScreenShare()
|
|
3792
|
+
}
|
|
3793
|
+
),
|
|
3794
|
+
media.devices.audiooutput.length > 0 && /* @__PURE__ */ jsxs("span", { className: "callsheet__control", children: [
|
|
3795
|
+
/* @__PURE__ */ jsx(
|
|
3796
|
+
CallControlButton,
|
|
3797
|
+
{
|
|
3798
|
+
icon: "speaker-fill",
|
|
3799
|
+
label: "Speaker",
|
|
3800
|
+
onClick: () => openMenu("audiooutput")
|
|
3801
|
+
}
|
|
3802
|
+
),
|
|
3803
|
+
menu === "audiooutput" && /* @__PURE__ */ jsx(
|
|
3804
|
+
CallDeviceMenu,
|
|
3805
|
+
{
|
|
3806
|
+
title: "Speaker",
|
|
3807
|
+
devices: media.devices.audiooutput,
|
|
3808
|
+
activeId: media.activeDevices.audiooutput,
|
|
3809
|
+
onSelect: (kind, id) => void media.selectDevice(kind, id),
|
|
3810
|
+
onClose: () => setMenu(null)
|
|
3811
|
+
}
|
|
3812
|
+
)
|
|
3813
|
+
] }),
|
|
3814
|
+
/* @__PURE__ */ jsx(
|
|
3815
|
+
CallControlButton,
|
|
3816
|
+
{
|
|
3817
|
+
icon: "phone-off-fill",
|
|
3818
|
+
tone: "danger",
|
|
3819
|
+
large: true,
|
|
3820
|
+
label: "Leave",
|
|
3821
|
+
onClick: room.leave
|
|
3822
|
+
}
|
|
3823
|
+
)
|
|
3824
|
+
] })
|
|
3825
|
+
]
|
|
3826
|
+
}
|
|
3827
|
+
);
|
|
3672
3828
|
}
|
|
3673
3829
|
function useElapsed(startedAt, running) {
|
|
3674
3830
|
const [, tick] = useState(0);
|