@nivaro/react 0.3.64 → 0.3.65

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 (64) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +49 -4
  4. package/dist/shared/components/CollectionBrowserView.js +3029 -2947
  5. package/dist/shared/components/ConformanceView.js +235 -221
  6. package/dist/shared/components/DataTable.js +478 -459
  7. package/dist/shared/components/ItemEditForm.js +4469 -4266
  8. package/dist/shared/components/PageRenderer.js +146 -138
  9. package/dist/shared/components/RecordDrilldownSheet.js +73 -65
  10. package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
  11. package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
  12. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +29 -23
  14. package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
  15. package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
  16. package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
  17. package/dist/shared/components/integrations/SendCurrentData.js +126 -0
  18. package/dist/shared/components/item-edit/CatalogPickerField.js +1530 -1437
  19. package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
  20. package/dist/shared/components/item-edit/FieldRow.js +413 -403
  21. package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
  22. package/dist/shared/components/item-edit/M2MCombobox.js +172 -168
  23. package/dist/shared/components/item-edit/MidairCollisionDialog.js +341 -114
  24. package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
  25. package/dist/shared/components/item-edit/PlanGrid.js +783 -724
  26. package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
  27. package/dist/shared/components/item-edit/RecordInsights.js +113 -111
  28. package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
  29. package/dist/shared/components/item-edit/RelationCombobox.js +332 -314
  30. package/dist/shared/components/item-edit/cascade-clear-notice.js +52 -0
  31. package/dist/shared/components/item-edit/collision-format.js +37 -0
  32. package/dist/shared/components/item-edit/field-a11y.js +25 -0
  33. package/dist/shared/components/item-edit/line-merge.js +58 -0
  34. package/dist/shared/components/item-edit/line-midair.js +94 -87
  35. package/dist/shared/components/item-edit/move-guard.js +17 -0
  36. package/dist/shared/components/item-edit/picker-search.js +22 -15
  37. package/dist/shared/components/item-edit/rail-width.js +8 -0
  38. package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
  39. package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
  40. package/dist/shared/components/panels/CommentPanel.js +142 -136
  41. package/dist/shared/components/panels/ItemLockBanner.js +246 -240
  42. package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
  43. package/dist/shared/components/panels/RevisionsPanel.js +106 -102
  44. package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
  45. package/dist/shared/components/panels/SlaClock.js +90 -68
  46. package/dist/shared/components/queue/QueueItemSheet.js +94 -87
  47. package/dist/shared/components/queue/QueueWorklist.js +1502 -1354
  48. package/dist/shared/components/queue/worklist-csv.js +75 -0
  49. package/dist/shared/components/queue/worklist-helpers.js +20 -0
  50. package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
  51. package/dist/shared/lib/bulk-copy.js +17 -0
  52. package/dist/shared/lib/cbv-export.js +122 -0
  53. package/dist/shared/lib/delete-offer.js +13 -0
  54. package/dist/shared/lib/error-hints.js +1 -0
  55. package/dist/shared/lib/leave-guard.js +41 -26
  56. package/dist/shared/lib/list-link.js +72 -56
  57. package/dist/shared/lib/live-queries.js +32 -30
  58. package/dist/shared/lib/moved-notice.js +25 -0
  59. package/dist/shared/lib/notification-target.js +56 -54
  60. package/dist/shared/lib/obligation-banner.js +11 -8
  61. package/dist/shared/lib/obligation-reason-text.js +6 -6
  62. package/dist/shared/lib/sort-cycle.js +6 -0
  63. package/dist/shared/lib/summary-mode.js +59 -41
  64. package/package.json +1 -1
@@ -1,78 +1,119 @@
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
- const j = {
1
+ import { jsx as t, jsxs as n, Fragment as h } from "react/jsx-runtime";
2
+ import { useMutation as w, useQuery as q } from "@tanstack/react-query";
3
+ import { Lock as $, Check as C, Send as A, ArrowLeft as S } from "lucide-react";
4
+ import { useState as f } from "react";
5
+ import { toast as y } from "sonner";
6
+ import { useNivaroClient as F } from "../../context.js";
7
+ import { post as L, get as T } from "../../lib/commands.js";
8
+ const _ = {
9
9
  access: !1,
10
10
  reasons: [{ type: "not_found", message: "There is no record with this id." }]
11
11
  };
12
- function F(a) {
12
+ function j(a) {
13
13
  var s;
14
- const t = a;
15
- return ((t == null ? void 0 : t.status) ?? ((s = t == null ? void 0 : t.response) == null ? void 0 : s.status)) === 404;
14
+ const e = a;
15
+ return ((e == null ? void 0 : e.status) ?? ((s = e == null ? void 0 : e.response) == null ? void 0 : s.status)) === 404;
16
16
  }
17
- function L(a, t) {
18
- const d = t == null ? void 0 : t.trim();
19
- if (d) return d.toLowerCase();
17
+ function E(a, e) {
18
+ const o = e == null ? void 0 : e.trim();
19
+ if (o) return o.toLowerCase();
20
20
  const s = a.replace(/_/g, " ").trim();
21
21
  return /ies$/i.test(s) ? s.replace(/ies$/i, "y") : /[^su]s$/i.test(s) ? s.slice(0, -1) : s || "record";
22
22
  }
23
- function E({
23
+ const b = 300;
24
+ function z({
24
25
  collection: a,
25
- itemId: t,
26
- noun: d,
26
+ itemId: e,
27
+ noun: o,
27
28
  onBack: s
28
29
  }) {
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) })),
30
+ const d = E(a, o), g = F(), [i, k] = f(!1), [c, N] = f(""), u = w({
31
+ mutationFn: () => g.request(
32
+ L("/access-requests", {
33
+ collection: a,
34
+ item: String(e),
35
+ ...c.trim() ? { note: c.trim().slice(0, b) } : {}
36
+ })
37
+ ),
31
38
  onSuccess: () => {
32
- g(!0), b.success("Access request sent — an administrator has been notified");
39
+ k(!0), y.success("Access request sent — an administrator has been notified");
33
40
  },
34
- onError: () => b.error("Could not send the request")
35
- }), { data: u, isLoading: m } = k({
36
- queryKey: ["access-explain", a, String(t)],
37
- queryFn: () => h.request(
38
- S(`/access-explain/${a}/${encodeURIComponent(t)}`)
39
- ).then((r) => r.data ?? null).catch((r) => F(r) ? j : null),
41
+ onError: () => y.error("Could not send the request")
42
+ }), { data: m, isLoading: x } = q({
43
+ queryKey: ["access-explain", a, String(e)],
44
+ queryFn: () => g.request(
45
+ T(`/access-explain/${a}/${encodeURIComponent(e)}`)
46
+ ).then((r) => r.data ?? null).catch((r) => j(r) ? _ : null),
40
47
  staleTime: 3e4
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: [
48
+ }), p = (m == null ? void 0 : m.reasons) ?? [], l = p.some((r) => r.type === "not_found");
49
+ return /* @__PURE__ */ t("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
50
  /* @__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" }) }),
51
+ /* @__PURE__ */ t("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-slate-100 dark:bg-muted", children: /* @__PURE__ */ t($, { className: "h-[18px] w-[18px] text-slate-500 dark:text-slate-400" }) }),
45
52
  /* @__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." })
53
+ /* @__PURE__ */ t("h2", { className: "text-[15px] font-semibold text-slate-800 dark:text-slate-100", children: l ? `${d.charAt(0).toUpperCase()}${d.slice(1)} not found` : `You can't view this ${d}` }),
54
+ /* @__PURE__ */ t("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: l ? "The link may be wrong, or it was removed." : "It is outside what your access lets you see." })
48
55
  ] })
49
56
  ] }),
50
- /* @__PURE__ */ e("div", { className: "mt-5 space-y-2.5", children: m ? /* @__PURE__ */ n(p, { children: [
51
- /* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-3/4 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
52
- /* @__PURE__ */ e("div", { className: "animate-pulse h-4 w-1/2 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
53
- ] }) : o.length > 0 ? o.map((r, f) => /* @__PURE__ */ e(
54
- "div",
55
- {
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",
57
- children: r.message
58
- },
59
- `${r.type}-${r.dimension ?? f}`
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." }) }),
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(
57
+ /* @__PURE__ */ t("div", { className: "mt-5 space-y-2.5", children: x ? /* @__PURE__ */ n(h, { children: [
58
+ /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-3/4 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
59
+ /* @__PURE__ */ t("div", { className: "animate-pulse h-4 w-1/2 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" })
60
+ ] }) : l ? null : p.length > 0 ? (
61
+ // A missing record is said once, in the heading (army11 f3: the
62
+ // page gave two different reasons for the same thing).
63
+ p.map((r, v) => /* @__PURE__ */ t(
64
+ "div",
65
+ {
66
+ 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",
67
+ children: r.message
68
+ },
69
+ `${r.type}-${r.dimension ?? v}`
70
+ ))
71
+ ) : /* @__PURE__ */ t("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." }) }),
72
+ !l && !x && !i && /* @__PURE__ */ n("div", { className: "mt-4", children: [
73
+ /* @__PURE__ */ n(
74
+ "label",
75
+ {
76
+ htmlFor: `access-note-${a}-${e}`,
77
+ className: "block text-[12px] font-medium text-slate-700 dark:text-slate-300",
78
+ children: [
79
+ "Need it? Say what for ",
80
+ /* @__PURE__ */ t("span", { className: "font-normal text-slate-500", children: "(optional)" })
81
+ ]
82
+ }
83
+ ),
84
+ /* @__PURE__ */ t(
85
+ "textarea",
86
+ {
87
+ id: `access-note-${a}-${e}`,
88
+ value: c,
89
+ onChange: (r) => N(r.target.value.slice(0, b)),
90
+ rows: 2,
91
+ maxLength: b,
92
+ placeholder: `e.g. I approve this ${d} for my team`,
93
+ className: "mt-1.5 w-full resize-y rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[13px] text-slate-800 placeholder:text-slate-400 focus:border-nvr-cyan focus:outline-none focus:ring-2 focus:ring-nvr-cyan/30 dark:border-border dark:bg-background dark:text-slate-100",
94
+ "data-request-access-note": !0
95
+ }
96
+ ),
97
+ /* @__PURE__ */ n("p", { className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400", children: [
98
+ "Every administrator gets your request with this ",
99
+ d,
100
+ " and your note."
101
+ ] })
102
+ ] }),
103
+ !l && !x && /* @__PURE__ */ t(
63
104
  "button",
64
105
  {
65
106
  type: "button",
66
- disabled: x || c.isPending,
67
- onClick: () => c.mutate(),
107
+ disabled: i || u.isPending,
108
+ onClick: () => u.mutate(),
68
109
  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",
69
110
  "data-request-access": !0,
70
- children: x ? /* @__PURE__ */ n(p, { children: [
71
- /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5" }),
111
+ children: i ? /* @__PURE__ */ n(h, { children: [
112
+ /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" }),
72
113
  " Request sent"
73
- ] }) : /* @__PURE__ */ n(p, { children: [
74
- /* @__PURE__ */ e(w, { className: "h-3.5 w-3.5" }),
75
- c.isPending ? "Sending…" : "Request access"
114
+ ] }) : /* @__PURE__ */ n(h, { children: [
115
+ /* @__PURE__ */ t(A, { className: "h-3.5 w-3.5" }),
116
+ u.isPending ? "Sending…" : "Request access"
76
117
  ] })
77
118
  }
78
119
  ),
@@ -83,7 +124,7 @@ function E({
83
124
  onClick: s,
84
125
  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]",
85
126
  children: [
86
- /* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" }),
127
+ /* @__PURE__ */ t(S, { className: "h-3.5 w-3.5" }),
87
128
  "Go back"
88
129
  ]
89
130
  }
@@ -91,7 +132,7 @@ function E({
91
132
  ] }) });
92
133
  }
93
134
  export {
94
- E as AccessDeniedPanel,
95
- F as explainMissing,
96
- L as recordNoun
135
+ z as AccessDeniedPanel,
136
+ j as explainMissing,
137
+ E as recordNoun
97
138
  };