@ai-matrx/meet 0.11.31 → 0.11.33
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 +27 -0
- package/dist/core.cjs +133 -45
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +73 -4
- package/dist/core.d.ts +73 -4
- package/dist/core.js +133 -45
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +133 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +133 -45
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +476 -75
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +6 -0
- package/dist/react.d.ts +6 -0
- package/dist/react.js +476 -75
- package/dist/react.js.map +1 -1
- package/dist/skins/meet.cjs +217 -33
- package/dist/skins/meet.cjs.map +1 -1
- package/dist/skins/meet.js +217 -33
- package/dist/skins/meet.js.map +1 -1
- package/package.json +3 -3
package/dist/skins/meet.cjs
CHANGED
|
@@ -113,11 +113,17 @@ var import_react10 = require("react");
|
|
|
113
113
|
var import_react8 = require("react");
|
|
114
114
|
|
|
115
115
|
// src/core/names.ts
|
|
116
|
+
var CONNECTION_SEPARATOR = "~";
|
|
117
|
+
function personOf(identity) {
|
|
118
|
+
const value = String(identity ?? "").trim();
|
|
119
|
+
const cut = value.indexOf(CONNECTION_SEPARATOR);
|
|
120
|
+
return cut === -1 ? value : value.slice(0, cut);
|
|
121
|
+
}
|
|
116
122
|
function isGuestIdentity(identity) {
|
|
117
|
-
return
|
|
123
|
+
return personOf(identity).startsWith("guest:");
|
|
118
124
|
}
|
|
119
125
|
function isAgentIdentity(identity) {
|
|
120
|
-
return
|
|
126
|
+
return personOf(identity).startsWith("agent:");
|
|
121
127
|
}
|
|
122
128
|
var NOTE_TAKER_PRODUCT_NAME = "Matrx note-taker";
|
|
123
129
|
var AGENT_PRODUCT_NAME = "Matrx agent";
|
|
@@ -167,12 +173,18 @@ var MeetError = class extends Error {
|
|
|
167
173
|
* renders `refused:<reason>` (or `ended`) from it — never from the HTTP status.
|
|
168
174
|
*/
|
|
169
175
|
reason;
|
|
170
|
-
|
|
176
|
+
/**
|
|
177
|
+
* A refusal that lifts by itself says when: whole seconds from the moment the server answered
|
|
178
|
+
* (a denial's cooldown, `reknock_cooldown_seconds`). Null for every refusal that does not.
|
|
179
|
+
*/
|
|
180
|
+
retryAfterSeconds;
|
|
181
|
+
constructor(code, message, remedy, cause, reason, retryAfterSeconds) {
|
|
171
182
|
super(message);
|
|
172
183
|
this.name = "MeetError";
|
|
173
184
|
this.code = code;
|
|
174
185
|
this.remedy = remedy;
|
|
175
186
|
this.reason = reason ?? null;
|
|
187
|
+
this.retryAfterSeconds = retryAfterSeconds ?? null;
|
|
176
188
|
if (cause !== void 0) this.cause = cause;
|
|
177
189
|
}
|
|
178
190
|
/** True when retrying after the host re-establishes a session is the fix. */
|
|
@@ -1185,6 +1197,7 @@ function useRoom() {
|
|
|
1185
1197
|
phase: snapshot?.phase ?? "resolving",
|
|
1186
1198
|
participants: snapshot?.participants ?? [],
|
|
1187
1199
|
failure: snapshot?.failure ?? null,
|
|
1200
|
+
secondDevice: snapshot?.secondDevice ?? null,
|
|
1188
1201
|
local,
|
|
1189
1202
|
canShareScreen: engine?.supportsScreenShare() ?? true,
|
|
1190
1203
|
join: (0, import_react5.useCallback)(
|
|
@@ -1277,6 +1290,7 @@ function useLobby() {
|
|
|
1277
1290
|
const session = host?.meetings ?? null;
|
|
1278
1291
|
return {
|
|
1279
1292
|
waiting: (snapshot?.lobby ?? []).filter((entry) => entry.state === "knocking"),
|
|
1293
|
+
declined: (snapshot?.lobby ?? []).filter((entry) => entry.state === "denied"),
|
|
1280
1294
|
// No runtime means no host powers — `<LobbyPanel>` renders nothing rather
|
|
1281
1295
|
// than an admit button that would throw.
|
|
1282
1296
|
canAdmit: session !== null && isHost,
|
|
@@ -1298,6 +1312,37 @@ function useLobby() {
|
|
|
1298
1312
|
)
|
|
1299
1313
|
};
|
|
1300
1314
|
}
|
|
1315
|
+
function useCountdown(untilMs) {
|
|
1316
|
+
const [now, setNow] = (0, import_react5.useState)(() => Date.now());
|
|
1317
|
+
const active = typeof untilMs === "number" && untilMs > now;
|
|
1318
|
+
(0, import_react5.useEffect)(() => {
|
|
1319
|
+
if (!active) return void 0;
|
|
1320
|
+
setNow(Date.now());
|
|
1321
|
+
const timer = setInterval(() => setNow(Date.now()), 1e3);
|
|
1322
|
+
return () => clearInterval(timer);
|
|
1323
|
+
}, [active, untilMs]);
|
|
1324
|
+
if (typeof untilMs !== "number") return null;
|
|
1325
|
+
return Math.max(0, untilMs - now);
|
|
1326
|
+
}
|
|
1327
|
+
function useKnockNotice() {
|
|
1328
|
+
const lobby = useLobby();
|
|
1329
|
+
const [dismissed, setDismissed] = (0, import_react5.useState)([]);
|
|
1330
|
+
const keyOf = (entry) => `${entry.identity}@${entry.knockedAt}`;
|
|
1331
|
+
const open = lobby.canAdmit ? lobby.waiting.filter((entry) => !dismissed.includes(keyOf(entry))) : [];
|
|
1332
|
+
const knocker = open[0] ?? null;
|
|
1333
|
+
return {
|
|
1334
|
+
knocker,
|
|
1335
|
+
others: Math.max(0, open.length - 1),
|
|
1336
|
+
admit: (0, import_react5.useCallback)(async () => {
|
|
1337
|
+
if (knocker === null) return;
|
|
1338
|
+
setDismissed((list) => [...list, keyOf(knocker)]);
|
|
1339
|
+
await lobby.admit(knocker);
|
|
1340
|
+
}, [knocker, lobby.admit]),
|
|
1341
|
+
dismiss: (0, import_react5.useCallback)(() => {
|
|
1342
|
+
if (knocker !== null) setDismissed((list) => [...list, keyOf(knocker)]);
|
|
1343
|
+
}, [knocker])
|
|
1344
|
+
};
|
|
1345
|
+
}
|
|
1301
1346
|
function useWaiting() {
|
|
1302
1347
|
const host = useMeetHost();
|
|
1303
1348
|
const snapshot = useMeetSnapshot();
|
|
@@ -3288,6 +3333,7 @@ function ControlBar({ onLeave }) {
|
|
|
3288
3333
|
}
|
|
3289
3334
|
) }) }) : null,
|
|
3290
3335
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(BreakoutBanner, {}),
|
|
3336
|
+
panel !== "people" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(KnockNotice, { onView: () => setPanel("people") }) : null,
|
|
3291
3337
|
controls.notice !== null && panel !== "people" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Toast, { text: controls.notice.text, failed: controls.notice.failed, onDone: controls.clearNotice }) : null,
|
|
3292
3338
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__controls", children: [
|
|
3293
3339
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -3618,10 +3664,21 @@ function MediaNotices() {
|
|
|
3618
3664
|
const name = (kind) => kind === "microphone" ? "Microphone" : "Camera";
|
|
3619
3665
|
if (chips.length === 0 && region.audioOutput !== "blocked" && notice === null && offer === null) return null;
|
|
3620
3666
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__media-notices", children: [
|
|
3621
|
-
region.audioOutput === "blocked" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3667
|
+
region.audioOutput === "blocked" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
3668
|
+
import_design_system.ErrorBox,
|
|
3669
|
+
{
|
|
3670
|
+
as: "div",
|
|
3671
|
+
className: "mx-meet__media-pill",
|
|
3672
|
+
"data-meet-notice": "audio-blocked",
|
|
3673
|
+
message: "Sound is paused in this tab",
|
|
3674
|
+
operation: "Enable meeting sound",
|
|
3675
|
+
origin: "meet/MediaNotices",
|
|
3676
|
+
children: [
|
|
3677
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: "Sound is paused in this tab" }),
|
|
3678
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "mx-meet__primary mx-meet__primary--small", onClick: () => void enableAudio(), children: "Enable sound" })
|
|
3679
|
+
]
|
|
3680
|
+
}
|
|
3681
|
+
) : null,
|
|
3625
3682
|
chips.map(({ kind, reason }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__media-pill", role: "status", "data-meet-notice": deviceNoticeCode(kind, reason), children: [
|
|
3626
3683
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: deviceChipLabel(kind, reason) }),
|
|
3627
3684
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -4421,9 +4478,68 @@ function useMicrophoneStream(deviceId) {
|
|
|
4421
4478
|
}, [deviceId]);
|
|
4422
4479
|
return stream;
|
|
4423
4480
|
}
|
|
4481
|
+
function KnockNotice({ onView }) {
|
|
4482
|
+
const { knocker, others, admit, dismiss } = useKnockNotice();
|
|
4483
|
+
if (knocker === null) return null;
|
|
4484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__notice-bar", role: "status", "data-meet-notice": "knock-received", "data-meet-participant-name": knocker.displayName, children: [
|
|
4485
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
4486
|
+
knocker.displayName,
|
|
4487
|
+
" wants to join",
|
|
4488
|
+
others > 0 ? ` (+${others} more)` : ""
|
|
4489
|
+
] }),
|
|
4490
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "mx-meet__link", onClick: () => void admit().catch(() => void 0), children: "Admit" }),
|
|
4491
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4492
|
+
"button",
|
|
4493
|
+
{
|
|
4494
|
+
type: "button",
|
|
4495
|
+
className: "mx-meet__link",
|
|
4496
|
+
onClick: () => {
|
|
4497
|
+
dismiss();
|
|
4498
|
+
onView();
|
|
4499
|
+
},
|
|
4500
|
+
children: "View"
|
|
4501
|
+
}
|
|
4502
|
+
),
|
|
4503
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { type: "button", className: "mx-meet__toast-close", "aria-label": "Dismiss", onClick: dismiss, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CloseIcon, { width: 14, height: 14 }) })
|
|
4504
|
+
] });
|
|
4505
|
+
}
|
|
4424
4506
|
function LobbyPanel() {
|
|
4425
4507
|
const lobby = useLobby();
|
|
4426
|
-
if (!lobby.canAdmit || lobby.waiting.length === 0) return null;
|
|
4508
|
+
if (!lobby.canAdmit || lobby.waiting.length === 0 && lobby.declined.length === 0) return null;
|
|
4509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
4510
|
+
lobby.waiting.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(WaitingList, { lobby }) : null,
|
|
4511
|
+
lobby.declined.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DeclinedList, { lobby }) : null
|
|
4512
|
+
] });
|
|
4513
|
+
}
|
|
4514
|
+
function DeclinedList({ lobby }) {
|
|
4515
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "mx-meet__lobby", "aria-label": "Declined requests", "data-meet-declined": "", children: [
|
|
4516
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("header", { className: "mx-meet__lobby-head", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "mx-meet__lobby-title", children: "Declined" }) }),
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("ul", { className: "mx-meet__lobby-list", children: lobby.declined.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
4518
|
+
"li",
|
|
4519
|
+
{
|
|
4520
|
+
className: "mx-meet__lobby-row",
|
|
4521
|
+
"data-meet-declined-entry": "",
|
|
4522
|
+
"data-meet-participant-name": entry.displayName,
|
|
4523
|
+
children: [
|
|
4524
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Avatar, { name: entry.displayName, url: entry.avatarUrl, size: 32 }),
|
|
4525
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "mx-meet__person-name", children: entry.displayName }),
|
|
4526
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4527
|
+
"button",
|
|
4528
|
+
{
|
|
4529
|
+
type: "button",
|
|
4530
|
+
className: "mx-meet__link",
|
|
4531
|
+
"aria-label": `Let ${entry.displayName} ask again`,
|
|
4532
|
+
onClick: () => void lobby.undeny(entry),
|
|
4533
|
+
children: "Let them ask again"
|
|
4534
|
+
}
|
|
4535
|
+
)
|
|
4536
|
+
]
|
|
4537
|
+
},
|
|
4538
|
+
entry.identity
|
|
4539
|
+
)) })
|
|
4540
|
+
] });
|
|
4541
|
+
}
|
|
4542
|
+
function WaitingList({ lobby }) {
|
|
4427
4543
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("section", { className: "mx-meet__lobby", "aria-label": "Waiting room", children: [
|
|
4428
4544
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("header", { className: "mx-meet__lobby-head", children: [
|
|
4429
4545
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "mx-meet__lobby-title", children: lobby.waiting.length === 1 ? "1 person is waiting" : `${lobby.waiting.length} people are waiting` }),
|
|
@@ -4687,6 +4803,21 @@ function PreJoinBody({
|
|
|
4687
4803
|
(0, import_react10.useEffect)(() => {
|
|
4688
4804
|
void host.devices.refresh();
|
|
4689
4805
|
}, [host]);
|
|
4806
|
+
const joinWith = (secondDevice) => {
|
|
4807
|
+
setJoining(true);
|
|
4808
|
+
preview.release();
|
|
4809
|
+
void room.join({
|
|
4810
|
+
roomName,
|
|
4811
|
+
// An observer publishes nothing: no camera, no microphone (MD-16). A companion
|
|
4812
|
+
// ("join here too") never opens the microphone (S7).
|
|
4813
|
+
mode: observe2 ? "audio" : mode,
|
|
4814
|
+
microphone: observe2 || secondDevice === "join_too" ? false : microphone,
|
|
4815
|
+
...meetingId !== void 0 ? { meetingId } : {},
|
|
4816
|
+
...slug !== void 0 ? { slug } : {},
|
|
4817
|
+
...observe2 ? { observe: true } : {},
|
|
4818
|
+
...secondDevice !== void 0 ? { secondDevice } : {}
|
|
4819
|
+
}).then(() => onJoined?.()).catch(() => void 0).finally(() => setJoining(false));
|
|
4820
|
+
};
|
|
4690
4821
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__prejoin", children: [
|
|
4691
4822
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__preview", children: [
|
|
4692
4823
|
mode === "video" && preview.preview !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -4771,27 +4902,34 @@ function PreJoinBody({
|
|
|
4771
4902
|
),
|
|
4772
4903
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Label, { htmlFor: "mx-meet-join-mic", children: "Join with microphone" })
|
|
4773
4904
|
] }),
|
|
4774
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
className: "mx-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4905
|
+
room.secondDevice === null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", className: "mx-meet__join", disabled: joining, onClick: () => joinWith(), children: joining ? "Joining\u2026" : observe2 ? "Observe" : "Join now" }) : (
|
|
4906
|
+
// S7: ALREADY IN THIS MEETING on another tab or device — the meeting's choice
|
|
4907
|
+
// (Meet: Switch here / Join here too; Teams: Transfer here / Add this device).
|
|
4908
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "mx-meet__second-device", "data-meet-region": "second-device", children: [
|
|
4909
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mx-meet__hint", children: "You're in this meeting on another device" }),
|
|
4910
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4911
|
+
import_design_system.Button,
|
|
4912
|
+
{
|
|
4913
|
+
type: "button",
|
|
4914
|
+
className: "mx-meet__join",
|
|
4915
|
+
"data-meet-control": "switch-here",
|
|
4916
|
+
disabled: joining,
|
|
4917
|
+
onClick: () => joinWith("switch_here"),
|
|
4918
|
+
children: room.secondDevice.rule === "ask_transfer_or_add" ? "Transfer here" : "Switch here"
|
|
4919
|
+
}
|
|
4920
|
+
),
|
|
4921
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
4922
|
+
import_design_system.Button,
|
|
4923
|
+
{
|
|
4924
|
+
type: "button",
|
|
4925
|
+
variant: "outline",
|
|
4926
|
+
"data-meet-control": "join-too",
|
|
4927
|
+
disabled: joining,
|
|
4928
|
+
onClick: () => joinWith("join_too"),
|
|
4929
|
+
children: room.secondDevice.rule === "ask_transfer_or_add" ? "Add this device" : "Join here too"
|
|
4930
|
+
}
|
|
4931
|
+
)
|
|
4932
|
+
] })
|
|
4795
4933
|
)
|
|
4796
4934
|
] }),
|
|
4797
4935
|
room.failure !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "mx-meet__error", children: [
|
|
@@ -4989,16 +5127,21 @@ var REFUSED_TITLES = {
|
|
|
4989
5127
|
not_invited: "You aren't invited to this meeting",
|
|
4990
5128
|
locked: "This meeting is locked",
|
|
4991
5129
|
removed: "You can't rejoin this meeting",
|
|
4992
|
-
lobby_rejects: "
|
|
5130
|
+
lobby_rejects: "The host declined your request",
|
|
4993
5131
|
meeting_full: "This meeting is full",
|
|
4994
5132
|
platform_capacity: "Meetings are busy right now",
|
|
4995
5133
|
verification_required: "Verify your account to join",
|
|
4996
5134
|
registration_required: "Register to join this meeting"
|
|
4997
5135
|
};
|
|
5136
|
+
function clockText(ms) {
|
|
5137
|
+
const total = Math.ceil(ms / 1e3);
|
|
5138
|
+
return `${Math.floor(total / 60)}:${String(total % 60).padStart(2, "0")}`;
|
|
5139
|
+
}
|
|
4998
5140
|
function ExitScreen({ onLeave }) {
|
|
4999
5141
|
const { phase, reason, host, snapshot, actions, call, connection } = useMeetCore();
|
|
5000
5142
|
const [busy, setBusy] = (0, import_react10.useState)(false);
|
|
5001
5143
|
const failure = snapshot?.failure ?? null;
|
|
5144
|
+
const retryLeft = useCountdown(phase === "refused:lobby_rejects" ? failure?.retryAt ?? null : null);
|
|
5002
5145
|
const rejoin = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5003
5146
|
import_design_system.Button,
|
|
5004
5147
|
{
|
|
@@ -5041,6 +5184,33 @@ function ExitScreen({ onLeave }) {
|
|
|
5041
5184
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", variant: "outline", onClick: actions.retry, children: "Try again" }),
|
|
5042
5185
|
home
|
|
5043
5186
|
] });
|
|
5187
|
+
if (code === "lobby_rejects") {
|
|
5188
|
+
if (retryLeft !== null && retryLeft > 0) {
|
|
5189
|
+
line = `You can ask again in ${clockText(retryLeft)}`;
|
|
5190
|
+
notice = "reknock-cooldown";
|
|
5191
|
+
actionsNode = home;
|
|
5192
|
+
} else if (retryLeft === 0) {
|
|
5193
|
+
line = "You can ask to join again";
|
|
5194
|
+
actionsNode = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
5195
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5196
|
+
import_design_system.Button,
|
|
5197
|
+
{
|
|
5198
|
+
type: "button",
|
|
5199
|
+
disabled: busy,
|
|
5200
|
+
onClick: () => {
|
|
5201
|
+
setBusy(true);
|
|
5202
|
+
void actions.rejoin().catch(() => void 0).finally(() => setBusy(false));
|
|
5203
|
+
},
|
|
5204
|
+
children: "Ask to join again"
|
|
5205
|
+
}
|
|
5206
|
+
),
|
|
5207
|
+
home
|
|
5208
|
+
] });
|
|
5209
|
+
} else {
|
|
5210
|
+
line = "Ask the host to let you in, then open the link again";
|
|
5211
|
+
actionsNode = home;
|
|
5212
|
+
}
|
|
5213
|
+
}
|
|
5044
5214
|
} else {
|
|
5045
5215
|
switch (phase) {
|
|
5046
5216
|
case "left":
|
|
@@ -5101,7 +5271,7 @@ function ExitScreen({ onLeave }) {
|
|
|
5101
5271
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Avatar, { name: host?.identity.displayName ?? "", url: host?.identity.avatarUrl ?? null, size: 72 }),
|
|
5102
5272
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "mx-meet__prejoin-title", children: title }),
|
|
5103
5273
|
line !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mx-meet__empty-body", children: line }) : null,
|
|
5104
|
-
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { role: "status", "data-meet-notice": notice, className: "mx-meet__sr-only", children: title }) : null,
|
|
5274
|
+
notice !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { role: "status", "data-meet-notice": notice, className: "mx-meet__sr-only", children: notice === "reknock-cooldown" && line !== null ? line : title }) : null,
|
|
5105
5275
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mx-meet__waiting-actions", children: actionsNode })
|
|
5106
5276
|
] });
|
|
5107
5277
|
}
|
|
@@ -5110,6 +5280,7 @@ function WaitingRoom({ host, onLeave }) {
|
|
|
5110
5280
|
const { phaseNotice } = useMeetCore();
|
|
5111
5281
|
const [busy, setBusy] = (0, import_react10.useState)(false);
|
|
5112
5282
|
const admission = waiting?.admission ?? "knocking";
|
|
5283
|
+
const reknockLeft = useCountdown(admission === "denied" ? waiting?.reknockAt ?? null : null);
|
|
5113
5284
|
const run = (action) => () => {
|
|
5114
5285
|
setBusy(true);
|
|
5115
5286
|
void action().catch(() => void 0).finally(() => setBusy(false));
|
|
@@ -5117,6 +5288,7 @@ function WaitingRoom({ host, onLeave }) {
|
|
|
5117
5288
|
const home = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", variant: "outline", onClick: () => onLeave !== void 0 ? onLeave() : window.location.assign("/"), children: "Back to home" });
|
|
5118
5289
|
let title;
|
|
5119
5290
|
let line = null;
|
|
5291
|
+
let cooldownNotice = false;
|
|
5120
5292
|
let actions;
|
|
5121
5293
|
switch (admission) {
|
|
5122
5294
|
case "waiting_host":
|
|
@@ -5125,8 +5297,12 @@ function WaitingRoom({ host, onLeave }) {
|
|
|
5125
5297
|
break;
|
|
5126
5298
|
case "denied":
|
|
5127
5299
|
title = "The host declined your request";
|
|
5300
|
+
if (reknockLeft !== null && reknockLeft > 0) {
|
|
5301
|
+
line = `You can ask again in ${clockText(reknockLeft)}`;
|
|
5302
|
+
cooldownNotice = true;
|
|
5303
|
+
}
|
|
5128
5304
|
actions = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
5129
|
-
waiting?.reknockAllowed === true ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", disabled: busy, onClick: run(askAgain), children: "Ask to join again" }) : null,
|
|
5305
|
+
waiting?.reknockAllowed === true || waiting?.reknockAt != null && reknockLeft === 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_design_system.Button, { type: "button", disabled: busy, onClick: run(askAgain), children: "Ask to join again" }) : null,
|
|
5130
5306
|
home
|
|
5131
5307
|
] });
|
|
5132
5308
|
break;
|
|
@@ -5157,7 +5333,15 @@ function WaitingRoom({ host, onLeave }) {
|
|
|
5157
5333
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Avatar, { name: host.identity.displayName, url: host.identity.avatarUrl, size: 72 }),
|
|
5158
5334
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { className: "mx-meet__prejoin-title", children: title }),
|
|
5159
5335
|
phaseNotice === "sent-to-waiting" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mx-meet__empty-body", role: "status", "data-meet-notice": "sent-to-waiting", children: "The host moved you back to the waiting room" }) : null,
|
|
5160
|
-
line !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5336
|
+
line !== null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5337
|
+
"p",
|
|
5338
|
+
{
|
|
5339
|
+
className: "mx-meet__empty-body",
|
|
5340
|
+
role: "status",
|
|
5341
|
+
"data-meet-notice": cooldownNotice ? "reknock-cooldown" : "host-absent",
|
|
5342
|
+
children: line
|
|
5343
|
+
}
|
|
5344
|
+
) : null,
|
|
5161
5345
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mx-meet__waiting-actions", children: actions })
|
|
5162
5346
|
] });
|
|
5163
5347
|
}
|