@nivaro/react 0.3.40 → 0.3.42

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 (99) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +645 -16
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/PickerExcludedRows.js +3 -3
  20. package/dist/shared/components/ProfileView.js +776 -1003
  21. package/dist/shared/components/RecentRecordsRail.js +34 -16
  22. package/dist/shared/components/RecordReadView.js +500 -477
  23. package/dist/shared/components/Skeletons.js +199 -0
  24. package/dist/shared/components/SlowNotice.js +63 -0
  25. package/dist/shared/components/Term.js +23 -0
  26. package/dist/shared/components/WidgetSlot.js +350 -353
  27. package/dist/shared/components/access/PermissionSummary.js +106 -0
  28. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  29. package/dist/shared/components/chat/ChatPanel.js +902 -886
  30. package/dist/shared/components/chat/MemberPaging.js +70 -0
  31. package/dist/shared/components/chat/RoomParts.js +147 -117
  32. package/dist/shared/components/chat/ScreenClip.js +73 -69
  33. package/dist/shared/components/chat/chat-core.js +449 -396
  34. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  35. package/dist/shared/components/help-videos/api.js +2 -5
  36. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  37. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  38. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  39. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  40. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  41. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  42. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  43. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  44. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  45. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  46. package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
  47. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  48. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  49. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  50. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  51. package/dist/shared/components/item-edit/field-sources.js +33 -0
  52. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  53. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  54. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  55. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  56. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  57. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  58. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  59. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  60. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  61. package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
  62. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  63. package/dist/shared/components/list/InlineEdit.js +363 -0
  64. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  65. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  66. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  67. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  68. package/dist/shared/components/notifications/changes-lines.js +24 -0
  69. package/dist/shared/components/notifications/why-lines.js +64 -0
  70. package/dist/shared/components/panels/CommentPanel.js +316 -281
  71. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  72. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  73. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  74. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  75. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  76. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  77. package/dist/shared/components/profile/PersonProfile.js +57 -52
  78. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  79. package/dist/shared/hooks/useSlowReason.js +39 -0
  80. package/dist/shared/lib/activity-sentence.js +670 -0
  81. package/dist/shared/lib/config-sentences.js +418 -0
  82. package/dist/shared/lib/core-glossary.js +229 -0
  83. package/dist/shared/lib/error-hints.js +159 -0
  84. package/dist/shared/lib/error-message.js +105 -0
  85. package/dist/shared/lib/error-toast.js +22 -0
  86. package/dist/shared/lib/field-comments.js +25 -0
  87. package/dist/shared/lib/filter-sentence.js +261 -0
  88. package/dist/shared/lib/glossary.js +55 -48
  89. package/dist/shared/lib/idle-reload.js +138 -0
  90. package/dist/shared/lib/layout-resolve.js +42 -29
  91. package/dist/shared/lib/list-inline-edit.js +190 -0
  92. package/dist/shared/lib/list-link.js +147 -0
  93. package/dist/shared/lib/prefetch.js +259 -106
  94. package/dist/shared/lib/record-ref.js +72 -0
  95. package/dist/shared/lib/reload-holds.js +25 -0
  96. package/dist/shared/lib/safe-error.js +52 -24
  97. package/dist/shared/lib/skeleton-shapes.js +72 -0
  98. package/dist/shared/lib/slow-reason.js +63 -0
  99. package/package.json +1 -1
@@ -1,110 +1,114 @@
1
1
  import { jsxs as b, jsx as s } from "react/jsx-runtime";
2
- import { Clapperboard as v, Square as y } from "lucide-react";
3
- import { useState as k, useRef as m, useEffect as M } from "react";
4
- import { cn as N } from "../../lib/utils.js";
5
- import { useScreenCapture as S } from "../help-videos/recorder/useScreenCapture.js";
6
- const g = 6e4, w = "chat-clip", F = "chat-clip-poster";
7
- function _(r, n) {
2
+ import { Clapperboard as w, Square as k } from "lucide-react";
3
+ import { useState as M, useRef as m, useEffect as v } from "react";
4
+ import { registerReloadHold as N } from "../../lib/reload-holds.js";
5
+ import { cn as S } from "../../lib/utils.js";
6
+ import { useScreenCapture as $ } from "../help-videos/recorder/useScreenCapture.js";
7
+ const g = 6e4, x = "chat-clip", _ = "chat-clip-poster";
8
+ function j(r, n) {
8
9
  var l, c;
9
- const t = Array.isArray(r) ? r.map(String) : [];
10
- if (!t.includes(w) || n && !n.startsWith("video/")) return null;
11
- const e = ((l = t.find((i) => i.startsWith("poster:"))) == null ? void 0 : l.slice(7)) ?? null, o = Number((c = t.find((i) => i.startsWith("duration:"))) == null ? void 0 : c.slice(9));
10
+ const e = Array.isArray(r) ? r.map(String) : [];
11
+ if (!e.includes(x) || n && !n.startsWith("video/")) return null;
12
+ const t = ((l = e.find((i) => i.startsWith("poster:"))) == null ? void 0 : l.slice(7)) ?? null, o = Number((c = e.find((i) => i.startsWith("duration:"))) == null ? void 0 : c.slice(9));
12
13
  return {
13
- poster: e && /^[0-9a-f-]{36}$/i.test(e) ? e : null,
14
+ poster: t && /^[0-9a-f-]{36}$/i.test(t) ? t : null,
14
15
  durationMs: o > 0 ? o : null
15
16
  };
16
17
  }
17
- function A(r, n) {
18
- const t = [w, `duration:${Math.max(0, Math.round(n))}`];
19
- return r && t.push(`poster:${r}`), t;
18
+ function B(r, n) {
19
+ const e = [x, `duration:${Math.max(0, Math.round(n))}`];
20
+ return r && e.push(`poster:${r}`), e;
20
21
  }
21
- function $(r = /* @__PURE__ */ new Date()) {
22
- const n = (t) => String(t).padStart(2, "0");
22
+ function C(r = /* @__PURE__ */ new Date()) {
23
+ const n = (e) => String(e).padStart(2, "0");
23
24
  return `Screen clip ${r.getFullYear()}-${n(r.getMonth() + 1)}-${n(r.getDate())} ${n(r.getHours())}.${n(r.getMinutes())}.${n(r.getSeconds())}.webm`;
24
25
  }
25
- function C(r) {
26
+ function R(r) {
26
27
  if (!r) return "";
27
28
  const n = Math.max(1, Math.round(r / 1e3));
28
29
  return n < 60 ? `${n} s` : `${Math.floor(n / 60)}:${String(n % 60).padStart(2, "0")}`;
29
30
  }
30
- function R() {
31
+ function L() {
31
32
  var r;
32
33
  return typeof navigator < "u" && !!((r = navigator.mediaDevices) != null && r.getDisplayMedia) && typeof MediaRecorder < "u";
33
34
  }
34
- async function L(r, n = 640) {
35
+ async function T(r, n = 640) {
35
36
  if (typeof document > "u") return null;
36
- const t = URL.createObjectURL(r);
37
+ const e = URL.createObjectURL(r);
37
38
  try {
38
- const e = document.createElement("video");
39
- e.muted = !0, e.playsInline = !0, e.preload = "auto", e.src = t, await new Promise((d, h) => {
39
+ const t = document.createElement("video");
40
+ t.muted = !0, t.playsInline = !0, t.preload = "auto", t.src = e, await new Promise((d, h) => {
40
41
  const f = setTimeout(() => h(new Error("timeout")), 4e3);
41
- e.onloadeddata = () => {
42
+ t.onloadeddata = () => {
42
43
  clearTimeout(f), d();
43
- }, e.onerror = () => {
44
+ }, t.onerror = () => {
44
45
  clearTimeout(f), h(new Error("decode"));
45
46
  };
46
- }), e.currentTime === 0 && Number.isFinite(e.duration) && (e.currentTime = Math.min(0.2, e.duration / 2), await new Promise((d) => {
47
- e.onseeked = () => d(), setTimeout(d, 800);
47
+ }), t.currentTime === 0 && Number.isFinite(t.duration) && (t.currentTime = Math.min(0.2, t.duration / 2), await new Promise((d) => {
48
+ t.onseeked = () => d(), setTimeout(d, 800);
48
49
  }));
49
- const o = e.videoWidth || 640, l = e.videoHeight || 360, c = Math.min(1, n / o), i = document.createElement("canvas");
50
+ const o = t.videoWidth || 640, l = t.videoHeight || 360, c = Math.min(1, n / o), i = document.createElement("canvas");
50
51
  i.width = Math.round(o * c), i.height = Math.round(l * c);
51
52
  const a = i.getContext("2d");
52
- return a ? (a.drawImage(e, 0, 0, i.width, i.height), await new Promise((d) => i.toBlob(d, "image/png"))) : null;
53
+ return a ? (a.drawImage(t, 0, 0, i.width, i.height), await new Promise((d) => i.toBlob(d, "image/png"))) : null;
53
54
  } catch {
54
55
  return null;
55
56
  } finally {
56
- URL.revokeObjectURL(t);
57
+ URL.revokeObjectURL(e);
57
58
  }
58
59
  }
59
- function j({
60
+ function D({
60
61
  onClip: r,
61
62
  disabled: n
62
63
  }) {
63
- const [t, e] = k("idle"), o = m([]), l = m("video/webm"), c = m(!1), i = m(() => {
64
- }), a = S({
64
+ const [e, t] = M("idle"), o = m([]), l = m("video/webm"), c = m(!1), i = m(() => {
65
+ }), a = $({
65
66
  onLimit: () => i.current(),
66
67
  onSharingEnded: () => i.current()
67
68
  }), d = async () => {
68
69
  if (c.current || !a.isLive()) return;
69
- c.current = !0, e("finishing");
70
+ c.current = !0, t("finishing");
70
71
  const u = Math.min(g, a.meta().duration_ms);
71
72
  await a.halt();
72
73
  const p = new Blob(o.current, { type: l.current });
73
74
  o.current = [];
74
- const x = p.size ? await L(p) : null;
75
- p.size && r({ file: new File([p], $(), { type: l.current }), poster: x, durationMs: u }), e("idle"), c.current = !1;
75
+ const y = p.size ? await T(p) : null;
76
+ p.size && r({ file: new File([p], C(), { type: l.current }), poster: y, durationMs: u }), t("idle"), c.current = !1;
76
77
  };
77
- i.current = () => void d();
78
+ i.current = () => void d(), v(() => {
79
+ if (e !== "idle")
80
+ return N("A screen clip");
81
+ }, [e]);
78
82
  const h = a.elapsed;
79
- M(() => {
80
- t === "recording" && h >= g && i.current();
81
- }, [h, t]);
83
+ v(() => {
84
+ e === "recording" && h >= g && i.current();
85
+ }, [h, e]);
82
86
  const f = async () => {
83
- if (t === "idle") {
84
- e("asking"), a.reset(), o.current = [];
87
+ if (e === "idle") {
88
+ t("asking"), a.reset(), o.current = [];
85
89
  try {
86
90
  l.current = await a.acquire({ source: "screen", useMic: !0, micId: "default" });
87
91
  } catch {
88
- a.release(), e("idle");
92
+ a.release(), t("idle");
89
93
  return;
90
94
  }
91
95
  a.arm(l.current, (u) => {
92
96
  u.size && o.current.push(u);
93
- }), a.begin(!1), e("recording");
97
+ }), a.begin(!1), t("recording");
94
98
  }
95
99
  };
96
- if (!R()) return null;
97
- if (t === "recording" || t === "finishing") {
100
+ if (!L()) return null;
101
+ if (e === "recording" || e === "finishing") {
98
102
  const u = Math.max(0, g - a.elapsed), p = Math.min(100, a.elapsed / g * 100);
99
103
  return /* @__PURE__ */ b(
100
104
  "button",
101
105
  {
102
106
  type: "button",
103
107
  onClick: () => void d(),
104
- disabled: t === "finishing",
108
+ disabled: e === "finishing",
105
109
  className: "relative flex h-7 shrink-0 items-center gap-1.5 overflow-hidden rounded-md border border-red-300 bg-red-50 px-2 text-[11px] font-medium text-red-700 transition-colors hover:bg-red-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-60 dark:border-red-500/40 dark:bg-red-500/10 dark:text-red-200 dark:hover:bg-red-500/20",
106
- "aria-label": t === "finishing" ? "Finishing the clip" : "Stop recording the clip",
107
- "data-chat-clip": t,
110
+ "aria-label": e === "finishing" ? "Finishing the clip" : "Stop recording the clip",
111
+ "data-chat-clip": e,
108
112
  children: [
109
113
  /* @__PURE__ */ s(
110
114
  "span",
@@ -118,8 +122,8 @@ function j({
118
122
  /* @__PURE__ */ s("span", { className: "absolute inline-flex h-full w-full rounded-full bg-red-500 opacity-60 motion-safe:animate-ping" }),
119
123
  /* @__PURE__ */ s("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-red-500" })
120
124
  ] }),
121
- /* @__PURE__ */ s("span", { className: "relative tabular-nums", children: t === "finishing" ? "Saving…" : `${Math.ceil(u / 1e3)} s left` }),
122
- /* @__PURE__ */ s(y, { className: "relative h-3 w-3 fill-current", strokeWidth: 2 })
125
+ /* @__PURE__ */ s("span", { className: "relative tabular-nums", children: e === "finishing" ? "Saving…" : `${Math.ceil(u / 1e3)} s left` }),
126
+ /* @__PURE__ */ s(k, { className: "relative h-3 w-3 fill-current", strokeWidth: 2 })
123
127
  ]
124
128
  }
125
129
  );
@@ -129,23 +133,23 @@ function j({
129
133
  {
130
134
  type: "button",
131
135
  onClick: () => void f(),
132
- disabled: n || t === "asking",
133
- className: N(
136
+ disabled: n || e === "asking",
137
+ className: S(
134
138
  "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-200/70 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan disabled:opacity-40 dark:text-slate-400 dark:hover:bg-white/10 dark:hover:text-slate-100",
135
- t === "asking" && "text-nvr-cyan"
139
+ e === "asking" && "text-nvr-cyan"
136
140
  ),
137
141
  "aria-label": "Record a screen clip (up to 60 seconds)",
138
142
  "data-tip": "Record a screen clip — up to 60 s, with your microphone",
139
143
  "data-chat-clip": "idle",
140
- children: /* @__PURE__ */ s(v, { className: "h-4 w-4", strokeWidth: 2 })
144
+ children: /* @__PURE__ */ s(w, { className: "h-4 w-4", strokeWidth: 2 })
141
145
  }
142
146
  );
143
147
  }
144
- function B({
148
+ function U({
145
149
  url: r,
146
150
  poster: n,
147
- name: t,
148
- durationMs: e,
151
+ name: e,
152
+ durationMs: t,
149
153
  action: o
150
154
  }) {
151
155
  return /* @__PURE__ */ b("span", { className: "relative inline-block max-w-[320px]", "data-chat-clip-player": !0, children: [
@@ -158,27 +162,27 @@ function B({
158
162
  playsInline: !0,
159
163
  preload: n ? "none" : "metadata",
160
164
  className: "block max-h-[220px] w-full rounded-lg border border-slate-200 bg-[#0f172a] dark:border-border",
161
- "aria-label": t
165
+ "aria-label": e
162
166
  }
163
167
  ),
164
168
  /* @__PURE__ */ b("span", { className: "pointer-events-none absolute left-2 top-2 inline-flex items-center gap-1 rounded bg-black/55 px-1.5 py-0.5 text-[10.5px] font-medium text-white", children: [
165
- /* @__PURE__ */ s(v, { className: "h-3 w-3", strokeWidth: 2 }),
169
+ /* @__PURE__ */ s(w, { className: "h-3 w-3", strokeWidth: 2 }),
166
170
  "Clip",
167
- e ? ` · ${C(e)}` : ""
171
+ t ? ` · ${R(t)}` : ""
168
172
  ] }),
169
173
  o && /* @__PURE__ */ s("span", { className: "absolute right-1 top-1", children: o })
170
174
  ] });
171
175
  }
172
176
  export {
173
177
  g as CLIP_MAX_MS,
174
- F as CLIP_POSTER_TAG,
175
- w as CLIP_TAG,
176
- B as ClipPlayer,
177
- j as ScreenClipButton,
178
- R as canRecordClip,
179
- $ as clipFileName,
180
- _ as clipInfo,
181
- A as clipTags,
182
- C as formatClipLength,
183
- L as posterFromBlob
178
+ _ as CLIP_POSTER_TAG,
179
+ x as CLIP_TAG,
180
+ U as ClipPlayer,
181
+ D as ScreenClipButton,
182
+ L as canRecordClip,
183
+ C as clipFileName,
184
+ j as clipInfo,
185
+ B as clipTags,
186
+ R as formatClipLength,
187
+ T as posterFromBlob
184
188
  };