@nivaro/react 0.2.56 → 0.3.1
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 +414 -1
- package/dist/index.js +767 -716
- package/dist/shared/components/ClientChaosToolbar.js +410 -0
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/LoadErrorNote.js +49 -0
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/PretendDown.js +258 -0
- package/dist/shared/components/ProfileView.js +208 -184
- package/dist/shared/components/QueryErrorState.js +16 -0
- package/dist/shared/components/ReportView.js +1351 -1338
- package/dist/shared/components/WidgetSlot.js +438 -418
- 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/chaos/DeclareIncidentButton.js +72 -0
- package/dist/shared/components/chaos/DrillBanner.js +119 -0
- package/dist/shared/components/chaos/DrillTag.js +62 -0
- package/dist/shared/components/chaos/GameDayStrip.js +61 -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/client-chaos-gate.js +51 -0
- package/dist/shared/components/integrations/console/SignalCard.js +172 -167
- 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/layout-editor/EditorTopBar.js +108 -105
- package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
- package/dist/shared/components/pipeline/TeamsView.js +184 -169
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/client-chaos.js +359 -0
- package/dist/shared/lib/load-error.js +26 -0
- package/dist/shared/lib/notification-sound.js +25 -16
- package/dist/shared/lib/socket-realtime.js +31 -30
- package/dist/shared/lib/worker-socket.js +108 -89
- package/package.json +2 -1
|
@@ -1,58 +1,66 @@
|
|
|
1
|
-
import { useQuery as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { useQuery as b } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo as C, useCallback as S, useEffect as g, useSyncExternalStore as y } from "react";
|
|
3
3
|
import { useNivaroClient as M } from "../../../context.js";
|
|
4
|
-
import { get as
|
|
4
|
+
import { get as c } from "../../../lib/commands.js";
|
|
5
5
|
import { useOptionalRealtime as T } from "../../../lib/realtime.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { huddleCalls as j } from "./huddle-calls.js";
|
|
7
|
+
import { installHuddleCamera as R } from "./huddle-camera.js";
|
|
8
|
+
import { installHuddleDraw as k } from "./huddle-draw.js";
|
|
9
|
+
import { installHuddleReactions as F } from "./huddle-reactions.js";
|
|
10
|
+
import { huddleSupport as I, huddleStore as t } from "./huddle-store.js";
|
|
11
|
+
import { startHuddleExtras as K } from "./useHuddleAudio.js";
|
|
12
|
+
const h = [];
|
|
13
|
+
function G(e) {
|
|
14
|
+
const n = T(), o = M(), i = C(I, []), p = !!n && i.audio && !!e, l = S(
|
|
15
|
+
(a) => o.request(c("/chat/huddle/ice", a ? { room: a } : {})).then((d) => d.data),
|
|
16
|
+
[o]
|
|
17
|
+
), { data: s } = b({
|
|
13
18
|
queryKey: ["nvr-huddle-ice"],
|
|
14
|
-
queryFn: () =>
|
|
15
|
-
enabled:
|
|
19
|
+
queryFn: () => l(),
|
|
20
|
+
enabled: p,
|
|
16
21
|
staleTime: 5 * 6e4
|
|
17
|
-
}),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
}), m = p && (s == null ? void 0 : s.enabled) !== !1, f = S(
|
|
23
|
+
(a, d) => o.request(c("/chat/huddle/sfu-token", { room: a, socket: d })).then((H) => H.data),
|
|
24
|
+
[o]
|
|
25
|
+
);
|
|
26
|
+
g(() => {
|
|
27
|
+
!n || !i.audio || (F(), R(), k(), t.attach(n, l, f), K(), j.attach(n));
|
|
28
|
+
}, [n, i.audio, l, f]);
|
|
29
|
+
const r = y(t.subscribe, t.getSnapshot), { data: u } = b({
|
|
22
30
|
queryKey: ["nvr-huddle-presence", e],
|
|
23
|
-
queryFn: () =>
|
|
24
|
-
|
|
25
|
-
).then((
|
|
26
|
-
enabled:
|
|
31
|
+
queryFn: () => o.request(
|
|
32
|
+
c("/chat/huddle/presence", { room: e })
|
|
33
|
+
).then((a) => a.data.peers),
|
|
34
|
+
enabled: m,
|
|
27
35
|
staleTime: 2e4,
|
|
28
36
|
refetchInterval: 6e4
|
|
29
37
|
});
|
|
30
|
-
|
|
31
|
-
e &&
|
|
32
|
-
}, [e,
|
|
33
|
-
const
|
|
38
|
+
g(() => {
|
|
39
|
+
e && u && t.seedRoster(e, u);
|
|
40
|
+
}, [e, u]);
|
|
41
|
+
const q = y(
|
|
34
42
|
t.subscribeRosters,
|
|
35
|
-
() => e ? t.roster(e) ??
|
|
36
|
-
() =>
|
|
37
|
-
),
|
|
43
|
+
() => e ? t.roster(e) ?? u ?? h : h,
|
|
44
|
+
() => h
|
|
45
|
+
), v = r.status === "joining" || r.status === "live", E = !!e && r.room === e && v, x = !!r.room && r.room !== e && v;
|
|
38
46
|
return {
|
|
39
|
-
support:
|
|
40
|
-
enabled:
|
|
41
|
-
state:
|
|
47
|
+
support: i,
|
|
48
|
+
enabled: m,
|
|
49
|
+
state: r,
|
|
42
50
|
/** Everyone in this room's huddle (me included when I am in). */
|
|
43
|
-
roster:
|
|
44
|
-
inThis:
|
|
45
|
-
inOther:
|
|
46
|
-
maxParticipants: (
|
|
51
|
+
roster: q,
|
|
52
|
+
inThis: E,
|
|
53
|
+
inOther: x,
|
|
54
|
+
maxParticipants: (s == null ? void 0 : s.max_participants) ?? 8,
|
|
47
55
|
join: () => {
|
|
48
56
|
e && t.join(e);
|
|
49
57
|
},
|
|
50
58
|
leave: () => t.leave(),
|
|
51
|
-
toggleMute: () => t.setMuted(!
|
|
52
|
-
toggleShare: () =>
|
|
59
|
+
toggleMute: () => t.setMuted(!r.muted),
|
|
60
|
+
toggleShare: () => r.sharing ? t.stopShare() : void t.startShare(),
|
|
53
61
|
clearError: () => t.clearError()
|
|
54
62
|
};
|
|
55
63
|
}
|
|
56
64
|
export {
|
|
57
|
-
|
|
65
|
+
G as useHuddle
|
|
58
66
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useSyncExternalStore as u } from "react";
|
|
2
|
+
import { huddleDevices as s } from "./huddle-devices.js";
|
|
3
|
+
import { huddleQuality as t } from "./huddle-link-quality.js";
|
|
4
|
+
import { huddleShortcuts as e } from "./huddle-shortcuts.js";
|
|
5
|
+
import { huddleSpeaking as r } from "./huddle-speaking.js";
|
|
6
|
+
function p() {
|
|
7
|
+
r.start(), t.start(), e.start(), s.start();
|
|
8
|
+
}
|
|
9
|
+
function h() {
|
|
10
|
+
return u(
|
|
11
|
+
r.subscribe,
|
|
12
|
+
r.getSnapshot,
|
|
13
|
+
r.getSnapshot
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function S() {
|
|
17
|
+
return u(
|
|
18
|
+
t.subscribe,
|
|
19
|
+
t.getSnapshot,
|
|
20
|
+
t.getSnapshot
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function c() {
|
|
24
|
+
return u(
|
|
25
|
+
e.subscribe,
|
|
26
|
+
e.getSnapshot,
|
|
27
|
+
e.getSnapshot
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
p as startHuddleExtras,
|
|
32
|
+
S as useHuddleQuality,
|
|
33
|
+
c as useHuddleShortcuts,
|
|
34
|
+
h as useHuddleSpeaking
|
|
35
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useQuery as C } from "@tanstack/react-query";
|
|
2
|
+
import { useSyncExternalStore as u, useEffect as w } from "react";
|
|
3
|
+
import { useApiFetchConfig as g } from "../context.js";
|
|
4
|
+
import { subscribeClientChaos as c, getClientChaos as f, canUseClientChaos as m, stopClientChaos as S, pretendDownVersion as T } from "../lib/client-chaos.js";
|
|
5
|
+
const E = ["client-chaos", "status"];
|
|
6
|
+
function _(d) {
|
|
7
|
+
const t = m(d), { apiBase: r, authHeaders: h, credentials: p } = g(), s = C({
|
|
8
|
+
queryKey: [...E, r],
|
|
9
|
+
enabled: t,
|
|
10
|
+
staleTime: 6e4,
|
|
11
|
+
retry: !1,
|
|
12
|
+
queryFn: async () => {
|
|
13
|
+
var o, i;
|
|
14
|
+
try {
|
|
15
|
+
const a = await fetch(`${r}/chaos/status`, {
|
|
16
|
+
headers: h,
|
|
17
|
+
credentials: p,
|
|
18
|
+
cache: "no-store"
|
|
19
|
+
});
|
|
20
|
+
if (a.status === 404) return { present: !1, allowed: !1, reason: null };
|
|
21
|
+
const e = await a.json().catch(() => null);
|
|
22
|
+
return a.ok ? {
|
|
23
|
+
present: !0,
|
|
24
|
+
allowed: ((o = e == null ? void 0 : e.data) == null ? void 0 : o.allowed) === !0,
|
|
25
|
+
reason: ((i = e == null ? void 0 : e.data) == null ? void 0 : i.reason) ?? null
|
|
26
|
+
} : {
|
|
27
|
+
present: !0,
|
|
28
|
+
allowed: !1,
|
|
29
|
+
reason: (e == null ? void 0 : e.error) ?? `The server said ${a.status}.`
|
|
30
|
+
};
|
|
31
|
+
} catch {
|
|
32
|
+
return { present: !1, allowed: !1, reason: null };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}), n = t ? s.data ? { loading: !1, ...s.data } : { loading: s.isLoading, present: !1, allowed: !1, reason: null } : { loading: !1, present: !1, allowed: !1, reason: null }, l = !n.loading && !n.allowed && (s.isFetched || !t);
|
|
36
|
+
return w(() => {
|
|
37
|
+
l && f() && S();
|
|
38
|
+
}, [l]), n;
|
|
39
|
+
}
|
|
40
|
+
function x() {
|
|
41
|
+
return u(c, f, () => null);
|
|
42
|
+
}
|
|
43
|
+
function D() {
|
|
44
|
+
return u(c, T, () => 0);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
E as CLIENT_CHAOS_STATUS_KEY,
|
|
48
|
+
x as useClientChaos,
|
|
49
|
+
_ as useClientChaosGate,
|
|
50
|
+
D as usePretendDownVersion
|
|
51
|
+
};
|