@nivaro/react 0.2.55 → 0.3.0
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/dist/components/slots/TasksSlot.js +31 -29
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +101 -1
- package/dist/index.js +538 -525
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/ProfileView.js +163 -144
- package/dist/shared/components/ai/AiPlanCard.js +427 -0
- package/dist/shared/components/ai/AiPlanChanges.js +117 -0
- package/dist/shared/components/ai/TaskDo.js +1022 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
- package/dist/shared/components/chat/ChatPanel.js +1356 -1317
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
- package/dist/shared/components/chat/chat-core.js +273 -264
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
- package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
- package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
- package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
- package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
- package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
- package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
- package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
- package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
- package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
- package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
- package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
- package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
- package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
- package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
- package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
- package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
- package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
- package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
- package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
- package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
- package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
- package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
- package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
- package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
- package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
- package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
- package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
- package/dist/shared/components/item-edit/GroupSection.js +1 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
- package/dist/shared/components/item-edit/UserChip.js +145 -142
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/notification-sound.js +25 -16
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/package.json +2 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as H, useMutation as I } from "@tanstack/react-query";
|
|
3
|
+
import { X as L } from "lucide-react";
|
|
4
|
+
import { useState as d } from "react";
|
|
5
|
+
import { toast as W } from "sonner";
|
|
6
|
+
import { useNivaroClient as $ } from "../../../context.js";
|
|
7
|
+
import { post as j } from "../../../lib/commands.js";
|
|
8
|
+
import { cn as S } from "../../../lib/utils.js";
|
|
9
|
+
import { SimpleSelectXs as q } from "../../ui/SimpleSelect.js";
|
|
10
|
+
import { dmPeer as E } from "../chat-core.js";
|
|
11
|
+
import { HuddlePeopleList as U } from "./HuddlePeoplePicker.js";
|
|
12
|
+
import { toLocalInput as O, defaultStart as Q } from "./huddle-schedule.js";
|
|
13
|
+
const R = [
|
|
14
|
+
{ value: "15", label: "15 min" },
|
|
15
|
+
{ value: "30", label: "30 min" },
|
|
16
|
+
{ value: "45", label: "45 min" },
|
|
17
|
+
{ value: "60", label: "1 hour" },
|
|
18
|
+
{ value: "90", label: "1½ hours" },
|
|
19
|
+
{ value: "120", label: "2 hours" }
|
|
20
|
+
], C = "h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-900 outline-none placeholder:text-slate-400 focus:border-nvr-cyan dark:border-border dark:bg-background dark:text-slate-100";
|
|
21
|
+
function te({
|
|
22
|
+
room: i,
|
|
23
|
+
me: b,
|
|
24
|
+
renderAvatar: v,
|
|
25
|
+
onDone: f,
|
|
26
|
+
theme: r
|
|
27
|
+
}) {
|
|
28
|
+
const D = $(), P = H(), o = b ? E(i, b) : null, [h, T] = d(""), [c, F] = d(() => O(Q())), [g, M] = d("30"), [u, k] = d(
|
|
29
|
+
() => o ? /* @__PURE__ */ new Map([[o.toUpperCase(), "them"]]) : /* @__PURE__ */ new Map()
|
|
30
|
+
), [N, w] = d(null), p = I({
|
|
31
|
+
mutationFn: () => D.request(
|
|
32
|
+
j("/chat/huddle/schedules", {
|
|
33
|
+
room: i,
|
|
34
|
+
title: h,
|
|
35
|
+
starts_at: new Date(c).toISOString(),
|
|
36
|
+
duration_min: Number(g),
|
|
37
|
+
invitees: [...u.keys()]
|
|
38
|
+
})
|
|
39
|
+
),
|
|
40
|
+
onSuccess: (e) => {
|
|
41
|
+
P.invalidateQueries({ queryKey: ["nvr-huddle-schedules", i] }), W.success(`Huddle scheduled — "${e.data.title}"`, {
|
|
42
|
+
description: e.data.invitees.length > 0 ? `${e.data.invitees.length} ${e.data.invitees.length === 1 ? "person was" : "people were"} invited. Everyone gets a reminder five minutes before.` : "The room has the card; invite people from it later."
|
|
43
|
+
}), f();
|
|
44
|
+
},
|
|
45
|
+
onError: (e) => {
|
|
46
|
+
var a;
|
|
47
|
+
return w(
|
|
48
|
+
((a = e == null ? void 0 : e.response) == null ? void 0 : a.error) ?? (e == null ? void 0 : e.message) ?? "Could not schedule it"
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}), x = Number.isNaN(new Date(c).getTime()), m = !x && new Date(c).getTime() < Date.now() + 6e4, y = h.trim().length > 0 && !x && !m && !p.isPending;
|
|
52
|
+
return /* @__PURE__ */ l(
|
|
53
|
+
"form",
|
|
54
|
+
{
|
|
55
|
+
className: "space-y-2.5 p-0.5",
|
|
56
|
+
onSubmit: (e) => {
|
|
57
|
+
e.preventDefault(), w(null), y && p.mutate();
|
|
58
|
+
},
|
|
59
|
+
"data-huddle-schedule-form": !0,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ l("div", { children: [
|
|
62
|
+
/* @__PURE__ */ t(
|
|
63
|
+
"label",
|
|
64
|
+
{
|
|
65
|
+
htmlFor: "huddle-sched-title",
|
|
66
|
+
className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400",
|
|
67
|
+
children: "Title"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"input",
|
|
72
|
+
{
|
|
73
|
+
id: "huddle-sched-title",
|
|
74
|
+
value: h,
|
|
75
|
+
onChange: (e) => T(e.target.value),
|
|
76
|
+
maxLength: 200,
|
|
77
|
+
placeholder: "What is it about?",
|
|
78
|
+
className: S(C, r == null ? void 0 : r.input)
|
|
79
|
+
}
|
|
80
|
+
)
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ l("div", { className: "flex items-end gap-2", children: [
|
|
83
|
+
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
84
|
+
/* @__PURE__ */ t(
|
|
85
|
+
"label",
|
|
86
|
+
{
|
|
87
|
+
htmlFor: "huddle-sched-when",
|
|
88
|
+
className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400",
|
|
89
|
+
children: "Starts"
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ t(
|
|
93
|
+
"input",
|
|
94
|
+
{
|
|
95
|
+
id: "huddle-sched-when",
|
|
96
|
+
type: "datetime-local",
|
|
97
|
+
value: c,
|
|
98
|
+
onChange: (e) => F(e.target.value),
|
|
99
|
+
className: S(C, r == null ? void 0 : r.input, m && "border-red-400 dark:border-red-500"),
|
|
100
|
+
"aria-invalid": m || x
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ l("div", { className: "shrink-0", children: [
|
|
105
|
+
/* @__PURE__ */ t("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "For" }),
|
|
106
|
+
/* @__PURE__ */ t(
|
|
107
|
+
q,
|
|
108
|
+
{
|
|
109
|
+
value: g,
|
|
110
|
+
onChange: M,
|
|
111
|
+
options: R,
|
|
112
|
+
ariaLabel: "Duration",
|
|
113
|
+
className: "h-8 text-[12px]"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] })
|
|
117
|
+
] }),
|
|
118
|
+
m && /* @__PURE__ */ t("p", { className: "text-[11px] text-red-600 dark:text-red-300", children: "Pick a time at least a minute from now." }),
|
|
119
|
+
!o && /* @__PURE__ */ l("div", { children: [
|
|
120
|
+
/* @__PURE__ */ t("span", { className: "mb-1 block text-[11px] font-medium text-slate-500 dark:text-slate-400", children: "Invite" }),
|
|
121
|
+
u.size > 0 && /* @__PURE__ */ t("div", { className: "mb-1.5 flex flex-wrap gap-1", "data-huddle-sched-invitees": !0, children: [...u].map(([e, a]) => /* @__PURE__ */ l(
|
|
122
|
+
"span",
|
|
123
|
+
{
|
|
124
|
+
className: "inline-flex h-6 items-center gap-1 rounded-full bg-slate-100 pl-0.5 pr-1 text-[11px] text-slate-700 dark:bg-muted dark:text-slate-200",
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ t("span", { style: { lineHeight: 0 }, children: v(e, a) }),
|
|
127
|
+
/* @__PURE__ */ t("span", { className: "max-w-[120px] truncate", children: a }),
|
|
128
|
+
/* @__PURE__ */ t(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
onClick: () => k((s) => {
|
|
133
|
+
const n = new Map(s);
|
|
134
|
+
return n.delete(e), n;
|
|
135
|
+
}),
|
|
136
|
+
className: "grid h-4 w-4 place-items-center rounded-full text-slate-500 hover:bg-slate-200 hover:text-slate-800 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
137
|
+
"aria-label": `Remove ${a}`,
|
|
138
|
+
children: /* @__PURE__ */ t(L, { className: "h-3 w-3", strokeWidth: 2 })
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
e
|
|
144
|
+
)) }),
|
|
145
|
+
/* @__PURE__ */ t("div", { className: "rounded-md border border-slate-200 dark:border-border", children: /* @__PURE__ */ t(
|
|
146
|
+
U,
|
|
147
|
+
{
|
|
148
|
+
room: i,
|
|
149
|
+
selected: new Set(u.keys()),
|
|
150
|
+
renderAvatar: v,
|
|
151
|
+
placeholder: "Add people who can see this room…",
|
|
152
|
+
onPick: (e) => k((a) => {
|
|
153
|
+
const s = new Map(a), n = e.id.toUpperCase();
|
|
154
|
+
return s.has(n) ? s.delete(n) : s.set(n, e.name), s;
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
) })
|
|
158
|
+
] }),
|
|
159
|
+
o && /* @__PURE__ */ t("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "The other person in this conversation is invited and will be called at the start." }),
|
|
160
|
+
N && /* @__PURE__ */ t("p", { className: "text-[11px] text-red-600 dark:text-red-300", role: "alert", children: N }),
|
|
161
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-1.5 pt-0.5", children: [
|
|
162
|
+
/* @__PURE__ */ t(
|
|
163
|
+
"button",
|
|
164
|
+
{
|
|
165
|
+
type: "button",
|
|
166
|
+
onClick: f,
|
|
167
|
+
className: "h-7 rounded-md px-2 text-[12px] text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
168
|
+
children: "Cancel"
|
|
169
|
+
}
|
|
170
|
+
),
|
|
171
|
+
/* @__PURE__ */ t(
|
|
172
|
+
"button",
|
|
173
|
+
{
|
|
174
|
+
type: "submit",
|
|
175
|
+
disabled: !y,
|
|
176
|
+
className: "h-7 rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white hover:bg-[#00b8e0] disabled:opacity-40 disabled:hover:bg-nvr-cyan",
|
|
177
|
+
"data-huddle-sched-save": !0,
|
|
178
|
+
children: p.isPending ? "Scheduling…" : "Schedule"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
export {
|
|
187
|
+
te as HuddleScheduleForm
|
|
188
|
+
};
|
|
@@ -1,164 +1,259 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { CircleAlert as C, X as y, MicOff as O, ScreenShare as j, PhoneOutgoing as E, BellOff as R, Maximize2 as $ } from "lucide-react";
|
|
3
|
+
import { useMemo as W, useSyncExternalStore as w, useEffect as S, useRef as k } from "react";
|
|
4
4
|
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { MutedTalkingHint as M, PoorConnectionBanner as P, SpeakingRing as G, QualityBars as I } from "./HuddleAudioUi.js";
|
|
6
|
+
import { HuddleCallBar as T } from "./HuddleCallBar.js";
|
|
7
|
+
import { HuddleVideoGrid as _ } from "./HuddleCamera.js";
|
|
8
|
+
import { HuddleNotesPanel as F } from "./HuddleCollab.js";
|
|
9
|
+
import { HuddleDrawOverlay as q } from "./HuddleDraw.js";
|
|
10
|
+
import { HuddleHands as A, HuddleCameraNotice as B, HuddleReactionLayer as V } from "./HuddleStageTools.js";
|
|
11
|
+
import { huddleCalls as f } from "./huddle-calls.js";
|
|
12
|
+
import { subscribeHeld as X, getHeldSnapshot as z } from "./huddle-hold.js";
|
|
13
|
+
import { useHuddlePip as D, HuddlePipOffer as Q } from "./huddle-pip.js";
|
|
14
|
+
import { useHuddleSpeaking as J, useHuddleQuality as L } from "./useHuddleAudio.js";
|
|
15
|
+
const Y = [];
|
|
16
|
+
function K({ p: t, onCancel: a }) {
|
|
17
|
+
const s = t.state === "ringing" ? `Ringing ${t.name ?? "someone"}…` : t.state === "accepted" ? `${t.name ?? "Someone"} is joining` : t.state === "declined" ? `${t.name ?? "Someone"} declined` : `No answer from ${t.name ?? "someone"}`;
|
|
18
|
+
return /* @__PURE__ */ c(
|
|
19
|
+
"span",
|
|
20
|
+
{
|
|
21
|
+
className: p(
|
|
22
|
+
"inline-flex h-6 items-center gap-1 rounded-full border border-dashed px-2 text-[11px]",
|
|
23
|
+
t.state === "ringing" ? "border-nvr-cyan/60 text-slate-700 dark:text-slate-200" : "border-slate-300 text-slate-500 dark:border-border dark:text-slate-400"
|
|
24
|
+
),
|
|
25
|
+
"data-huddle-ringing": t.id,
|
|
26
|
+
"data-state": t.state,
|
|
27
|
+
children: [
|
|
28
|
+
t.state === "ringing" && /* @__PURE__ */ e(
|
|
29
|
+
E,
|
|
30
|
+
{
|
|
31
|
+
className: "h-3 w-3 text-nvr-cyan motion-safe:animate-pulse",
|
|
32
|
+
strokeWidth: 2
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
s,
|
|
36
|
+
t.state === "ringing" && /* @__PURE__ */ e(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: a,
|
|
41
|
+
className: "ml-0.5 grid h-4 w-4 place-items-center rounded-full text-slate-500 hover:bg-slate-200 hover:text-slate-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
42
|
+
"aria-label": "Stop ringing",
|
|
43
|
+
"data-tip": "Stop ringing",
|
|
44
|
+
children: /* @__PURE__ */ e(y, { className: "h-3 w-3", strokeWidth: 2 })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function U() {
|
|
52
|
+
const t = w(X, z, () => 0);
|
|
53
|
+
return t ? /* @__PURE__ */ c(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: "inline-flex h-6 items-center gap-1 rounded-full bg-slate-200/70 px-2 text-[11px] text-slate-600 dark:bg-white/10 dark:text-slate-300",
|
|
57
|
+
"data-tip": `${t} held until you leave — the inbox already has ${t === 1 ? "it" : "them"}`,
|
|
58
|
+
"data-huddle-held": t,
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ e(R, { className: "h-3 w-3", strokeWidth: 2 }),
|
|
61
|
+
t,
|
|
62
|
+
" held"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
) : null;
|
|
66
|
+
}
|
|
67
|
+
function v({
|
|
68
|
+
stream: t,
|
|
69
|
+
label: a,
|
|
70
|
+
mirror: s,
|
|
71
|
+
screen: o
|
|
10
72
|
}) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
-
|
|
73
|
+
const r = k(null), l = k(null);
|
|
74
|
+
return S(() => {
|
|
75
|
+
const n = r.current;
|
|
76
|
+
if (n)
|
|
77
|
+
return n.srcObject = t, n.play().catch(() => null), () => {
|
|
78
|
+
n.srcObject = null;
|
|
17
79
|
};
|
|
18
|
-
}, [
|
|
80
|
+
}, [t]), /* @__PURE__ */ c(
|
|
19
81
|
"div",
|
|
20
82
|
{
|
|
83
|
+
ref: l,
|
|
21
84
|
className: p(
|
|
22
|
-
"group relative overflow-hidden rounded-lg bg-[#0f172a]",
|
|
23
|
-
|
|
85
|
+
"group relative overflow-hidden rounded-lg bg-[#0f172a] [&:fullscreen]:flex [&:fullscreen]:max-h-none [&:fullscreen]:items-center [&:fullscreen]:rounded-none",
|
|
86
|
+
s ? "max-h-[120px]" : "max-h-[280px]"
|
|
24
87
|
),
|
|
25
|
-
"data-huddle-screen":
|
|
88
|
+
"data-huddle-screen": s ? "mine" : "peer",
|
|
26
89
|
children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
"video",
|
|
92
|
+
{
|
|
93
|
+
ref: r,
|
|
94
|
+
muted: !0,
|
|
95
|
+
playsInline: !0,
|
|
96
|
+
className: "mx-auto block max-h-[inherit] w-auto max-w-full [:fullscreen>&]:h-full [:fullscreen>&]:max-h-full"
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
o && /* @__PURE__ */ e(q, { screen: o, videoRef: r, presenter: s }),
|
|
100
|
+
/* @__PURE__ */ e("span", { className: "absolute bottom-1.5 left-2 rounded bg-black/55 px-1.5 py-0.5 text-[10.5px] font-medium text-white", children: a }),
|
|
101
|
+
!s && /* @__PURE__ */ e(
|
|
30
102
|
"button",
|
|
31
103
|
{
|
|
32
104
|
type: "button",
|
|
33
105
|
onClick: () => {
|
|
34
|
-
var
|
|
35
|
-
return void ((
|
|
106
|
+
var n, d;
|
|
107
|
+
return void ((d = (n = l.current ?? r.current) == null ? void 0 : n.requestFullscreen) == null ? void 0 : d.call(n));
|
|
36
108
|
},
|
|
37
109
|
className: "absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded bg-black/55 text-white opacity-0 transition-opacity focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan group-hover:opacity-100",
|
|
38
110
|
"aria-label": "View the shared screen full size",
|
|
39
111
|
"data-tip": "Full screen",
|
|
40
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ e($, { className: "h-3.5 w-3.5", strokeWidth: 2 })
|
|
41
113
|
}
|
|
42
114
|
)
|
|
43
115
|
]
|
|
44
116
|
}
|
|
45
117
|
);
|
|
46
118
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
name: r,
|
|
57
|
-
muted: n,
|
|
58
|
-
screen: s,
|
|
59
|
-
connection: e,
|
|
60
|
-
renderAvatar: o
|
|
119
|
+
function N({
|
|
120
|
+
id: t,
|
|
121
|
+
name: a,
|
|
122
|
+
muted: s,
|
|
123
|
+
screen: o,
|
|
124
|
+
connection: r,
|
|
125
|
+
speaking: l = !1,
|
|
126
|
+
quality: n,
|
|
127
|
+
renderAvatar: d
|
|
61
128
|
}) {
|
|
62
|
-
const
|
|
63
|
-
return /* @__PURE__ */
|
|
129
|
+
const m = r === "new" || r === "connecting";
|
|
130
|
+
return /* @__PURE__ */ c(
|
|
64
131
|
"span",
|
|
65
132
|
{
|
|
66
133
|
className: p(
|
|
67
134
|
"inline-flex h-6 items-center gap-1 rounded-full bg-slate-100 pl-0.5 pr-2 text-[11px] text-slate-700 dark:bg-muted dark:text-slate-200",
|
|
68
|
-
|
|
69
|
-
|
|
135
|
+
m && "opacity-60",
|
|
136
|
+
r === "failed" && "text-red-600 dark:text-red-300"
|
|
70
137
|
),
|
|
71
|
-
"data-tip":
|
|
72
|
-
"data-huddle-person":
|
|
138
|
+
"data-tip": r === "failed" ? `${a ?? "Someone"} — connection failed` : m ? `${a ?? "Someone"} — connecting` : void 0,
|
|
139
|
+
"data-huddle-person": t,
|
|
73
140
|
children: [
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
n && /* @__PURE__ */
|
|
77
|
-
s && /* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ e(G, { speaking: l && !s, children: d(t, a) }),
|
|
142
|
+
/* @__PURE__ */ e("span", { className: "max-w-[120px] truncate", children: a ?? "Someone" }),
|
|
143
|
+
r === "connected" && n !== null && /* @__PURE__ */ e(I, { name: a ?? "Someone", quality: n }),
|
|
144
|
+
s && /* @__PURE__ */ e(O, { className: "h-3 w-3 text-slate-400", strokeWidth: 2, "aria-label": "muted" }),
|
|
145
|
+
o && /* @__PURE__ */ e(j, { className: "h-3 w-3 text-nvr-cyan", strokeWidth: 2, "aria-label": "sharing" })
|
|
78
146
|
]
|
|
79
147
|
}
|
|
80
148
|
);
|
|
81
149
|
}
|
|
82
|
-
function
|
|
83
|
-
room:
|
|
84
|
-
me:
|
|
85
|
-
huddle:
|
|
86
|
-
renderAvatar:
|
|
150
|
+
function he({
|
|
151
|
+
room: t,
|
|
152
|
+
me: a,
|
|
153
|
+
huddle: s,
|
|
154
|
+
renderAvatar: o
|
|
87
155
|
}) {
|
|
88
|
-
const { state:
|
|
89
|
-
|
|
90
|
-
return
|
|
156
|
+
const { state: r, inThis: l } = s, n = J(), d = L(), m = W(() => {
|
|
157
|
+
const i = new Map(n.order.map((h, g) => [h, g]));
|
|
158
|
+
return [...r.peers].sort(
|
|
159
|
+
(h, g) => (i.get(h.socket) ?? Number.MAX_SAFE_INTEGER) - (i.get(g.socket) ?? Number.MAX_SAFE_INTEGER)
|
|
160
|
+
);
|
|
161
|
+
}, [r.peers, n.order]), b = D(l, a), x = w(f.subscribe, f.getSnapshot).outgoing[t] ?? Y;
|
|
162
|
+
if (S(() => {
|
|
163
|
+
l || f.clearOutgoing(t);
|
|
164
|
+
}, [l, t]), r.status === "error" && (r.room === t || !r.room))
|
|
165
|
+
return /* @__PURE__ */ c(
|
|
91
166
|
"div",
|
|
92
167
|
{
|
|
93
168
|
className: "flex items-center gap-2 border-b border-red-200 bg-red-50 px-3 py-1.5 text-[11.5px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-200",
|
|
94
169
|
role: "alert",
|
|
95
170
|
"data-huddle-error": !0,
|
|
96
171
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ e(C, { className: "h-3.5 w-3.5 shrink-0", strokeWidth: 2, "aria-hidden": !0 }),
|
|
173
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1", children: r.error }),
|
|
174
|
+
/* @__PURE__ */ e(
|
|
99
175
|
"button",
|
|
100
176
|
{
|
|
101
177
|
type: "button",
|
|
102
|
-
onClick:
|
|
103
|
-
className: "flex h-5 w-5 items-center justify-center rounded hover:bg-red-100 dark:hover:bg-red-500/20",
|
|
178
|
+
onClick: s.clearError,
|
|
179
|
+
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded hover:bg-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-red-500/20",
|
|
104
180
|
"aria-label": "Dismiss",
|
|
105
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ e(y, { className: "h-3 w-3", strokeWidth: 2 })
|
|
106
182
|
}
|
|
107
183
|
)
|
|
108
184
|
]
|
|
109
185
|
}
|
|
110
186
|
);
|
|
111
|
-
if (!
|
|
112
|
-
const
|
|
113
|
-
return /* @__PURE__ */
|
|
187
|
+
if (!l) return null;
|
|
188
|
+
const u = r.peers.find((i) => i.video), H = r.status === "joining";
|
|
189
|
+
return /* @__PURE__ */ c(
|
|
114
190
|
"div",
|
|
115
191
|
{
|
|
116
|
-
className: "shrink-0 border-b border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-background motion-safe:animate-in motion-safe:fade-in motion-safe:duration-200",
|
|
192
|
+
className: "relative shrink-0 border-b border-slate-200 bg-slate-50 px-3 py-1.5 dark:border-border dark:bg-background motion-safe:animate-in motion-safe:fade-in motion-safe:duration-200",
|
|
117
193
|
"data-huddle-stage": !0,
|
|
194
|
+
"data-huddle-mode": r.mode,
|
|
118
195
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
] }),
|
|
124
|
-
!c && /* @__PURE__ */ t(w, { since: e.startedAt }),
|
|
125
|
-
/* @__PURE__ */ t("span", { className: "mx-0.5 h-3 w-px bg-slate-200 dark:bg-border", "aria-hidden": !0 }),
|
|
126
|
-
r && /* @__PURE__ */ t(
|
|
127
|
-
m,
|
|
196
|
+
/* @__PURE__ */ e(T, { room: t, me: a, huddle: s, pip: b, renderAvatar: o }),
|
|
197
|
+
/* @__PURE__ */ c("div", { className: "mt-1.5 flex flex-wrap items-center gap-1 text-[11px]", "data-huddle-people": !0, children: [
|
|
198
|
+
a && /* @__PURE__ */ e(
|
|
199
|
+
N,
|
|
128
200
|
{
|
|
129
|
-
id:
|
|
130
|
-
name:
|
|
131
|
-
muted:
|
|
132
|
-
screen:
|
|
133
|
-
|
|
201
|
+
id: a.id,
|
|
202
|
+
name: a.name,
|
|
203
|
+
muted: r.muted,
|
|
204
|
+
screen: r.sharing,
|
|
205
|
+
speaking: n.selfSpeaking,
|
|
206
|
+
quality: null,
|
|
207
|
+
renderAvatar: o
|
|
134
208
|
}
|
|
135
209
|
),
|
|
136
|
-
|
|
137
|
-
|
|
210
|
+
n.mutedTalking && /* @__PURE__ */ e(M, {}),
|
|
211
|
+
m.map((i) => /* @__PURE__ */ e(
|
|
212
|
+
N,
|
|
138
213
|
{
|
|
139
214
|
id: i.user,
|
|
140
215
|
name: i.name,
|
|
141
216
|
muted: i.muted,
|
|
142
217
|
screen: i.screen,
|
|
143
218
|
connection: i.connection,
|
|
144
|
-
|
|
219
|
+
speaking: !!n.speaking[i.socket],
|
|
220
|
+
quality: d.peers[i.socket],
|
|
221
|
+
renderAvatar: o
|
|
145
222
|
},
|
|
146
223
|
i.socket
|
|
147
224
|
)),
|
|
148
|
-
|
|
225
|
+
x.map((i) => /* @__PURE__ */ e(K, { p: i, onCancel: () => f.cancel(t) }, i.id)),
|
|
226
|
+
!H && r.peers.length === 0 && x.length === 0 && /* @__PURE__ */ e("span", { className: "px-1 text-slate-500 dark:text-slate-400", children: "Only you so far — people in the room see a Join button." }),
|
|
227
|
+
/* @__PURE__ */ e(U, {})
|
|
149
228
|
] }),
|
|
150
|
-
|
|
151
|
-
|
|
229
|
+
/* @__PURE__ */ e(F, { room: t }),
|
|
230
|
+
d.poor && /* @__PURE__ */ e(P, { sharing: r.sharing }),
|
|
231
|
+
/* @__PURE__ */ e(A, { roster: s.roster, self: r.self }),
|
|
232
|
+
/* @__PURE__ */ e(Q, { pip: b }),
|
|
233
|
+
/* @__PURE__ */ e(B, {}),
|
|
234
|
+
/* @__PURE__ */ e(_, { peers: r.peers, roster: s.roster, muted: r.muted }),
|
|
235
|
+
(u == null ? void 0 : u.video) && /* @__PURE__ */ e("div", { className: "mt-1.5", children: /* @__PURE__ */ e(
|
|
236
|
+
v,
|
|
237
|
+
{
|
|
238
|
+
stream: u.video,
|
|
239
|
+
label: `${u.name ?? "Someone"}'s screen`,
|
|
240
|
+
screen: u.socket
|
|
241
|
+
}
|
|
242
|
+
) }),
|
|
243
|
+
r.sharing && r.localScreen && /* @__PURE__ */ e("div", { className: "mt-1.5", children: /* @__PURE__ */ e(
|
|
244
|
+
v,
|
|
152
245
|
{
|
|
153
|
-
stream:
|
|
154
|
-
label:
|
|
246
|
+
stream: r.localScreen,
|
|
247
|
+
label: "You are sharing your screen",
|
|
248
|
+
mirror: !0,
|
|
249
|
+
screen: r.self
|
|
155
250
|
}
|
|
156
251
|
) }),
|
|
157
|
-
|
|
252
|
+
/* @__PURE__ */ e(V, { roster: s.roster, me: a })
|
|
158
253
|
]
|
|
159
254
|
}
|
|
160
255
|
);
|
|
161
256
|
}
|
|
162
257
|
export {
|
|
163
|
-
|
|
258
|
+
he as HuddleStage
|
|
164
259
|
};
|