@nivaro/react 0.3.57 → 0.3.59

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 (69) hide show
  1. package/dist/components/fields/RelationField.js +110 -80
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useRelationOptions.js +1 -0
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +37 -2
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2693 -2619
  8. package/dist/shared/components/DataTable.js +538 -495
  9. package/dist/shared/components/ItemEditForm.js +4559 -4386
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/ProfileView.js +716 -715
  12. package/dist/shared/components/QueryTable.js +74 -74
  13. package/dist/shared/components/RecordReadView.js +367 -364
  14. package/dist/shared/components/ReportView.js +64 -39
  15. package/dist/shared/components/WidgetSlot.js +543 -520
  16. package/dist/shared/components/alerts/AlertManagerView.js +324 -317
  17. package/dist/shared/components/alerts/types.js +37 -14
  18. package/dist/shared/components/cbv/row-focus.js +19 -0
  19. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  20. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  21. package/dist/shared/components/integrations/console/tone.js +52 -30
  22. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  23. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  24. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  25. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  26. package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
  27. package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
  28. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  29. package/dist/shared/components/item-edit/PlanGrid.js +973 -894
  30. package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
  31. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  32. package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
  33. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
  34. package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
  35. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  36. package/dist/shared/components/item-edit/line-midair.js +82 -75
  37. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  38. package/dist/shared/components/item-edit/related-missing.js +45 -0
  39. package/dist/shared/components/item-edit/save-outcome.js +9 -7
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  41. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  42. package/dist/shared/components/panels/ItemLockBanner.js +213 -211
  43. package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
  44. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  45. package/dist/shared/components/panels/RevisionsPanel.js +316 -299
  46. package/dist/shared/components/panels/TaskPanel.js +265 -249
  47. package/dist/shared/components/panels/landing-state.js +27 -0
  48. package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
  49. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  50. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  51. package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
  52. package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
  53. package/dist/shared/components/queue/group-sums.js +27 -0
  54. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  55. package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
  56. package/dist/shared/lib/back-closes.js +25 -0
  57. package/dist/shared/lib/display-prefs.js +60 -52
  58. package/dist/shared/lib/draft-store.js +71 -48
  59. package/dist/shared/lib/expression.js +53 -53
  60. package/dist/shared/lib/form-usage-beacon.js +7 -7
  61. package/dist/shared/lib/list-page-memory.js +63 -0
  62. package/dist/shared/lib/live.js +44 -44
  63. package/dist/shared/lib/money-input.js +45 -0
  64. package/dist/shared/lib/own-writes.js +76 -28
  65. package/dist/shared/lib/request-gate.js +110 -109
  66. package/dist/shared/lib/sanitize-html.js +10 -6
  67. package/dist/shared/lib/staged-row-labels.js +18 -0
  68. package/dist/shared/lib/validation-rules.js +34 -19
  69. 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
  };