@nivaro/react 0.3.67 → 0.3.69

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 (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +7 -0
  4. package/dist/index.js +836 -835
  5. package/dist/shared/components/ConformanceView.js +34 -34
  6. package/dist/shared/components/ReportView.js +196 -196
  7. package/dist/shared/components/SlaRulesView.js +36 -36
  8. package/dist/shared/components/chat/ChatPanel.js +484 -487
  9. package/dist/shared/components/chat/ChatViews.js +66 -66
  10. package/dist/shared/components/chat/RoomParts.js +159 -157
  11. package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
  12. package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
  13. package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
  14. package/dist/shared/components/item-edit/FieldRenderer.js +186 -182
  15. package/dist/shared/components/item-edit/FieldRow.js +87 -87
  16. package/dist/shared/components/item-edit/FileDownloadCount.js +94 -0
  17. package/dist/shared/components/item-edit/FilePickerField.js +350 -349
  18. package/dist/shared/components/item-edit/RecordInsights.js +90 -91
  19. package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
  20. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
  21. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +175 -138
  22. package/dist/shared/components/layout-editor/inspector/RulesTab.js +53 -52
  23. package/dist/shared/components/panels/AddendumPanel.js +409 -411
  24. package/dist/shared/components/panels/CommentPanel.js +169 -162
  25. package/dist/shared/components/panels/PipelinePanel.js +75 -75
  26. package/dist/shared/components/panels/RevisionsPanel.js +103 -103
  27. package/dist/shared/components/queue/QueueWorklist.js +142 -141
  28. package/dist/shared/lib/activity-sentence.js +154 -144
  29. package/dist/shared/lib/format-value.js +15 -15
  30. package/dist/shared/lib/placement-behaviour.js +39 -31
  31. package/dist/shared/lib/utils.js +58 -53
  32. package/package.json +1 -1
@@ -1,23 +1,23 @@
1
1
  import { jsxs as l, jsx as t, Fragment as $ } from "react/jsx-runtime";
2
- import { useQuery as P, useQueryClient as te, useMutation as Y } from "@tanstack/react-query";
3
- import { Clock as G, Search as _e, X as Te, CalendarClock as Re, GitCompareArrows as je, ChevronDown as Ae, ChevronRight as $e, MessageSquare as Oe, RotateCcw as ce, ArrowRight as Le } from "lucide-react";
4
- import { useState as w, useRef as qe, useMemo as R, createContext as Fe, useEffect as De, useContext as me } from "react";
2
+ import { useQuery as I, useQueryClient as te, useMutation as Y } from "@tanstack/react-query";
3
+ import { Clock as G, Search as Te, X as Re, CalendarClock as je, GitCompareArrows as Ae, ChevronDown as $e, ChevronRight as Oe, MessageSquare as qe, RotateCcw as me, ArrowRight as Fe } from "lucide-react";
4
+ import { useState as w, useRef as Le, useMemo as R, createContext as De, useEffect as Ee, useContext as pe } from "react";
5
5
  import { toast as A } from "sonner";
6
6
  import { useNivaroClient as D } from "../../context.js";
7
- import { o2mSentence as Ee, activityPredicate as Be, activityWhy as Pe, actorName as Ie } from "../../lib/activity-sentence.js";
8
- import { get as F, post as M } from "../../lib/commands.js";
9
- import { useLiveRecordQueries as Ke } from "../../lib/live.js";
10
- import { restoreSkippedNote as ne } from "../../lib/restore-skipped.js";
11
- import { formatDateTime as I, cn as T, titleCase as pe, toLocalDateString as Me } from "../../lib/utils.js";
7
+ import { o2mSentence as Be, activityPredicate as Pe, activityWhy as Ie, actorName as Ke } from "../../lib/activity-sentence.js";
8
+ import { get as L, post as M } from "../../lib/commands.js";
9
+ import { useLiveRecordQueries as Me } from "../../lib/live.js";
10
+ import { restoreSkippedNote as le } from "../../lib/restore-skipped.js";
11
+ import { formatDateTime as E, cn as T, titleCase as ue, toLocalDateString as ae } from "../../lib/utils.js";
12
12
  import { useActivityLabels as Ue } from "../ActivityEntry.js";
13
13
  import { AgentBadge as We } from "../AgentBadge.js";
14
14
  import { RelatedItemLabel as Ve } from "../item-edit/RelationCombobox.js";
15
- import { UserAvatar as ue } from "../UserAvatar.js";
15
+ import { UserAvatar as he } from "../UserAvatar.js";
16
16
  import { Button as U } from "../ui/button.js";
17
17
  import { Sheet as ze, SheetTrigger as He, SheetContent as Je, SheetHeader as Qe, SheetTitle as Ye } from "../ui/sheet.js";
18
18
  import { Skeleton as Ge } from "../ui/skeleton.js";
19
19
  import { IntegrationActivitySection as Xe } from "./IntegrationActivitySection.js";
20
- const X = (e) => e.id != null && (e.action === "create" || e.action === "update" || e.action === "delete" || e.action === "restore"), Ze = (e) => !X(e), L = (e) => {
20
+ const X = (e) => e.id != null && (e.action === "create" || e.action === "update" || e.action === "delete" || e.action === "restore"), Ze = (e) => !X(e), q = (e) => {
21
21
  var s;
22
22
  return e.id != null ? `r${e.id}` : `e${((s = e.event) == null ? void 0 : s.history_id) ?? ""}-${e.activity ?? ""}-${e.timestamp ?? ""}`;
23
23
  }, et = /* @__PURE__ */ new Set([
@@ -32,16 +32,16 @@ const X = (e) => e.id != null && (e.action === "create" || e.action === "update"
32
32
  "updated_at",
33
33
  "sort"
34
34
  ]);
35
- function he(e, s) {
36
- const d = D(), { data: a } = P({
35
+ function xe(e, s) {
36
+ const d = D(), { data: a } = I({
37
37
  queryKey: ["revisions-field-meta", e],
38
38
  enabled: s,
39
39
  staleTime: 3e5,
40
40
  queryFn: async () => {
41
41
  const [i, o] = await Promise.all([
42
- d.request(F(`/field-config/${e}`)).then((n) => n.data ?? []).catch(() => []),
42
+ d.request(L(`/field-config/${e}`)).then((n) => n.data ?? []).catch(() => []),
43
43
  d.request(
44
- F(`/collections/${e}`)
44
+ L(`/collections/${e}`)
45
45
  ).then((n) => {
46
46
  var r;
47
47
  return ((r = n.data) == null ? void 0 : r.relations) ?? [];
@@ -59,7 +59,7 @@ function he(e, s) {
59
59
  };
60
60
  for (const n of (a == null ? void 0 : a.fields) ?? [])
61
61
  n.field.startsWith("__") || i.set(n.field, {
62
- label: n.label || pe(n.field.replace(/_/g, " ")),
62
+ label: n.label || ue(n.field.replace(/_/g, " ")),
63
63
  // Hidden fields are machine columns (e.g. the retired "workflow_state
64
64
  // (legacy)" a save still writes) — folded with the system fields, not
65
65
  // listed among what a person changed (army8 b01).
@@ -76,7 +76,7 @@ function he(e, s) {
76
76
  function k(e, s) {
77
77
  return e.get(s) ?? {
78
78
  // Unknown to the form = machine column. Still labeled, still reachable.
79
- label: pe(s.replace(/[_-]/g, " ")),
79
+ label: ue(s.replace(/[_-]/g, " ")),
80
80
  system: !0,
81
81
  onLayout: !1
82
82
  };
@@ -93,15 +93,15 @@ function tt({ map: e, field: s }) {
93
93
  }
94
94
  );
95
95
  }
96
- const le = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, at = /^\d{4}-\d{2}-\d{2}(?:T00:00:00(?:\.0+)?Z)?$/;
96
+ const de = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/, at = /^\d{4}-\d{2}-\d{2}(?:T00:00:00(?:\.0+)?Z)?$/;
97
97
  function rt(e, s = !1) {
98
98
  if (e == null || e === "") return "";
99
99
  if (typeof e == "boolean") return e ? "Yes" : "No";
100
- if (typeof e == "string" && (at.test(e) || s && le.test(e)))
101
- return Me(e);
102
- if (typeof e == "string" && le.test(e)) {
100
+ if (typeof e == "string" && (at.test(e) || s && de.test(e)))
101
+ return ae(e);
102
+ if (typeof e == "string" && de.test(e)) {
103
103
  const d = new Date(e);
104
- if (!Number.isNaN(d.getTime())) return d.toLocaleString();
104
+ if (!Number.isNaN(d.getTime())) return E(d);
105
105
  }
106
106
  return typeof e == "object" ? JSON.stringify(e) : String(e);
107
107
  }
@@ -109,9 +109,9 @@ function W(e) {
109
109
  return e == null ? "" : typeof e == "object" ? JSON.stringify(e) : String(e);
110
110
  }
111
111
  function st({ collection: e, id: s }) {
112
- const d = D(), { data: a } = P({
112
+ const d = D(), { data: a } = I({
113
113
  queryKey: ["col-meta", e],
114
- queryFn: () => d.request(F(`/collections/${e}`)).then((i) => i.data),
114
+ queryFn: () => d.request(L(`/collections/${e}`)).then((i) => i.data),
115
115
  staleTime: 3e5,
116
116
  retry: !1
117
117
  });
@@ -127,8 +127,8 @@ function st({ collection: e, id: s }) {
127
127
  function nt(e) {
128
128
  return ee(e).join(" ");
129
129
  }
130
- const de = 160;
131
- function ie({
130
+ const ie = 160;
131
+ function oe({
132
132
  value: e,
133
133
  tone: s,
134
134
  dateOnly: d
@@ -136,7 +136,7 @@ function ie({
136
136
  const [a, i] = w(!1), o = rt(e, d);
137
137
  if (o === "")
138
138
  return /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" });
139
- const n = o.length > de, r = a || !n ? o : `${o.slice(0, de)}…`;
139
+ const n = o.length > ie, r = a || !n ? o : `${o.slice(0, ie)}…`;
140
140
  return /* @__PURE__ */ l("span", { className: "break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: [
141
141
  typeof e == "object" ? /* @__PURE__ */ t("span", { className: "font-mono text-[11px]", children: r }) : r,
142
142
  n && /* @__PURE__ */ t(
@@ -215,7 +215,7 @@ function dt({ field: e, ctl: s }) {
215
215
  title: "Set the field back to this revision’s value",
216
216
  "data-revert-field": e,
217
217
  children: [
218
- /* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
218
+ /* @__PURE__ */ t(me, { className: "h-3 w-3" }),
219
219
  "Revert"
220
220
  ]
221
221
  }
@@ -306,12 +306,12 @@ function mt(e, s, d) {
306
306
  (r, m) => n(r) - n(m) || k(d, r.field).label.localeCompare(k(d, m.field).label)
307
307
  );
308
308
  }
309
- function q({
309
+ function F({
310
310
  value: e,
311
311
  meta: s,
312
312
  tone: d
313
313
  }) {
314
- return e == null || e === "" ? /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" }) : s.relatedCollection && (typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ t("span", { className: "break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(st, { collection: s.relatedCollection, id: e }) }) : Z(e) ? /* @__PURE__ */ t(ie, { value: nt(e), tone: d }) : /* @__PURE__ */ t(ie, { value: e, tone: d, dateOnly: s.dateOnly });
314
+ return e == null || e === "" ? /* @__PURE__ */ t("span", { className: "text-[11.5px] italic text-slate-300 dark:text-slate-600", children: "empty" }) : s.relatedCollection && (typeof e == "string" || typeof e == "number") ? /* @__PURE__ */ t("span", { className: "break-words text-[12px] leading-relaxed text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(st, { collection: s.relatedCollection, id: e }) }) : Z(e) ? /* @__PURE__ */ t(oe, { value: nt(e), tone: d }) : /* @__PURE__ */ t(oe, { value: e, tone: d, dateOnly: s.dateOnly });
315
315
  }
316
316
  function pt({
317
317
  row: e,
@@ -354,10 +354,10 @@ function pt({
354
354
  after: K(e.after)
355
355
  }
356
356
  ) : e.status === "changed" || e.status === "removed" ? /* @__PURE__ */ l("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
357
- /* @__PURE__ */ t("span", { className: "max-w-full break-words text-[12px] text-rose-600 line-through decoration-rose-300 dark:text-rose-400", children: /* @__PURE__ */ t(q, { value: e.before, meta: k(s, e.field), tone: "before" }) }),
358
- /* @__PURE__ */ t(Le, { className: "h-3 w-3 shrink-0 self-center text-slate-300 dark:text-slate-600" }),
359
- /* @__PURE__ */ t(q, { value: e.after, meta: k(s, e.field), tone: "after" })
360
- ] }) : /* @__PURE__ */ t(q, { value: e.after ?? e.before, meta: k(s, e.field), tone: "after" }) })
357
+ /* @__PURE__ */ t("span", { className: "max-w-full break-words text-[12px] text-rose-600 line-through decoration-rose-300 dark:text-rose-400", children: /* @__PURE__ */ t(F, { value: e.before, meta: k(s, e.field), tone: "before" }) }),
358
+ /* @__PURE__ */ t(Fe, { className: "h-3 w-3 shrink-0 self-center text-slate-300 dark:text-slate-600" }),
359
+ /* @__PURE__ */ t(F, { value: e.after, meta: k(s, e.field), tone: "after" })
360
+ ] }) : /* @__PURE__ */ t(F, { value: e.after ?? e.before, meta: k(s, e.field), tone: "after" }) })
361
361
  ]
362
362
  }
363
363
  );
@@ -440,17 +440,17 @@ const ht = {
440
440
  restore: "bg-emerald-500",
441
441
  update: "bg-nvr-cyan",
442
442
  delete: "bg-red-500"
443
- }, ae = Fe(void 0);
444
- function B(e, s) {
443
+ }, re = De(void 0);
444
+ function P(e, s) {
445
445
  var d;
446
- return e.actor && e.actor.kind !== "person" ? Ie(e, s) : e.first_name || e.last_name ? [e.first_name, e.last_name].filter(Boolean).join(" ") : e.user_email ?? ((d = e.user_id) == null ? void 0 : d.slice(0, 8)) ?? "System";
446
+ return e.actor && e.actor.kind !== "person" ? Ke(e, s) : e.first_name || e.last_name ? [e.first_name, e.last_name].filter(Boolean).join(" ") : e.user_email ?? ((d = e.user_id) == null ? void 0 : d.slice(0, 8)) ?? "System";
447
447
  }
448
448
  function xt(e, s, d) {
449
449
  return e.action === "create" ? "created this record" : e.action === "restore" ? "restored this record from trash" : e.action === "delete" ? "deleted this record" : s > 0 ? `changed ${s} field${s === 1 ? "" : "s"}` : d > 0 ? "updated system fields" : "saved this record";
450
450
  }
451
451
  function ft({ revision: e, isLast: s }) {
452
452
  var x, p, u;
453
- const d = me(ae), a = e.event, i = (a == null ? void 0 : a.source) === "auto" || !e.user_id && (a == null ? void 0 : a.kind) === "transition", o = !i && ((x = a == null ? void 0 : a.on_behalf_of) != null && x.name) ? a.on_behalf_of.name : null, n = i ? "Automatic rule" : o ? `${B(e, d)}, for ${o}` : B(e, d);
453
+ const d = pe(re), a = e.event, i = (a == null ? void 0 : a.source) === "auto" || !e.user_id && (a == null ? void 0 : a.kind) === "transition", o = !i && ((x = a == null ? void 0 : a.on_behalf_of) != null && x.name) ? a.on_behalf_of.name : null, n = i ? "Automatic rule" : o ? `${P(e, d)}, for ${o}` : P(e, d);
454
454
  let r;
455
455
  (a == null ? void 0 : a.kind) === "transition" && a.addendum ? r = /* @__PURE__ */ l($, { children: [
456
456
  "moved",
@@ -496,8 +496,8 @@ function ft({ revision: e, isLast: s }) {
496
496
  ] }) : (a == null ? void 0 : a.kind) === "start" ? r = /* @__PURE__ */ l($, { children: [
497
497
  "started the pipeline",
498
498
  e.comment ? ` — ${e.comment.replace(/^Started pipeline\s*[—-]?\s*/i, "")}` : ""
499
- ] }) : (p = e.action) != null && p.startsWith("o2m-") ? r = /* @__PURE__ */ t("span", { "data-revision-o2m": !0, children: e.o2m ? Ee(e.o2m) : `${e.action === "o2m-create" ? "added" : e.action === "o2m-delete" ? "removed" : "changed"} related rows` }) : r = /* @__PURE__ */ l($, { children: [
500
- Be({ ...e, item: null }, d),
499
+ ] }) : (p = e.action) != null && p.startsWith("o2m-") ? r = /* @__PURE__ */ t("span", { "data-revision-o2m": !0, children: e.o2m ? Be(e.o2m) : `${e.action === "o2m-create" ? "added" : e.action === "o2m-delete" ? "removed" : "changed"} related rows` }) : r = /* @__PURE__ */ l($, { children: [
500
+ Pe({ ...e, item: null }, d),
501
501
  e.comment ? ` — ${e.comment}` : ""
502
502
  ] });
503
503
  const m = e.timestamp ? new Date(e.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) : "—";
@@ -527,7 +527,7 @@ function ft({ revision: e, isLast: s }) {
527
527
  ),
528
528
  /* @__PURE__ */ l("div", { className: "flex w-full items-start gap-2.5 rounded-md px-2 py-2.5 text-left", children: [
529
529
  i ? /* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-500/10 text-[10px] font-semibold text-violet-700 dark:text-violet-300", children: "⚡" }) : /* @__PURE__ */ t(
530
- ue,
530
+ he,
531
531
  {
532
532
  userId: e.user_id,
533
533
  className: "h-6 w-6",
@@ -555,7 +555,7 @@ function ft({ revision: e, isLast: s }) {
555
555
  "span",
556
556
  {
557
557
  className: "shrink-0 text-[11px] tabular-nums text-slate-400",
558
- title: e.timestamp ? I(e.timestamp) : void 0,
558
+ title: e.timestamp ? E(e.timestamp) : void 0,
559
559
  children: m
560
560
  }
561
561
  )
@@ -572,35 +572,35 @@ function bt({
572
572
  inlineTableFields: i,
573
573
  isLast: o
574
574
  }) {
575
- const n = D(), r = me(ae), m = Pe(e).reason, [x, p] = w(!1), [u, g] = w(!1), [c, y] = w("changes"), [j, f] = w(!1), [N, C] = w(null), h = e.action === "update", S = e.action === "create" || e.action === "restore", V = e.action === "delete", v = V ? e.data ?? {} : S ? {} : s ?? {}, O = V ? {} : e.data ?? {}, { humanDelta: z, systemDelta: xe } = R(() => {
575
+ const n = D(), r = pe(re), m = Ie(e).reason, [x, p] = w(!1), [u, g] = w(!1), [c, y] = w("changes"), [j, f] = w(!1), [N, C] = w(null), h = e.action === "update", S = e.action === "create" || e.action === "restore", V = e.action === "delete", v = V ? e.data ?? {} : S ? {} : s ?? {}, O = V ? {} : e.data ?? {}, { humanDelta: z, systemDelta: fe } = R(() => {
576
576
  const b = e.delta ?? {};
577
- let _ = 0, E = 0;
577
+ let _ = 0, B = 0;
578
578
  for (const Q of Object.keys(b)) {
579
- const Ce = s == null ? void 0 : s[Q], Se = (e.data ?? {})[Q];
580
- h && s && W(Ce) === W(Se) || (k(d, Q).system ? E++ : _++);
579
+ const Se = s == null ? void 0 : s[Q], _e = (e.data ?? {})[Q];
580
+ h && s && W(Se) === W(_e) || (k(d, Q).system ? B++ : _++);
581
581
  }
582
- return { humanDelta: _, systemDelta: E };
583
- }, [e, s, d, h]), fe = R(() => new Set(Object.keys(e.delta ?? {})), [e]), be = h || S, [H, ge] = w(null), ye = te(), [Ne, re] = w(null), se = Y({
582
+ return { humanDelta: _, systemDelta: B };
583
+ }, [e, s, d, h]), be = R(() => new Set(Object.keys(e.delta ?? {})), [e]), ge = h || S, [H, ye] = w(null), Ne = te(), [ke, se] = w(null), ne = Y({
584
584
  mutationFn: (b) => n.request(M(`/revisions/${e.id}/revert-field`, { field: b })),
585
585
  onSuccess: (b, _) => {
586
- re(null), A.success(`Reverted ${k(d, _).label} to this revision's value`), ye.invalidateQueries({ queryKey: ["revisions", e.collection, e.item] }), a == null || a();
586
+ se(null), A.success(`Reverted ${k(d, _).label} to this revision's value`), Ne.invalidateQueries({ queryKey: ["revisions", e.collection, e.item] }), a == null || a();
587
587
  },
588
588
  onError: () => A.error("Failed to revert field")
589
- }), ke = h || S ? {
590
- confirmField: Ne,
591
- setConfirmField: re,
592
- revert: (b) => se.mutate(b),
593
- pending: se.isPending
589
+ }), ve = h || S ? {
590
+ confirmField: ke,
591
+ setConfirmField: se,
592
+ revert: (b) => ne.mutate(b),
593
+ pending: ne.isPending
594
594
  } : void 0, J = Y({
595
595
  mutationFn: () => n.request(M(`/revisions/${e.id}/rollback`, {})),
596
596
  onSuccess: (b) => {
597
597
  g(!1), A.success("Rolled back to this revision");
598
- const _ = ne(b);
599
- _ && A.warning(_, { duration: 1e4 }), i != null && i.length && e.timestamp && ge(e.timestamp), a == null || a();
598
+ const _ = le(b);
599
+ _ && A.warning(_, { duration: 1e4 }), i != null && i.length && e.timestamp && ye(e.timestamp), a == null || a();
600
600
  },
601
601
  onError: () => A.error("Failed to rollback")
602
602
  });
603
- async function ve(b) {
603
+ async function we(b) {
604
604
  if (H) {
605
605
  C(b.field);
606
606
  try {
@@ -613,8 +613,8 @@ function bt({
613
613
  })
614
614
  );
615
615
  A.success(`Restored ${b.label}`);
616
- const E = ne(_);
617
- E && A.warning(E, { duration: 1e4 });
616
+ const B = le(_);
617
+ B && A.warning(B, { duration: 1e4 });
618
618
  } catch {
619
619
  A.error(`Failed to restore ${b.label}`);
620
620
  } finally {
@@ -622,7 +622,7 @@ function bt({
622
622
  }
623
623
  }
624
624
  }
625
- const we = e.timestamp ? new Date(e.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) : "—";
625
+ const Ce = e.timestamp ? new Date(e.timestamp).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" }) : "—";
626
626
  return /* @__PURE__ */ l("div", { className: "relative pl-9", "data-revision-row": e.id, children: [
627
627
  /* @__PURE__ */ t(
628
628
  "span",
@@ -649,17 +649,17 @@ function bt({
649
649
  className: "flex w-full items-center gap-2.5 rounded-md px-2 py-2.5 text-left transition-colors hover:bg-slate-50 dark:hover:bg-muted/40",
650
650
  children: [
651
651
  /* @__PURE__ */ t(
652
- ue,
652
+ he,
653
653
  {
654
654
  userId: e.user_id,
655
655
  className: "h-6 w-6",
656
- fallback: /* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: B(e, r).split(" ").map((b) => b[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() })
656
+ fallback: /* @__PURE__ */ t("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: P(e, r).split(" ").map((b) => b[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() })
657
657
  }
658
658
  ),
659
659
  /* @__PURE__ */ l("span", { className: "min-w-0 flex-1 truncate text-[12.5px] text-slate-700 dark:text-slate-200", children: [
660
- /* @__PURE__ */ t("span", { className: "font-medium", children: B(e, r) }),
660
+ /* @__PURE__ */ t("span", { className: "font-medium", children: P(e, r) }),
661
661
  " ",
662
- /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: xt(e, z, xe) }),
662
+ /* @__PURE__ */ t("span", { className: "text-slate-500 dark:text-slate-400", children: xt(e, z, fe) }),
663
663
  m && /* @__PURE__ */ l(
664
664
  "span",
665
665
  {
@@ -678,11 +678,11 @@ function bt({
678
678
  "span",
679
679
  {
680
680
  className: "shrink-0 text-[11px] tabular-nums text-slate-400",
681
- title: e.timestamp ? I(e.timestamp) : void 0,
682
- children: we
681
+ title: e.timestamp ? E(e.timestamp) : void 0,
682
+ children: Ce
683
683
  }
684
684
  ),
685
- x ? /* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
685
+ x ? /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" })
686
686
  ]
687
687
  }
688
688
  ),
@@ -715,12 +715,12 @@ function bt({
715
715
  j ? "border-nvr-cyan/40 text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-400 hover:text-slate-600 dark:border-border dark:hover:text-slate-300"
716
716
  ),
717
717
  children: [
718
- /* @__PURE__ */ t(Oe, { className: "h-3 w-3" }),
718
+ /* @__PURE__ */ t(qe, { className: "h-3 w-3" }),
719
719
  "Notes"
720
720
  ]
721
721
  }
722
722
  ),
723
- be && (u ? /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1.5", children: [
723
+ ge && (u ? /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1.5", children: [
724
724
  /* @__PURE__ */ t("span", { className: "text-[11px] text-slate-500", children: "Restore this version?" }),
725
725
  /* @__PURE__ */ t(
726
726
  U,
@@ -753,7 +753,7 @@ function bt({
753
753
  onClick: () => g(!0),
754
754
  title: "Set the whole record back to how it looked after this save",
755
755
  children: [
756
- /* @__PURE__ */ t(ce, { className: "h-3 w-3" }),
756
+ /* @__PURE__ */ t(me, { className: "h-3 w-3" }),
757
757
  "Restore this version"
758
758
  ]
759
759
  }
@@ -767,10 +767,10 @@ function bt({
767
767
  before: v,
768
768
  after: O,
769
769
  meta: d,
770
- fieldRevert: ke,
770
+ fieldRevert: ve,
771
771
  mode: c,
772
772
  hideStatusChips: S,
773
- ownFields: h && e.delta ? fe : null
773
+ ownFields: h && e.delta ? be : null
774
774
  }
775
775
  ),
776
776
  H && i && i.length > 0 && /* @__PURE__ */ l("div", { className: "space-y-1.5 rounded-md border border-slate-100 bg-slate-50 p-2 dark:border-border dark:bg-muted/30", children: [
@@ -782,7 +782,7 @@ function bt({
782
782
  {
783
783
  type: "button",
784
784
  disabled: N === b.field,
785
- onClick: () => ve(b),
785
+ onClick: () => we(b),
786
786
  className: "rounded border border-nvr-cyan/40 px-2 py-0.5 text-[10.5px] font-medium text-nvr-cyan hover:bg-nvr-cyan/10 disabled:opacity-40",
787
787
  children: N === b.field ? "Restoring…" : "Restore"
788
788
  }
@@ -808,7 +808,7 @@ function gt({ data: e, meta: s }) {
808
808
  const O = v.timestamp ? new Date(v.timestamp).getTime() : 0;
809
809
  if (!(O <= c || O > y || !v.delta))
810
810
  for (const z of Object.keys(v.delta))
811
- S.set(z, { name: B(v), when: v.timestamp });
811
+ S.set(z, { name: P(v), when: v.timestamp });
812
812
  }
813
813
  return { fields: [.../* @__PURE__ */ new Set([...Object.keys(C), ...Object.keys(h)])].filter((v) => String(C[v] ?? "") !== String(h[v] ?? "")).map((v) => ({ field: v, from: C[v], to: h[v], by: S.get(v) ?? null })) };
814
814
  }, [n, m, e]), g = "h-7 rounded-md border border-slate-200 bg-white px-2 text-[12px] dark:border-border dark:bg-card";
@@ -824,7 +824,7 @@ function gt({ data: e, meta: s }) {
824
824
  d === "asof" || i ? "border-nvr-cyan/40 bg-nvr-cyan/5 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:text-slate-200"
825
825
  ),
826
826
  children: [
827
- /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
827
+ /* @__PURE__ */ t(je, { className: "h-3.5 w-3.5" }),
828
828
  "View as of a date"
829
829
  ]
830
830
  }
@@ -839,7 +839,7 @@ function gt({ data: e, meta: s }) {
839
839
  d === "compare" || n && m ? "border-nvr-cyan/40 bg-nvr-cyan/5 font-medium text-nvr-navy dark:text-nvr-cyan" : "border-slate-200 text-slate-500 hover:text-slate-700 dark:border-border dark:text-slate-400 dark:hover:text-slate-200"
840
840
  ),
841
841
  children: [
842
- /* @__PURE__ */ t(je, { className: "h-3.5 w-3.5" }),
842
+ /* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5" }),
843
843
  "Compare two dates"
844
844
  ]
845
845
  }
@@ -874,7 +874,7 @@ function gt({ data: e, meta: s }) {
874
874
  /* @__PURE__ */ t("div", { className: "border-b border-slate-200 bg-[#f0fbff] px-2.5 py-1.5 dark:border-border dark:bg-nvr-cyan/10", children: /* @__PURE__ */ l("span", { className: "text-[11.5px] font-semibold text-slate-700 dark:text-slate-200", children: [
875
875
  "Record as of",
876
876
  " ",
877
- p.timestamp ? I(p.timestamp) : i
877
+ p.timestamp ? E(p.timestamp) : i
878
878
  ] }) }),
879
879
  /* @__PURE__ */ t("div", { className: "max-h-80 overflow-y-auto", children: Object.entries(p.data ?? {}).filter(([, c]) => c != null && c !== "").sort(([c], [y]) => k(s, c).label.localeCompare(k(s, y).label)).map(([c, y]) => /* @__PURE__ */ l(
880
880
  "div",
@@ -889,7 +889,7 @@ function gt({ data: e, meta: s }) {
889
889
  children: k(s, c).label
890
890
  }
891
891
  ),
892
- /* @__PURE__ */ t("span", { className: "break-words text-[11.5px] text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(q, { value: y, meta: k(s, c), tone: "after" }) })
892
+ /* @__PURE__ */ t("span", { className: "break-words text-[11.5px] text-slate-700 dark:text-slate-300", children: /* @__PURE__ */ t(F, { value: y, meta: k(s, c), tone: "after" }) })
893
893
  ]
894
894
  },
895
895
  c
@@ -967,12 +967,12 @@ function gt({ data: e, meta: s }) {
967
967
  ),
968
968
  c.by && /* @__PURE__ */ l("span", { className: "shrink-0 text-[10.5px] text-slate-400", children: [
969
969
  c.by.name,
970
- c.by.when ? ` · ${new Date(c.by.when).toLocaleDateString()}` : ""
970
+ c.by.when ? ` · ${ae(c.by.when)}` : ""
971
971
  ] })
972
972
  ] }),
973
973
  /* @__PURE__ */ l("p", { className: "mt-0.5 flex flex-wrap items-baseline gap-x-2 break-words text-[11.5px]", children: [
974
- /* @__PURE__ */ t("span", { className: "text-red-500 line-through dark:text-red-400", children: /* @__PURE__ */ t(q, { value: c.from, meta: k(s, c.field), tone: "before" }) }),
975
- /* @__PURE__ */ t("span", { className: "text-emerald-600 dark:text-emerald-400", children: /* @__PURE__ */ t(q, { value: c.to, meta: k(s, c.field), tone: "after" }) })
974
+ /* @__PURE__ */ t("span", { className: "text-red-500 line-through dark:text-red-400", children: /* @__PURE__ */ t(F, { value: c.from, meta: k(s, c.field), tone: "before" }) }),
975
+ /* @__PURE__ */ t("span", { className: "text-emerald-600 dark:text-emerald-400", children: /* @__PURE__ */ t(F, { value: c.to, meta: k(s, c.field), tone: "after" }) })
976
976
  ] })
977
977
  ]
978
978
  },
@@ -998,15 +998,15 @@ function Nt({
998
998
  onRollback: d,
999
999
  inlineTableFields: a
1000
1000
  }) {
1001
- const i = D(), o = he(e, !0), { data: n, isLoading: r } = P({
1001
+ const i = D(), o = xe(e, !0), { data: n, isLoading: r } = I({
1002
1002
  queryKey: ["revisions", e, s],
1003
- queryFn: () => i.request(F("/revisions", { collection: e, item: s })).then((f) => f.data ?? []),
1003
+ queryFn: () => i.request(L("/revisions", { collection: e, item: s })).then((f) => f.data ?? []),
1004
1004
  staleTime: 3e4
1005
1005
  }), m = te();
1006
- Ke(e, s, [["revisions", e, s]], { client: m });
1007
- const x = qe(null), p = R(() => {
1006
+ Me(e, s, [["revisions", e, s]], { client: m });
1007
+ const x = Le(null), p = R(() => {
1008
1008
  if (!n) return /* @__PURE__ */ new Set();
1009
- const f = n.map(L);
1009
+ const f = n.map(q);
1010
1010
  if (!x.current)
1011
1011
  return x.current = new Set(f), /* @__PURE__ */ new Set();
1012
1012
  const N = x.current;
@@ -1026,7 +1026,7 @@ function Nt({
1026
1026
  /* @__PURE__ */ t(G, { className: "mb-2 h-8 w-8 text-slate-300 dark:text-slate-600" }),
1027
1027
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-slate-600 dark:text-slate-300", children: "No history yet" }),
1028
1028
  /* @__PURE__ */ t("p", { className: "mt-1 max-w-[38ch] text-[12px] text-slate-400", children: "Every save records who changed what — the trail will appear here." })
1029
- ] }) : /* @__PURE__ */ t(ae.Provider, { value: y, children: /* @__PURE__ */ l("div", { className: "space-y-3 pt-3", children: [
1029
+ ] }) : /* @__PURE__ */ t(re.Provider, { value: y, children: /* @__PURE__ */ l("div", { className: "space-y-3 pt-3", children: [
1030
1030
  /* @__PURE__ */ t(gt, { data: g, meta: o }),
1031
1031
  g.length >= 3 && /* @__PURE__ */ t(wt, { revisions: g, meta: o }),
1032
1032
  /* @__PURE__ */ t("div", { children: j.map((f) => /* @__PURE__ */ l("div", { children: [
@@ -1039,14 +1039,14 @@ function Nt({
1039
1039
  {
1040
1040
  className: T(
1041
1041
  "nvr-fade-in relative",
1042
- p.has(L(N)) && "rounded-md bg-nvr-cyan/[0.06]"
1042
+ p.has(q(N)) && "rounded-md bg-nvr-cyan/[0.06]"
1043
1043
  ),
1044
1044
  children: [
1045
- p.has(L(N)) && /* @__PURE__ */ t(oe, {}),
1045
+ p.has(q(N)) && /* @__PURE__ */ t(ce, {}),
1046
1046
  /* @__PURE__ */ t(ft, { revision: N, isLast: h })
1047
1047
  ]
1048
1048
  },
1049
- L(N)
1049
+ q(N)
1050
1050
  );
1051
1051
  const S = (n ?? []).slice(C + 1).find(X);
1052
1052
  return /* @__PURE__ */ l(
@@ -1054,10 +1054,10 @@ function Nt({
1054
1054
  {
1055
1055
  className: T(
1056
1056
  "nvr-fade-in relative",
1057
- p.has(L(N)) && "rounded-md bg-nvr-cyan/[0.06]"
1057
+ p.has(q(N)) && "rounded-md bg-nvr-cyan/[0.06]"
1058
1058
  ),
1059
1059
  children: [
1060
- p.has(L(N)) && /* @__PURE__ */ t(oe, {}),
1060
+ p.has(q(N)) && /* @__PURE__ */ t(ce, {}),
1061
1061
  /* @__PURE__ */ t(
1062
1062
  bt,
1063
1063
  {
@@ -1071,13 +1071,13 @@ function Nt({
1071
1071
  )
1072
1072
  ]
1073
1073
  },
1074
- L(N)
1074
+ q(N)
1075
1075
  );
1076
1076
  })
1077
1077
  ] }, f.day)) })
1078
1078
  ] }) });
1079
1079
  }
1080
- function oe() {
1080
+ function ce() {
1081
1081
  return (
1082
1082
  // Under the timeline dot, inside the row's 36px gutter.
1083
1083
  /* @__PURE__ */ t(
@@ -1138,14 +1138,14 @@ function Ut({
1138
1138
  ] });
1139
1139
  }
1140
1140
  function kt({ collection: e, item: s }) {
1141
- const d = D(), a = he(e, !0), [i, o] = w(""), [n, r] = w(""), { data: m, isFetching: x } = P({
1141
+ const d = D(), a = xe(e, !0), [i, o] = w(""), [n, r] = w(""), { data: m, isFetching: x } = I({
1142
1142
  queryKey: ["rev-value-search", e, s, n],
1143
- queryFn: () => d.request(F("/revisions/value-search", { collection: e, item: s, q: n })).then((p) => p.data),
1143
+ queryFn: () => d.request(L("/revisions/value-search", { collection: e, item: s, q: n })).then((p) => p.data),
1144
1144
  enabled: n.length >= 2
1145
1145
  });
1146
1146
  return /* @__PURE__ */ l("div", { className: "mt-3", children: [
1147
1147
  /* @__PURE__ */ l("div", { className: "relative", children: [
1148
- /* @__PURE__ */ t(_e, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
1148
+ /* @__PURE__ */ t(Te, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
1149
1149
  /* @__PURE__ */ t(
1150
1150
  "input",
1151
1151
  {
@@ -1167,7 +1167,7 @@ function kt({ collection: e, item: s }) {
1167
1167
  },
1168
1168
  className: "absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",
1169
1169
  "aria-label": "Clear search",
1170
- children: /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" })
1170
+ children: /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" })
1171
1171
  }
1172
1172
  )
1173
1173
  ] }),
@@ -1188,7 +1188,7 @@ function kt({ collection: e, item: s }) {
1188
1188
  /* @__PURE__ */ l("p", { className: "text-[10.5px] text-slate-400", children: [
1189
1189
  p.user_name ?? "System",
1190
1190
  " · ",
1191
- p.timestamp ? I(p.timestamp) : "",
1191
+ p.timestamp ? E(p.timestamp) : "",
1192
1192
  " ·",
1193
1193
  " ",
1194
1194
  p.action
@@ -1199,9 +1199,9 @@ function kt({ collection: e, item: s }) {
1199
1199
  ] });
1200
1200
  }
1201
1201
  function vt({ revisionId: e }) {
1202
- const s = D(), d = te(), [a, i] = w(""), { data: o = [] } = P({
1202
+ const s = D(), d = te(), [a, i] = w(""), { data: o = [] } = I({
1203
1203
  queryKey: ["revision-notes", String(e)],
1204
- queryFn: () => s.request(F("/comments", { collection: "nivaro_revisions", item: String(e) })).then((r) => r.data ?? []).catch(() => []),
1204
+ queryFn: () => s.request(L("/comments", { collection: "nivaro_revisions", item: String(e) })).then((r) => r.data ?? []).catch(() => []),
1205
1205
  staleTime: 3e4
1206
1206
  }), n = Y({
1207
1207
  mutationFn: () => s.request(
@@ -1220,7 +1220,7 @@ function vt({ revisionId: e }) {
1220
1220
  "— ",
1221
1221
  r.user_name ?? "someone",
1222
1222
  " · ",
1223
- new Date(r.created_at).toLocaleDateString()
1223
+ ae(r.created_at)
1224
1224
  ] })
1225
1225
  ] }, r.id)),
1226
1226
  /* @__PURE__ */ l(
@@ -1259,7 +1259,7 @@ function wt({
1259
1259
  meta: s
1260
1260
  }) {
1261
1261
  const d = [...e].reverse(), [a, i] = w(!1), [o, n] = w(0);
1262
- De(() => {
1262
+ Ee(() => {
1263
1263
  if (!a) return;
1264
1264
  if (o >= d.length - 1) {
1265
1265
  i(!1);
@@ -1304,7 +1304,7 @@ function wt({
1304
1304
  ] }),
1305
1305
  r && /* @__PURE__ */ l("p", { className: "mt-1 text-[11.5px] text-slate-600 dark:text-slate-300", children: [
1306
1306
  /* @__PURE__ */ t("span", { className: "font-medium capitalize", children: r.action ?? "change" }),
1307
- r.timestamp ? ` · ${I(r.timestamp)}` : "",
1307
+ r.timestamp ? ` · ${E(r.timestamp)}` : "",
1308
1308
  r.user_name ? ` · ${r.user_name}` : "",
1309
1309
  m.length > 0 && /* @__PURE__ */ l("span", { className: "ml-1 text-[10.5px] text-slate-400", children: [
1310
1310
  "changed: ",