@nivaro/react 0.3.41 → 0.3.43

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 (97) 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 +733 -15
  5. package/dist/index.js +820 -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/ProfileView.js +776 -1003
  20. package/dist/shared/components/RecentRecordsRail.js +34 -16
  21. package/dist/shared/components/RecordReadView.js +500 -477
  22. package/dist/shared/components/Skeletons.js +199 -0
  23. package/dist/shared/components/SlowNotice.js +63 -0
  24. package/dist/shared/components/Term.js +23 -0
  25. package/dist/shared/components/WidgetSlot.js +350 -353
  26. package/dist/shared/components/access/PermissionSummary.js +106 -0
  27. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  28. package/dist/shared/components/chat/ChatPanel.js +902 -886
  29. package/dist/shared/components/chat/MemberPaging.js +70 -0
  30. package/dist/shared/components/chat/RoomParts.js +147 -117
  31. package/dist/shared/components/chat/ScreenClip.js +73 -69
  32. package/dist/shared/components/chat/chat-core.js +449 -396
  33. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  34. package/dist/shared/components/help-videos/api.js +2 -5
  35. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  36. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  37. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  38. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  39. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  40. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  41. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  42. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  43. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  44. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  45. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  46. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  47. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  48. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  49. package/dist/shared/components/item-edit/field-sources.js +33 -0
  50. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  51. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  52. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  53. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  54. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  55. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  56. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  57. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  58. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  59. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  60. package/dist/shared/components/list/InlineEdit.js +363 -0
  61. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  62. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  63. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  64. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  65. package/dist/shared/components/notifications/changes-lines.js +24 -0
  66. package/dist/shared/components/notifications/why-lines.js +64 -0
  67. package/dist/shared/components/panels/CommentPanel.js +316 -281
  68. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  69. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  70. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  71. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  72. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  73. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  74. package/dist/shared/components/profile/PersonProfile.js +57 -52
  75. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  76. package/dist/shared/hooks/useSlowReason.js +39 -0
  77. package/dist/shared/lib/activity-sentence.js +670 -0
  78. package/dist/shared/lib/config-sentences.js +418 -0
  79. package/dist/shared/lib/core-glossary.js +229 -0
  80. package/dist/shared/lib/error-hints.js +159 -0
  81. package/dist/shared/lib/error-message.js +105 -0
  82. package/dist/shared/lib/error-toast.js +22 -0
  83. package/dist/shared/lib/field-comments.js +25 -0
  84. package/dist/shared/lib/filter-sentence.js +261 -0
  85. package/dist/shared/lib/glossary.js +55 -48
  86. package/dist/shared/lib/idle-reload.js +138 -0
  87. package/dist/shared/lib/layout-resolve.js +42 -29
  88. package/dist/shared/lib/list-inline-edit.js +190 -0
  89. package/dist/shared/lib/list-link.js +147 -0
  90. package/dist/shared/lib/nav-trail.js +107 -0
  91. package/dist/shared/lib/prefetch.js +259 -106
  92. package/dist/shared/lib/record-ref.js +72 -0
  93. package/dist/shared/lib/reload-holds.js +25 -0
  94. package/dist/shared/lib/safe-error.js +52 -24
  95. package/dist/shared/lib/skeleton-shapes.js +72 -0
  96. package/dist/shared/lib/slow-reason.js +63 -0
  97. package/package.json +1 -1
@@ -1,51 +1,58 @@
1
- import { jsxs as c, jsx as d, Fragment as k } from "react/jsx-runtime";
1
+ import { jsxs as l, Fragment as g, jsx as n } from "react/jsx-runtime";
2
2
  import { PauseCircle as T, RotateCw as C } from "lucide-react";
3
- import { useState as p, useRef as b, useEffect as E } from "react";
4
- import { markReloadFor as R } from "../lib/client-version.js";
5
- import { shouldObeyForceReload as D, thisTabForReload as M } from "../lib/force-reload.js";
6
- import { subscribeUnsavedWork as O, prepareForReload as y, beginReloadForUpdate as L, unsavedWorkLabels as S } from "../lib/unsaved-work.js";
3
+ import { useState as p, useRef as b, useEffect as k } from "react";
4
+ import { markReloadFor as E } from "../lib/client-version.js";
5
+ import { shouldObeyForceReload as D, thisTabForReload as I } from "../lib/force-reload.js";
6
+ import { subscribeUnsavedWork as M, prepareForReload as y, beginReloadForUpdate as L, unsavedWorkLabels as O } from "../lib/unsaved-work.js";
7
+ import { IdleReloadWatcher as S } from "./IdleReloadWatcher.js";
7
8
  const F = "nvr:force-refresh";
8
- function B() {
9
- const [r, N] = p(null), [j, g] = p(() => Date.now()), [w, l] = p([]), n = b(!1), m = b(!1), v = b(/* @__PURE__ */ new Set());
10
- E(() => {
11
- const o = (s) => {
12
- const e = s.detail ?? {}, t = typeof e.id == "string" && e.id ? e.id : null;
13
- if (t && v.current.has(t) || !D(e, M())) return;
14
- t && v.current.add(t), m.current = !1, l([]);
15
- const h = Math.max(5, Number(e.seconds) || 30), i = Date.now();
16
- N({ deadline: i + h * 1e3, message: String(e.message ?? ""), id: t }), g(i);
9
+ function V({ idleReload: r = !0 } = {}) {
10
+ return /* @__PURE__ */ l(g, { children: [
11
+ r && /* @__PURE__ */ n(S, {}),
12
+ /* @__PURE__ */ n(U, {})
13
+ ] });
14
+ }
15
+ function U() {
16
+ const [r, N] = p(null), [j, w] = p(() => Date.now()), [v, c] = p([]), a = b(!1), m = b(!1), x = b(/* @__PURE__ */ new Set());
17
+ k(() => {
18
+ const s = (i) => {
19
+ const e = i.detail ?? {}, t = typeof e.id == "string" && e.id ? e.id : null;
20
+ if (t && x.current.has(t) || !D(e, I())) return;
21
+ t && x.current.add(t), m.current = !1, c([]);
22
+ const h = Math.max(5, Number(e.seconds) || 30), d = Date.now();
23
+ N({ deadline: d + h * 1e3, message: String(e.message ?? ""), id: t }), w(d);
17
24
  };
18
- return window.addEventListener(F, o), () => window.removeEventListener(F, o);
19
- }, []), E(() => {
25
+ return window.addEventListener(F, s), () => window.removeEventListener(F, s);
26
+ }, []), k(() => {
20
27
  if (!r) return;
21
- const o = () => {
22
- n.current || (n.current = !0, r.id && R(r.id), window.location.reload(), setTimeout(() => {
23
- n.current = !1, m.current = !0, l(["unsaved changes on this page"]);
28
+ const s = () => {
29
+ a.current || (a.current = !0, r.id && E(r.id), window.location.reload(), setTimeout(() => {
30
+ a.current = !1, m.current = !0, c(["unsaved changes on this page"]);
24
31
  }, 1500));
25
32
  };
26
- let s = !1;
33
+ let i = !1;
27
34
  const e = () => {
28
- const i = Date.now();
29
- if (g(i), !(i < r.deadline || n.current || m.current || s)) {
30
- if (S().length === 0) {
31
- l((a) => a.length ? [] : a), o();
35
+ const d = Date.now();
36
+ if (w(d), !(d < r.deadline || a.current || m.current || i)) {
37
+ if (O().length === 0) {
38
+ c((o) => o.length ? [] : o), s();
32
39
  return;
33
40
  }
34
- s = !0, y().then((a) => {
35
- l((x) => x.join("|") === a.join("|") ? x : a), a.length === 0 && (L(), o());
41
+ i = !0, y().then((o) => {
42
+ c((R) => R.join("|") === o.join("|") ? R : o), o.length === 0 && (L(), s());
36
43
  }).finally(() => {
37
- s = !1;
44
+ i = !1;
38
45
  });
39
46
  }
40
47
  }, t = setInterval(e, 1e3);
41
48
  document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), window.addEventListener("pageshow", e);
42
- const h = O(() => setTimeout(e, 0));
49
+ const h = M(() => setTimeout(e, 0));
43
50
  return () => {
44
51
  clearInterval(t), document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e), window.removeEventListener("pageshow", e), h();
45
52
  };
46
53
  }, [r]);
47
- const u = r ? Math.max(0, Math.ceil((r.deadline - j) / 1e3)) : 0, f = u === 0 && w.length > 0;
48
- return r ? /* @__PURE__ */ c(
54
+ const u = r ? Math.max(0, Math.ceil((r.deadline - j) / 1e3)) : 0, f = u === 0 && v.length > 0;
55
+ return r ? /* @__PURE__ */ l(
49
56
  "div",
50
57
  {
51
58
  role: "alert",
@@ -54,27 +61,27 @@ function B() {
54
61
  "data-nvr-recording-hide": !0,
55
62
  className: "fixed inset-x-0 top-0 z-[150] flex items-center justify-center gap-3 border-b border-amber-300 bg-amber-50 px-4 py-2.5 text-[13px] text-amber-900 dark:border-amber-500/40 dark:bg-[#3a2e10] dark:text-amber-200",
56
63
  children: [
57
- f ? /* @__PURE__ */ d(T, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ d(C, { className: "h-4 w-4 shrink-0 animate-spin" }),
58
- /* @__PURE__ */ d("span", { children: f ? /* @__PURE__ */ c(k, { children: [
59
- /* @__PURE__ */ d("span", { className: "font-semibold", children: "A reload is waiting" }),
64
+ f ? /* @__PURE__ */ n(T, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ n(C, { className: "h-4 w-4 shrink-0 animate-spin" }),
65
+ /* @__PURE__ */ n("span", { children: f ? /* @__PURE__ */ l(g, { children: [
66
+ /* @__PURE__ */ n("span", { className: "font-semibold", children: "A reload is waiting" }),
60
67
  " — save or discard your changes (",
61
- w.join(", ").toLowerCase(),
68
+ v.join(", ").toLowerCase(),
62
69
  ") and the page reloads."
63
- ] }) : /* @__PURE__ */ c(k, { children: [
64
- /* @__PURE__ */ c("span", { className: "font-semibold", children: [
70
+ ] }) : /* @__PURE__ */ l(g, { children: [
71
+ /* @__PURE__ */ l("span", { className: "font-semibold", children: [
65
72
  "This page will reload in ",
66
73
  u,
67
74
  "s"
68
75
  ] }),
69
76
  r.message ? ` — ${r.message}` : " — an administrator pushed an update."
70
77
  ] }) }),
71
- /* @__PURE__ */ d(
78
+ /* @__PURE__ */ n(
72
79
  "button",
73
80
  {
74
81
  type: "button",
75
82
  onClick: async () => {
76
- n.current = !0, r.id && R(r.id), (await y()).length === 0 && L(), window.location.reload(), setTimeout(() => {
77
- n.current = !1;
83
+ a.current = !0, r.id && E(r.id), (await y()).length === 0 && L(), window.location.reload(), setTimeout(() => {
84
+ a.current = !1;
78
85
  }, 1500);
79
86
  },
80
87
  className: "shrink-0 rounded-md border border-amber-400 bg-white px-2.5 py-1 text-[12px] font-medium text-amber-800 hover:bg-amber-100 dark:bg-transparent dark:text-amber-200",
@@ -87,5 +94,5 @@ function B() {
87
94
  }
88
95
  export {
89
96
  F as FORCE_RELOAD_EVENT,
90
- B as ForceReloadBanner
97
+ V as ForceReloadBanner
91
98
  };
@@ -0,0 +1,69 @@
1
+ import { useEffect as f } from "react";
2
+ import { useOptionalNivaroClient as w } from "../context.js";
3
+ import { markReloadFor as b, reloadCountFor as h, clientVersion as g } from "../lib/client-version.js";
4
+ import { get as I } from "../lib/commands.js";
5
+ import { trackIdleReloadInput as k, restoreScrollAfterReload as R, decideIdleReload as L, saveScrollForReload as y, lastIdleReloadInput as E } from "../lib/idle-reload.js";
6
+ import { reloadHoldLabels as S } from "../lib/reload-holds.js";
7
+ import { subscribeUnsavedWork as _, unsavedWorkLabels as F } from "../lib/unsaved-work.js";
8
+ const C = 1e4;
9
+ function x() {
10
+ const r = w();
11
+ return f(() => (k(), R()), []), f(() => {
12
+ if (typeof window > "u") return;
13
+ let a = null, s = 0, n = !1, d = !1, i = !1, u = !0;
14
+ const m = async () => {
15
+ const e = g(), o = { tab: e.tab, loaded: String(e.loaded) };
16
+ e.build && (o.build = e.build), e.api && (o.api = e.api);
17
+ let l = null;
18
+ try {
19
+ if (r)
20
+ l = (await r.request(I("/realtime/build-status", o))).data;
21
+ else {
22
+ const c = await fetch(`/api/realtime/build-status?${new URLSearchParams(o)}`, {
23
+ credentials: "same-origin",
24
+ headers: { accept: "application/json" }
25
+ });
26
+ c.ok && (l = (await c.json()).data);
27
+ }
28
+ } catch {
29
+ l = null;
30
+ }
31
+ a = l ?? {
32
+ older: null,
33
+ target: null,
34
+ id: null,
35
+ reason: "unanswered",
36
+ auto_reload: { enabled: !0, idle_seconds: (a == null ? void 0 : a.auto_reload.idle_seconds) ?? 60 }
37
+ }, s = Date.now();
38
+ }, t = () => {
39
+ if (!u || n || i) return;
40
+ const e = L({
41
+ now: Date.now(),
42
+ lastInput: E(),
43
+ unsaved: F(),
44
+ holds: S(),
45
+ status: a,
46
+ statusAt: s,
47
+ reloadedFor: h,
48
+ declined: d
49
+ });
50
+ if (e.action === "check") {
51
+ n = !0, m().finally(() => {
52
+ n = !1, t();
53
+ });
54
+ return;
55
+ }
56
+ e.action === "reload" && (i = !0, b(e.id), y(), window.location.reload(), setTimeout(() => {
57
+ i = !1, d = !0;
58
+ }, 1500));
59
+ }, p = setInterval(t, C);
60
+ document.addEventListener("visibilitychange", t), window.addEventListener("pageshow", t);
61
+ const v = _(() => setTimeout(t, 0));
62
+ return () => {
63
+ u = !1, clearInterval(p), document.removeEventListener("visibilitychange", t), window.removeEventListener("pageshow", t), v();
64
+ };
65
+ }, [r]), null;
66
+ }
67
+ export {
68
+ x as IdleReloadWatcher
69
+ };