@nivaro/react 0.3.57 → 0.3.58

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 (50) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +5 -1
  4. package/dist/shared/components/CollectionBrowserView.js +2633 -2590
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  40. package/dist/shared/components/queue/QueueWorklist.js +357 -358
  41. package/dist/shared/components/queue/group-sums.js +27 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  43. package/dist/shared/lib/back-closes.js +25 -0
  44. package/dist/shared/lib/form-usage-beacon.js +7 -7
  45. package/dist/shared/lib/list-page-memory.js +41 -0
  46. package/dist/shared/lib/live.js +44 -44
  47. package/dist/shared/lib/own-writes.js +76 -28
  48. package/dist/shared/lib/request-gate.js +110 -109
  49. package/dist/shared/lib/validation-rules.js +34 -19
  50. package/package.json +1 -1
@@ -1,86 +1,89 @@
1
- import { jsx as e, jsxs as r, Fragment as m } from "react/jsx-runtime";
2
- import { useMutation as g, useQuery as f } from "@tanstack/react-query";
3
- import { Lock as k, Check as y, Send as N, ArrowLeft as v } from "lucide-react";
4
- import { useState as w } from "react";
5
- import { toast as x } from "sonner";
6
- import { useNivaroClient as q } from "../../context.js";
7
- import { post as C, get as S } from "../../lib/commands.js";
1
+ import { jsx as e, jsxs as n, Fragment as p } from "react/jsx-runtime";
2
+ import { useMutation as y, useQuery as k } from "@tanstack/react-query";
3
+ import { Lock as N, Check as v, Send as w, ArrowLeft as q } from "lucide-react";
4
+ import { useState as $ } from "react";
5
+ import { toast as b } from "sonner";
6
+ import { useNivaroClient as C } from "../../context.js";
7
+ import { post as A, get as S } from "../../lib/commands.js";
8
8
  const j = {
9
9
  access: !1,
10
10
  reasons: [{ type: "not_found", message: "There is no record with this id." }]
11
11
  };
12
- function A(a) {
13
- var n;
12
+ function F(a) {
13
+ var s;
14
14
  const t = a;
15
- return ((t == null ? void 0 : t.status) ?? ((n = t == null ? void 0 : t.response) == null ? void 0 : n.status)) === 404;
15
+ return ((t == null ? void 0 : t.status) ?? ((s = t == null ? void 0 : t.response) == null ? void 0 : s.status)) === 404;
16
16
  }
17
- function D({
17
+ function L(a, t) {
18
+ const d = t == null ? void 0 : t.trim();
19
+ if (d) return d.toLowerCase();
20
+ const s = a.replace(/_/g, " ").trim();
21
+ return /ies$/i.test(s) ? s.replace(/ies$/i, "y") : /[^su]s$/i.test(s) ? s.slice(0, -1) : s || "record";
22
+ }
23
+ function E({
18
24
  collection: a,
19
25
  itemId: t,
20
- onBack: o
26
+ noun: d,
27
+ onBack: s
21
28
  }) {
22
- const n = q(), [p, h] = w(!1), l = g({
23
- mutationFn: () => n.request(C("/access-requests", { collection: a, item: String(t) })),
29
+ const l = L(a, d), h = C(), [x, g] = $(!1), c = y({
30
+ mutationFn: () => h.request(A("/access-requests", { collection: a, item: String(t) })),
24
31
  onSuccess: () => {
25
- h(!0), x.success("Access request sent — an administrator has been notified");
32
+ g(!0), b.success("Access request sent — an administrator has been notified");
26
33
  },
27
- onError: () => x.error("Could not send the request")
28
- }), { data: i, isLoading: c } = f({
34
+ onError: () => b.error("Could not send the request")
35
+ }), { data: u, isLoading: m } = k({
29
36
  queryKey: ["access-explain", a, String(t)],
30
- queryFn: () => n.request(
37
+ queryFn: () => h.request(
31
38
  S(`/access-explain/${a}/${encodeURIComponent(t)}`)
32
- ).then((s) => s.data ?? null).catch((s) => A(s) ? j : null),
39
+ ).then((r) => r.data ?? null).catch((r) => F(r) ? j : null),
33
40
  staleTime: 3e4
34
- }), d = (i == null ? void 0 : i.reasons) ?? [], u = d.some((s) => s.type === "not_found");
35
- return /* @__PURE__ */ e("div", { className: "flex flex-1 items-start justify-center px-6 py-16", children: /* @__PURE__ */ r("div", { className: "w-full max-w-[560px] rounded-xl border border-slate-200 bg-white p-8 dark:border-border dark:bg-card", children: [
36
- /* @__PURE__ */ r("div", { className: "flex items-center gap-3", children: [
37
- /* @__PURE__ */ e("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ e(k, { className: "h-[18px] w-[18px] text-slate-500 dark:text-slate-400" }) }),
38
- /* @__PURE__ */ r("div", { children: [
39
- /* @__PURE__ */ e("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children: u ? "Record not found" : "You can't view this record" }),
40
- /* @__PURE__ */ r("p", { className: "break-all text-[12px] text-slate-500 dark:text-slate-400", children: [
41
- a.replace(/_/g, " "),
42
- " · #",
43
- t
44
- ] })
41
+ }), o = (u == null ? void 0 : u.reasons) ?? [], i = o.some((r) => r.type === "not_found");
42
+ return /* @__PURE__ */ e("div", { className: "flex flex-1 items-start justify-center px-6 py-16", children: /* @__PURE__ */ n("div", { className: "w-full max-w-[560px] rounded-xl border border-slate-200 bg-white p-8 dark:border-border dark:bg-card", children: [
43
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-3", children: [
44
+ /* @__PURE__ */ e("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ e(N, { className: "h-[18px] w-[18px] text-slate-500 dark:text-slate-400" }) }),
45
+ /* @__PURE__ */ n("div", { children: [
46
+ /* @__PURE__ */ e("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children: i ? `${l.charAt(0).toUpperCase()}${l.slice(1)} not found` : `You can't view this ${l}` }),
47
+ /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: i ? "The link may be wrong, or it was removed." : "It is outside what your access lets you see." })
45
48
  ] })
46
49
  ] }),
47
- /* @__PURE__ */ e("div", { className: "mt-5 space-y-2.5", children: c ? /* @__PURE__ */ r(m, { children: [
50
+ /* @__PURE__ */ e("div", { className: "mt-5 space-y-2.5", children: m ? /* @__PURE__ */ n(p, { children: [
48
51
  /* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-3/4 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
49
52
  /* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-1/2 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
50
- ] }) : d.length > 0 ? d.map((s, b) => /* @__PURE__ */ e(
53
+ ] }) : o.length > 0 ? o.map((r, f) => /* @__PURE__ */ e(
51
54
  "div",
52
55
  {
53
56
  className: "rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-2.5 text-[13px] leading-relaxed text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-300",
54
- children: s.message
57
+ children: r.message
55
58
  },
56
- `${s.type}-${s.dimension ?? b}`
59
+ `${r.type}-${r.dimension ?? f}`
57
60
  )) : /* @__PURE__ */ e("div", { className: "rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-2.5 text-[13px] leading-relaxed text-slate-700 dark:border-border dark:bg-muted/40 dark:text-slate-300", children: "This record could not be loaded. It may have been deleted, or an access rule may be hiding it." }) }),
58
- !u && !c && d.length > 0 && /* @__PURE__ */ e("p", { className: "mt-4 text-[12px] text-slate-500 dark:text-slate-400", children: "If you need access, request it below — an administrator gets the record and the reason attached, and can adjust your role's permissions or access filters." }),
59
- !u && !c && /* @__PURE__ */ e(
61
+ !i && !m && o.length > 0 && /* @__PURE__ */ e("p", { className: "mt-4 text-[12px] text-slate-500 dark:text-slate-400", children: "If you need access, request it below — an administrator gets the record and the reason attached, and can adjust your role's permissions or access filters." }),
62
+ !i && !m && /* @__PURE__ */ e(
60
63
  "button",
61
64
  {
62
65
  type: "button",
63
- disabled: p || l.isPending,
64
- onClick: () => l.mutate(),
66
+ disabled: x || c.isPending,
67
+ onClick: () => c.mutate(),
65
68
  className: "mt-3 inline-flex items-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-50",
66
69
  "data-request-access": !0,
67
- children: p ? /* @__PURE__ */ r(m, { children: [
68
- /* @__PURE__ */ e(y, { className: "h-3.5 w-3.5" }),
70
+ children: x ? /* @__PURE__ */ n(p, { children: [
71
+ /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5" }),
69
72
  " Request sent"
70
- ] }) : /* @__PURE__ */ r(m, { children: [
71
- /* @__PURE__ */ e(N, { className: "h-3.5 w-3.5" }),
72
- l.isPending ? "Sending…" : "Request access"
73
+ ] }) : /* @__PURE__ */ n(p, { children: [
74
+ /* @__PURE__ */ e(w, { className: "h-3.5 w-3.5" }),
75
+ c.isPending ? "Sending…" : "Request access"
73
76
  ] })
74
77
  }
75
78
  ),
76
- o && /* @__PURE__ */ r(
79
+ s && /* @__PURE__ */ n(
77
80
  "button",
78
81
  {
79
82
  type: "button",
80
- onClick: o,
83
+ onClick: s,
81
84
  className: "mt-5 inline-flex items-center gap-1.5 rounded-md border border-slate-200 px-3 py-1.5 text-[12px] font-medium text-slate-600 hover:bg-slate-50 dark:border-border dark:text-slate-300 dark:hover:bg-white/[0.03]",
82
85
  children: [
83
- /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5" }),
86
+ /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" }),
84
87
  "Go back"
85
88
  ]
86
89
  }
@@ -88,6 +91,7 @@ function D({
88
91
  ] }) });
89
92
  }
90
93
  export {
91
- D as AccessDeniedPanel,
92
- A as explainMissing
94
+ E as AccessDeniedPanel,
95
+ F as explainMissing,
96
+ L as recordNoun
93
97
  };
@@ -11,7 +11,7 @@ import { announceRecordTabs as Z, useRecordTabsSignal as He } from "../../lib/re
11
11
  import { noteTakeOverHold as ie } from "../item-edit/FieldAffordances.js";
12
12
  import { Button as O } from "../ui/button.js";
13
13
  import { Popover as ge, PopoverTrigger as we, PopoverContent as xe } from "../ui/popover.js";
14
- const ee = 1e4, _e = 1500, Je = 2e3, Ge = 5 * 6e4, Xe = 3e4, Ze = 6e4, et = 15e3, pe = 1500, tt = 6e4;
14
+ const ee = 1e4, _e = 1500, Je = 2e3, Ge = 5 * 6e4, Xe = 3e4, Ze = 6e4, et = 15e3, pe = 1500, tt = 1e4;
15
15
  function Le(e, t) {
16
16
  return e ? `${t ?? "Someone else"} took over editing — your changes are still here, but can’t be saved until they release it` : "Someone else started editing while you were away — your changes are still here, but can’t be saved until they release it";
17
17
  }
@@ -569,6 +569,7 @@ function gt({
569
569
  c,
570
570
  " — ",
571
571
  y,
572
+ " until the lock is released.",
572
573
  e.idle_minutes != null && e.idle_minutes >= 2 && /* @__PURE__ */ x(
573
574
  "span",
574
575
  {
@@ -582,8 +583,6 @@ function gt({
582
583
  ]
583
584
  }
584
585
  ),
585
- " ",
586
- "until the lock is released.",
587
586
  e.note && /* @__PURE__ */ x("span", { className: "mt-0.5 block text-[12.5px] text-amber-800/90 dark:text-amber-200/90", children: [
588
587
  "“",
589
588
  e.note,