@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.
Files changed (80) hide show
  1. package/dist/components/slots/TasksSlot.js +31 -29
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +414 -1
  5. package/dist/index.js +767 -716
  6. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  7. package/dist/shared/components/ItemEditForm.js +666 -658
  8. package/dist/shared/components/LoadErrorNote.js +49 -0
  9. package/dist/shared/components/MyWorkView.js +47 -37
  10. package/dist/shared/components/PretendDown.js +258 -0
  11. package/dist/shared/components/ProfileView.js +208 -184
  12. package/dist/shared/components/QueryErrorState.js +16 -0
  13. package/dist/shared/components/ReportView.js +1351 -1338
  14. package/dist/shared/components/WidgetSlot.js +438 -418
  15. package/dist/shared/components/ai/AiPlanCard.js +427 -0
  16. package/dist/shared/components/ai/AiPlanChanges.js +117 -0
  17. package/dist/shared/components/ai/TaskDo.js +1022 -0
  18. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  19. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  20. package/dist/shared/components/chaos/DrillTag.js +62 -0
  21. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  22. package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
  23. package/dist/shared/components/chat/ChatPanel.js +1356 -1317
  24. package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
  25. package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
  26. package/dist/shared/components/chat/chat-core.js +273 -264
  27. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
  28. package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
  29. package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
  30. package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
  31. package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
  32. package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
  33. package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
  34. package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
  35. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
  36. package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
  37. package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
  38. package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
  39. package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
  40. package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
  41. package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
  42. package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
  43. package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
  44. package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
  45. package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
  46. package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
  47. package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
  48. package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
  49. package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
  50. package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
  51. package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
  52. package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
  53. package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
  54. package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
  55. package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
  56. package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
  57. package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
  58. package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
  59. package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
  60. package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
  61. package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
  62. package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
  63. package/dist/shared/components/client-chaos-gate.js +51 -0
  64. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  65. package/dist/shared/components/item-edit/GroupSection.js +1 -0
  66. package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
  67. package/dist/shared/components/item-edit/UserChip.js +145 -142
  68. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  69. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  70. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  71. package/dist/shared/components/panels/TaskPanel.js +51 -49
  72. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  73. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  74. package/dist/shared/components/support/TicketDetailSheet.js +57 -42
  75. package/dist/shared/lib/client-chaos.js +359 -0
  76. package/dist/shared/lib/load-error.js +26 -0
  77. package/dist/shared/lib/notification-sound.js +25 -16
  78. package/dist/shared/lib/socket-realtime.js +31 -30
  79. package/dist/shared/lib/worker-socket.js +108 -89
  80. package/package.json +2 -1
@@ -1,58 +1,66 @@
1
- import { useQuery as f } from "@tanstack/react-query";
2
- import { useMemo as E, useCallback as x, useEffect as m, useSyncExternalStore as v } from "react";
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 b } from "../../../lib/commands.js";
4
+ import { get as c } from "../../../lib/commands.js";
5
5
  import { useOptionalRealtime as T } from "../../../lib/realtime.js";
6
- import { huddleSupport as j, huddleStore as t } from "./huddle-store.js";
7
- const l = [];
8
- function R(e) {
9
- const a = T(), c = M(), n = E(j, []), d = !!a && n.audio && !!e, o = x(
10
- (u) => c.request(b("/chat/huddle/ice", u ? { room: u } : {})).then((q) => q.data),
11
- [c]
12
- ), { data: r } = f({
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: () => o(),
15
- enabled: d,
19
+ queryFn: () => l(),
20
+ enabled: p,
16
21
  staleTime: 5 * 6e4
17
- }), p = d && (r == null ? void 0 : r.enabled) !== !1;
18
- m(() => {
19
- a && n.audio && t.attach(a, o);
20
- }, [a, n.audio, o]);
21
- const s = v(t.subscribe, t.getSnapshot), { data: i } = f({
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: () => c.request(
24
- b("/chat/huddle/presence", { room: e })
25
- ).then((u) => u.data.peers),
26
- enabled: p,
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
- m(() => {
31
- e && i && t.seedRoster(e, i);
32
- }, [e, i]);
33
- const g = v(
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) ?? i ?? l : l,
36
- () => l
37
- ), h = s.status === "joining" || s.status === "live", y = !!e && s.room === e && h, S = !!s.room && s.room !== e && h;
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: n,
40
- enabled: p,
41
- state: s,
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: g,
44
- inThis: y,
45
- inOther: S,
46
- maxParticipants: (r == null ? void 0 : r.max_participants) ?? 8,
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(!s.muted),
52
- toggleShare: () => s.sharing ? t.stopShare() : void t.startShare(),
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
- R as useHuddle
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
+ };