@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
@@ -709,6 +709,7 @@ function Ln({
709
709
  "div",
710
710
  {
711
711
  "data-loads-on-open": se ? "" : void 0,
712
+ "data-section-key": t.key,
712
713
  className: W(
713
714
  "nvr-section-enter rounded-xl border border-slate-200 bg-white dark:bg-card dark:border-border",
714
715
  o && "bg-slate-50/60 dark:bg-slate-900/20",
@@ -1,115 +1,124 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { useQuery as R, useMutation as F } from "@tanstack/react-query";
3
- import { MessageSquare as L, X as P, Send as T, ChevronDown as A } from "lucide-react";
4
- import { useState as v, useRef as I, useEffect as K } from "react";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useQuery as $, useMutation as P } from "@tanstack/react-query";
3
+ import { MessageSquare as T, X as A, Send as H, ChevronDown as I } from "lucide-react";
4
+ import { useState as w, useRef as K, useEffect as M } from "react";
5
5
  import { toast as q } from "sonner";
6
- import { useNivaroClient as M } from "../../context.js";
7
- import { get as j, post as W } from "../../lib/commands.js";
8
- import { useRecordRoomTypes as z, canOpenChatRoom as Q, openChatRoom as X } from "../chat/chat-core.js";
9
- import { SimpleSelect as _ } from "../ui/SimpleSelect.js";
10
- function ee({
11
- collection: h,
12
- itemDraft: u,
13
- compact: a
6
+ import { useNivaroClient as W } from "../../context.js";
7
+ import { get as j, post as z } from "../../lib/commands.js";
8
+ import { useRecordRoomTypes as B, canOpenChatRoom as Q, openChatRoom as X } from "../chat/chat-core.js";
9
+ import { HuddleLiveBadge as _ } from "../chat/huddle/HuddleLiveBadge.js";
10
+ import { useHuddleLive as D } from "../chat/huddle/huddle-live.js";
11
+ import { SimpleSelect as G } from "../ui/SimpleSelect.js";
12
+ function ae({
13
+ collection: u,
14
+ itemDraft: h,
15
+ compact: s
14
16
  }) {
15
- const f = M(), [c, i] = v(!1), [b, O] = v(""), [p, y] = v(""), N = I(null), x = z(), l = x == null ? void 0 : x.find((e) => e.collection === h), o = l ? String(u[l.match_field] ?? "").trim() : "", g = u.id == null ? "" : String(u.id), { data: n } = R({
16
- queryKey: ["nvr-chat-record-room", h, g],
17
+ const f = W(), [c, l] = w(!1), [b, O] = w(""), [p, y] = w(""), N = K(null), x = B(), a = x == null ? void 0 : x.find((e) => e.collection === u), n = a ? String(h[a.match_field] ?? "").trim() : "", g = h.id == null ? "" : String(h.id), { data: r } = $({
18
+ queryKey: ["nvr-chat-record-room", u, g],
17
19
  queryFn: async () => (await f.request(
18
20
  j(
19
21
  "/chat/record-room",
20
- { collection: h, item: g }
22
+ { collection: u, item: g }
21
23
  )
22
24
  )).data ?? null,
23
- enabled: !!l && !!o && !!g,
25
+ enabled: !!a && !!n && !!g,
24
26
  staleTime: 3e4,
25
27
  refetchInterval: 6e4
26
- }), t = (n == null ? void 0 : n.unread) ?? 0, { data: $ } = R({
28
+ }), o = (r == null ? void 0 : r.unread) ?? 0, k = D(), L = k.countFor(r == null ? void 0 : r.room) || k.countFor(a && n ? `${a.prefix}:${n}` : null), { data: F } = $({
27
29
  queryKey: ["nvr-chat-share-rooms"],
28
30
  queryFn: async () => ((await f.request(j("/chat/rooms"))).data ?? []).filter((m) => m.kind !== "entity"),
29
31
  enabled: c,
30
32
  staleTime: 3e4
31
- }), w = F({
33
+ }), v = P({
32
34
  mutationFn: () => f.request(
33
- W("/chat/messages", {
35
+ z("/chat/messages", {
34
36
  room: b,
35
- message: p.trim() ? `${p.trim()} ${o}` : o,
37
+ message: p.trim() ? `${p.trim()} ${n}` : n,
36
38
  mentions: []
37
39
  })
38
40
  ),
39
41
  onSuccess: () => {
40
- q.success("Shared to chat"), i(!1), y("");
42
+ q.success("Shared to chat"), l(!1), y("");
41
43
  },
42
44
  onError: () => q.error("Could not share to that room")
43
45
  });
44
- if (K(() => {
46
+ if (M(() => {
45
47
  if (!c) return;
46
48
  const e = (m) => {
47
- var C, S;
49
+ var S, R;
48
50
  const d = m.target;
49
- (C = d == null ? void 0 : d.closest) != null && C.call(d, '[data-radix-popper-content-wrapper], [role="listbox"]') || (S = N.current) != null && S.contains(m.target) || i(!1);
51
+ (S = d == null ? void 0 : d.closest) != null && S.call(d, '[data-radix-popper-content-wrapper], [role="listbox"]') || (R = N.current) != null && R.contains(m.target) || l(!1);
50
52
  };
51
53
  return window.addEventListener("mousedown", e), () => window.removeEventListener("mousedown", e);
52
- }, [c]), !l || !o) return null;
53
- const E = `${l.prefix}:${o}`, k = Q();
54
- return /* @__PURE__ */ s("div", { ref: N, className: "relative", children: [
55
- /* @__PURE__ */ s(
54
+ }, [c]), !a || !n) return null;
55
+ const E = `${a.prefix}:${n}`, C = Q();
56
+ return /* @__PURE__ */ i("div", { ref: N, className: "relative", children: [
57
+ /* @__PURE__ */ i(
56
58
  "div",
57
59
  {
58
- className: a ? "inline-flex h-8 items-stretch text-sm font-medium" : "inline-flex h-9 items-stretch overflow-hidden rounded-md border border-input bg-background text-sm font-medium shadow-sm",
60
+ className: s ? "inline-flex h-8 items-stretch text-sm font-medium" : "inline-flex h-9 items-stretch overflow-hidden rounded-md border border-input bg-background text-sm font-medium shadow-sm",
59
61
  children: [
60
- /* @__PURE__ */ s(
62
+ /* @__PURE__ */ i(
61
63
  "button",
62
64
  {
63
65
  type: "button",
64
66
  onClick: () => {
65
- k ? X(E, o) : i((e) => !e);
67
+ C ? X(E, n) : l((e) => !e);
66
68
  },
67
- title: t ? `${t} unread in this record's chat` : n != null && n.messages ? `Open this record's chat · ${n.messages} messages` : "Open this record's chat room",
68
- "aria-label": t ? `Open this record's chat room, ${t} unread` : "Open this record's chat room",
69
- className: a ? "relative inline-flex w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex items-center gap-1.5 px-3 transition-colors hover:bg-accent hover:text-accent-foreground",
69
+ title: o ? `${o} unread in this record's chat` : r != null && r.messages ? `Open this record's chat · ${r.messages} messages` : "Open this record's chat room",
70
+ "aria-label": o ? `Open this record's chat room, ${o} unread` : "Open this record's chat room",
71
+ className: s ? "relative inline-flex w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex items-center gap-1.5 px-3 transition-colors hover:bg-accent hover:text-accent-foreground",
70
72
  "data-record-chat": !0,
71
- "data-record-chat-unread": t || void 0,
73
+ "data-record-chat-unread": o || void 0,
72
74
  children: [
73
- /* @__PURE__ */ r(L, { className: a ? "h-4 w-4" : "h-3.5 w-3.5", strokeWidth: 2 }),
74
- !a && "Chat",
75
- t > 0 && (a ? /* @__PURE__ */ r("span", { className: "absolute right-0.5 top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-red-500 px-0.5 text-[9px] font-bold leading-none text-white", children: t > 9 ? "9+" : t }) : /* @__PURE__ */ r("span", { className: "flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white", children: t > 99 ? "99+" : t }))
75
+ /* @__PURE__ */ t(T, { className: s ? "h-4 w-4" : "h-3.5 w-3.5", strokeWidth: 2 }),
76
+ !s && "Chat",
77
+ /* @__PURE__ */ t(
78
+ _,
79
+ {
80
+ count: L,
81
+ className: s ? "absolute -bottom-0.5 -right-0.5 bg-card px-1 py-0" : void 0
82
+ }
83
+ ),
84
+ o > 0 && (s ? /* @__PURE__ */ t("span", { className: "absolute right-0.5 top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-red-500 px-0.5 text-[9px] font-bold leading-none text-white", children: o > 9 ? "9+" : o }) : /* @__PURE__ */ t("span", { className: "flex h-4 min-w-4 items-center justify-center rounded-full bg-red-500 px-1 text-[10px] font-bold text-white", children: o > 99 ? "99+" : o }))
76
85
  ]
77
86
  }
78
87
  ),
79
- k && /* @__PURE__ */ r(
88
+ C && /* @__PURE__ */ t(
80
89
  "button",
81
90
  {
82
91
  type: "button",
83
- onClick: () => i((e) => !e),
92
+ onClick: () => l((e) => !e),
84
93
  title: "Send this record to a room",
85
94
  "aria-label": "Send this record to a room",
86
- className: a ? "inline-flex items-center px-1 transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex items-center border-l border-input px-1.5 transition-colors hover:bg-accent hover:text-accent-foreground",
95
+ className: s ? "inline-flex items-center px-1 transition-colors hover:bg-accent hover:text-accent-foreground" : "inline-flex items-center border-l border-input px-1.5 transition-colors hover:bg-accent hover:text-accent-foreground",
87
96
  "data-record-chat-more": !0,
88
- children: /* @__PURE__ */ r(A, { className: "h-3 w-3", strokeWidth: 2 })
97
+ children: /* @__PURE__ */ t(I, { className: "h-3 w-3", strokeWidth: 2 })
89
98
  }
90
99
  )
91
100
  ]
92
101
  }
93
102
  ),
94
- c && /* @__PURE__ */ s("div", { className: "absolute right-0 top-full z-30 mt-1 w-[260px] rounded-lg border border-slate-200 bg-white p-2.5 shadow-lg dark:border-border dark:bg-card", children: [
95
- /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between", children: [
96
- /* @__PURE__ */ s("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: [
103
+ c && /* @__PURE__ */ i("div", { className: "absolute right-0 top-full z-30 mt-1 w-[260px] rounded-lg border border-slate-200 bg-white p-2.5 shadow-lg dark:border-border dark:bg-card", children: [
104
+ /* @__PURE__ */ i("div", { className: "mb-1.5 flex items-center justify-between", children: [
105
+ /* @__PURE__ */ i("p", { className: "text-[12px] font-semibold text-slate-700 dark:text-slate-200", children: [
97
106
  "Share ",
98
- o
107
+ n
99
108
  ] }),
100
- /* @__PURE__ */ r(
109
+ /* @__PURE__ */ t(
101
110
  "button",
102
111
  {
103
112
  type: "button",
104
- onClick: () => i(!1),
113
+ onClick: () => l(!1),
105
114
  className: "text-slate-400 hover:text-slate-600",
106
115
  "aria-label": "Close",
107
- children: /* @__PURE__ */ r(P, { className: "h-3.5 w-3.5" })
116
+ children: /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5" })
108
117
  }
109
118
  )
110
119
  ] }),
111
- /* @__PURE__ */ r(
112
- _,
120
+ /* @__PURE__ */ t(
121
+ G,
113
122
  {
114
123
  value: b,
115
124
  onChange: O,
@@ -117,11 +126,11 @@ function ee({
117
126
  className: "mb-1.5 w-full",
118
127
  options: [
119
128
  { value: "", label: "Pick a room…" },
120
- ...($ ?? []).map((e) => ({ value: e.room, label: e.label ?? e.room }))
129
+ ...(F ?? []).map((e) => ({ value: e.room, label: e.label ?? e.room }))
121
130
  ]
122
131
  }
123
132
  ),
124
- /* @__PURE__ */ r(
133
+ /* @__PURE__ */ t(
125
134
  "textarea",
126
135
  {
127
136
  value: p,
@@ -132,17 +141,17 @@ function ee({
132
141
  "aria-label": "Note"
133
142
  }
134
143
  ),
135
- /* @__PURE__ */ s(
144
+ /* @__PURE__ */ i(
136
145
  "button",
137
146
  {
138
147
  type: "button",
139
- disabled: !b || w.isPending,
140
- onClick: () => w.mutate(),
148
+ disabled: !b || v.isPending,
149
+ onClick: () => v.mutate(),
141
150
  className: "flex h-8 w-full items-center justify-center gap-1.5 rounded-md bg-nvr-cyan text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-40",
142
151
  children: [
143
- /* @__PURE__ */ r(T, { className: "h-3.5 w-3.5" }),
152
+ /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5" }),
144
153
  " ",
145
- w.isPending ? "Sending…" : "Send"
154
+ v.isPending ? "Sending…" : "Send"
146
155
  ]
147
156
  }
148
157
  )
@@ -150,5 +159,5 @@ function ee({
150
159
  ] });
151
160
  }
152
161
  export {
153
- ee as RecordChatActions
162
+ ae as RecordChatActions
154
163
  };