@nivaro/react 0.3.50 → 0.3.52

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 (29) hide show
  1. package/dist/hooks/useSessionRecorder.js +1 -1
  2. package/dist/index.d.ts +13 -3
  3. package/dist/shared/components/ItemEditForm.js +4801 -4666
  4. package/dist/shared/components/QueryTable.js +337 -324
  5. package/dist/shared/components/ReportView.js +105 -99
  6. package/dist/shared/components/alerts/AlertManagerView.js +327 -301
  7. package/dist/shared/components/item-edit/CatalogPickerField.js +1149 -1111
  8. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
  9. package/dist/shared/components/item-edit/FieldRenderer.js +227 -223
  10. package/dist/shared/components/item-edit/FieldRow.js +287 -265
  11. package/dist/shared/components/item-edit/FilePickerField.js +315 -307
  12. package/dist/shared/components/item-edit/InlineTableField.js +491 -466
  13. package/dist/shared/components/item-edit/RecordHeaderActions.js +76 -75
  14. package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
  15. package/dist/shared/components/item-edit/RelationCombobox.js +62 -60
  16. package/dist/shared/components/item-edit/SummaryPanel.js +287 -277
  17. package/dist/shared/components/item-edit/UserChip.js +233 -200
  18. package/dist/shared/components/item-edit/header-midair.js +51 -0
  19. package/dist/shared/components/item-edit/line-midair.js +76 -70
  20. package/dist/shared/components/panels/CommentPanel.js +290 -284
  21. package/dist/shared/components/panels/ItemLockBanner.js +30 -30
  22. package/dist/shared/components/panels/PipelinePanel.js +956 -901
  23. package/dist/shared/components/panels/TaskPanel.js +71 -61
  24. package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
  25. package/dist/shared/components/panels/requirement-side-effects.js +40 -0
  26. package/dist/shared/components/queue/QueueWorklist.js +141 -130
  27. package/dist/shared/lib/draft-store.js +48 -34
  28. package/dist/shared/lib/query-stats.js +60 -60
  29. package/package.json +1 -1
@@ -1,64 +1,65 @@
1
- import { jsx as i, Fragment as x, jsxs as f } from "react/jsx-runtime";
2
- import { useQuery as w, useQueryClient as q, useMutation as R } from "@tanstack/react-query";
3
- import { Play as C, Pause as N, Zap as $ } from "lucide-react";
4
- import { useMemo as y, useState as F } from "react";
1
+ import { jsx as s, Fragment as w, jsxs as g } from "react/jsx-runtime";
2
+ import { useQuery as q, useQueryClient as R, useMutation as C } from "@tanstack/react-query";
3
+ import { Play as N, Pause as $, Zap as F } from "lucide-react";
4
+ import { useMemo as y, useState as j } from "react";
5
5
  import { toast as p } from "sonner";
6
- import { useNivaroClient as v } from "../../context.js";
7
- import { get as j, post as k } from "../../lib/commands.js";
8
- import { errorToastOptions as A } from "../../lib/error-toast.js";
9
- import { userErrorMessage as S } from "../../lib/safe-error.js";
10
- import { cn as T } from "../../lib/utils.js";
11
- import { useAvailableBulkActions as B, guardMatches as P } from "../bulk/BulkActionButtons.js";
12
- import { Button as b } from "../ui/button.js";
13
- import { Dialog as D, DialogContent as H, DialogHeader as M, DialogTitle as Q, DialogDescription as _, DialogBody as E, DialogFooter as J } from "../ui/dialog.js";
14
- import { Textarea as K } from "../ui/textarea.js";
6
+ import { useNivaroClient as x } from "../../context.js";
7
+ import { get as A, post as v } from "../../lib/commands.js";
8
+ import { errorToastOptions as S } from "../../lib/error-toast.js";
9
+ import { userErrorMessage as T } from "../../lib/safe-error.js";
10
+ import { cn as B } from "../../lib/utils.js";
11
+ import { useAvailableBulkActions as P, guardMatches as D } from "../bulk/BulkActionButtons.js";
12
+ import { Button as k } from "../ui/button.js";
13
+ import { Dialog as H, DialogContent as M, DialogHeader as Q, DialogTitle as _, DialogDescription as E, DialogBody as J, DialogFooter as K } from "../ui/dialog.js";
14
+ import { Textarea as L } from "../ui/textarea.js";
15
15
  import { invalidateRecordQueries as O } from "./RecordLiveSync.js";
16
- function se(e, n, t) {
17
- const h = v(), m = !!n && n !== "new", { data: u } = B(m ? [e] : []), d = y(
16
+ function de(e, n, t, m = {}) {
17
+ const f = x(), h = !!n && n !== "new", { data: u } = P(h ? [e] : []), a = y(
18
18
  () => ((u == null ? void 0 : u[e]) ?? []).filter(
19
- (o) => o.header === !0 && (o.kind === "update_fields" || o.kind === "transition")
19
+ (r) => r.header === !0 && (r.kind === "update_fields" || r.kind === "transition")
20
20
  ),
21
21
  [u, e]
22
- ), s = y(() => {
23
- const o = /* @__PURE__ */ new Set();
24
- for (const a of d)
25
- for (const r of a.guard ?? [])
26
- r && typeof r.field == "string" && !(t && r.field in t) && o.add(r.field);
27
- return [...o].sort();
28
- }, [d, t]), { data: l } = w({
29
- queryKey: ["record-header-action-guard", e, String(n), s.join(",")],
30
- queryFn: () => h.request(
31
- j(`/items/${encodeURIComponent(e)}/${encodeURIComponent(String(n))}`, {
32
- fields: s.join(",")
22
+ ), d = y(() => {
23
+ const r = /* @__PURE__ */ new Set();
24
+ for (const i of a)
25
+ for (const o of i.guard ?? [])
26
+ o && typeof o.field == "string" && !(t && o.field in t) && r.add(o.field);
27
+ return [...r].sort();
28
+ }, [a, t]), { data: l } = q({
29
+ queryKey: ["record-header-action-guard", e, String(n), d.join(",")],
30
+ queryFn: () => f.request(
31
+ A(`/items/${encodeURIComponent(e)}/${encodeURIComponent(String(n))}`, {
32
+ fields: d.join(",")
33
33
  })
34
- ).then((o) => o.data ?? {}).catch(() => ({})),
35
- enabled: m && s.length > 0,
34
+ ).then((r) => r.data ?? {}).catch(() => ({})),
35
+ enabled: h && d.length > 0,
36
36
  staleTime: 0
37
- });
37
+ }), c = m.fieldsLocked === !0;
38
38
  return y(() => {
39
- if (s.length > 0 && !l) return d.filter((a) => {
40
- var r;
41
- return !((r = a.guard) != null && r.length);
39
+ const r = c ? a.filter((o) => o.kind !== "update_fields") : a;
40
+ if (d.length > 0 && !l) return r.filter((o) => {
41
+ var b;
42
+ return !((b = o.guard) != null && b.length);
42
43
  });
43
- const o = { ...l ?? {}, ...t ?? {} };
44
- return d.filter((a) => P(a.guard, o) !== !1);
45
- }, [d, s, l, t]);
44
+ const i = { ...l ?? {}, ...t ?? {} };
45
+ return r.filter((o) => D(o.guard, i) !== !1);
46
+ }, [a, d, l, t, c]);
46
47
  }
47
48
  function U(e) {
48
- return /remove-hold|unhold/i.test(e.key) ? /* @__PURE__ */ i(C, { className: "h-3.5 w-3.5" }) : /hold/i.test(e.key) ? /* @__PURE__ */ i(N, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ i($, { className: "h-3.5 w-3.5" });
49
+ return /remove-hold|unhold/i.test(e.key) ? /* @__PURE__ */ s(N, { className: "h-3.5 w-3.5" }) : /hold/i.test(e.key) ? /* @__PURE__ */ s($, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ s(F, { className: "h-3.5 w-3.5" });
49
50
  }
50
51
  function W(e) {
51
52
  const n = e.summary && e.summary !== "Built-in" ? e.summary : e.label;
52
53
  return e.require_reason ? `${n}. You’ll be asked for a justification, saved as a note on the record.` : `${n}.`;
53
54
  }
54
- function de({
55
+ function ue({
55
56
  actions: e,
56
57
  onPick: n
57
58
  }) {
58
- return e.length === 0 ? null : /* @__PURE__ */ i(x, { children: e.map((t) => (
59
+ return e.length === 0 ? null : /* @__PURE__ */ s(w, { children: e.map((t) => (
59
60
  // Same Button, size and type as the pipeline's transition buttons beside them.
60
- /* @__PURE__ */ f(
61
- b,
61
+ /* @__PURE__ */ g(
62
+ k,
62
63
  {
63
64
  type: "button",
64
65
  size: "sm",
@@ -66,7 +67,7 @@ function de({
66
67
  "data-record-header-action": t.key,
67
68
  "data-tip": W(t),
68
69
  onClick: () => n(t),
69
- className: T(
70
+ className: B(
70
71
  "shrink-0 gap-1.5 text-[12px]",
71
72
  t.variant === "danger" && "border-red-300 text-red-600 hover:bg-red-50 hover:text-red-700 dark:border-red-500/40 dark:text-red-400 dark:hover:bg-red-500/10"
72
73
  ),
@@ -79,59 +80,59 @@ function de({
79
80
  )
80
81
  )) });
81
82
  }
82
- function ue({
83
+ function le({
83
84
  action: e,
84
85
  collection: n,
85
86
  itemId: t,
86
- onClose: h,
87
- onDone: m
87
+ onClose: m,
88
+ onDone: f
88
89
  }) {
89
- const u = v(), d = q(), [s, l] = F(""), o = !!(e != null && e.require_reason), a = R({
90
+ const h = x(), u = R(), [a, d] = j(""), l = !!(e != null && e.require_reason), c = C({
90
91
  mutationFn: async (r) => {
91
- const c = { collection: n, ids: [t], reason: s.trim() || null }, g = r.source === "db" ? await u.request(k("/bulk-actions/run", { ...c, key: r.key })) : await u.request(k(`/bulk-actions/${r.key}/execute`, c));
92
- return { a: r, result: g.data ?? {} };
92
+ const i = { collection: n, ids: [t], reason: a.trim() || null }, o = r.source === "db" ? await h.request(v("/bulk-actions/run", { ...i, key: r.key })) : await h.request(v(`/bulk-actions/${r.key}/execute`, i));
93
+ return { a: r, result: o.data ?? {} };
93
94
  },
94
- onSuccess: ({ a: r, result: c }) => {
95
- var g;
96
- (g = c.errors) != null && g.length ? p.error(c.errors[0].error) : !c.succeeded && c.skipped ? p.info(`${r.label}: nothing to change on this record`) : p.success(`${r.label} — done`), O(d, n, [t]), d.invalidateQueries({ queryKey: ["record-header-action-guard", n] }), l(""), m == null || m(), h();
95
+ onSuccess: ({ a: r, result: i }) => {
96
+ var o;
97
+ (o = i.errors) != null && o.length ? p.error(i.errors[0].error) : !i.succeeded && i.skipped ? p.info(`${r.label}: nothing to change on this record`) : p.success(`${r.label} — done`), O(u, n, [t]), u.invalidateQueries({ queryKey: ["record-header-action-guard", n] }), d(""), f == null || f(), m();
97
98
  },
98
- onError: (r) => p.error(S(r, "The action did not run"), A(r))
99
+ onError: (r) => p.error(T(r, "The action did not run"), S(r))
99
100
  });
100
- return /* @__PURE__ */ i(
101
- D,
101
+ return /* @__PURE__ */ s(
102
+ H,
102
103
  {
103
104
  open: !!e,
104
105
  onOpenChange: (r) => {
105
- r || (l(""), h());
106
+ r || (d(""), m());
106
107
  },
107
- children: /* @__PURE__ */ f(H, { className: "sm:max-w-md", "data-record-header-action-dialog": "", children: [
108
- /* @__PURE__ */ f(M, { children: [
109
- /* @__PURE__ */ i(Q, { children: e == null ? void 0 : e.label }),
110
- /* @__PURE__ */ i(_, { children: o ? "Say why — your justification is saved as a note on this record." : "Runs on this record. A justification, if you add one, is saved as a note." })
108
+ children: /* @__PURE__ */ g(M, { className: "sm:max-w-md", "data-record-header-action-dialog": "", children: [
109
+ /* @__PURE__ */ g(Q, { children: [
110
+ /* @__PURE__ */ s(_, { children: e == null ? void 0 : e.label }),
111
+ /* @__PURE__ */ s(E, { children: l ? "Say why — your justification is saved as a note on this record." : "Runs on this record. A justification, if you add one, is saved as a note." })
111
112
  ] }),
112
- /* @__PURE__ */ f(E, { className: "space-y-1.5", children: [
113
- /* @__PURE__ */ i("label", { htmlFor: "record-header-action-reason", className: "text-[12.5px] font-medium", children: o ? "Justification (required)" : "Justification (optional)" }),
114
- /* @__PURE__ */ i(
115
- K,
113
+ /* @__PURE__ */ g(J, { className: "space-y-1.5", children: [
114
+ /* @__PURE__ */ s("label", { htmlFor: "record-header-action-reason", className: "text-[12.5px] font-medium", children: l ? "Justification (required)" : "Justification (optional)" }),
115
+ /* @__PURE__ */ s(
116
+ L,
116
117
  {
117
118
  id: "record-header-action-reason",
118
119
  autoFocus: !0,
119
120
  rows: 4,
120
- value: s,
121
- onChange: (r) => l(r.target.value),
121
+ value: a,
122
+ onChange: (r) => d(r.target.value),
122
123
  placeholder: "Why?"
123
124
  }
124
125
  )
125
126
  ] }),
126
- /* @__PURE__ */ f(J, { children: [
127
- /* @__PURE__ */ i(b, { variant: "outline", onClick: h, disabled: a.isPending, children: "Cancel" }),
128
- /* @__PURE__ */ i(
129
- b,
127
+ /* @__PURE__ */ g(K, { children: [
128
+ /* @__PURE__ */ s(k, { variant: "outline", onClick: m, disabled: c.isPending, children: "Cancel" }),
129
+ /* @__PURE__ */ s(
130
+ k,
130
131
  {
131
- onClick: () => e && a.mutate(e),
132
- disabled: !e || a.isPending || o && !s.trim(),
132
+ onClick: () => e && c.mutate(e),
133
+ disabled: !e || c.isPending || l && !a.trim(),
133
134
  className: "bg-nvr-cyan text-white hover:bg-nvr-cyan/90",
134
- children: a.isPending ? "Working…" : e == null ? void 0 : e.label
135
+ children: c.isPending ? "Working…" : e == null ? void 0 : e.label
135
136
  }
136
137
  )
137
138
  ] })
@@ -140,7 +141,7 @@ function ue({
140
141
  );
141
142
  }
142
143
  export {
143
- de as RecordHeaderActionButtons,
144
- ue as RecordHeaderActionDialog,
145
- se as useRecordHeaderActions
144
+ ue as RecordHeaderActionButtons,
145
+ le as RecordHeaderActionDialog,
146
+ de as useRecordHeaderActions
146
147
  };
@@ -1,5 +1,5 @@
1
- import { jsx as i, jsxs as m } from "react/jsx-runtime";
2
- import { useQueryClient as ue } from "@tanstack/react-query";
1
+ import { jsx as d, jsxs as m } from "react/jsx-runtime";
2
+ import { useQueryClient as ce } from "@tanstack/react-query";
3
3
  import { EyeOff as me, ArrowLeft as le, Trash2 as fe, Copy as pe, FileUp as be, Bot as he, UploadCloud as ge } from "lucide-react";
4
4
  import { useState as w, useRef as g, useEffect as k } from "react";
5
5
  import { toast as O } from "sonner";
@@ -11,21 +11,21 @@ import { useRecordTabsSignal as Re, useRecordTabs as Te } from "../../lib/record
11
11
  import { userErrorMessage as _e } from "../../lib/safe-error.js";
12
12
  import { formatRelative as $e } from "../../lib/utils.js";
13
13
  import { markLiveRecordWrite as Ee } from "./live-record-marks.js";
14
- function De(e, r, c) {
14
+ function Ke(e, r, u) {
15
15
  var f;
16
- if (c.active)
16
+ if (u.active)
17
17
  return { text: e ? `${e} moved this to ${r}` : `This record moved to ${r}` };
18
- const p = ((f = c.label) == null ? void 0 : f.trim()) || "A record in your tabs";
18
+ const p = ((f = u.label) == null ? void 0 : f.trim()) || "A record in your tabs";
19
19
  return {
20
20
  text: e ? `${e} moved ${p} to ${r}` : `${p} moved to ${r}`,
21
- open: c.open
21
+ open: u.open
22
22
  };
23
23
  }
24
- function Le(e, r) {
25
- const c = e == null ? void 0 : e.user_id;
26
- return typeof c == "string" && !!r && c.toUpperCase() === String(r).toUpperCase();
24
+ function De(e, r) {
25
+ const u = e == null ? void 0 : e.user_id;
26
+ return typeof u == "string" && !!r && u.toUpperCase() === String(r).toUpperCase();
27
27
  }
28
- const Ae = 8e3, te = [
28
+ const Le = 8e3, te = [
29
29
  "item",
30
30
  "rrv-record",
31
31
  "revisions",
@@ -45,30 +45,30 @@ const Ae = 8e3, te = [
45
45
  "record-integrations",
46
46
  "record-integrity"
47
47
  ];
48
- function Ce(e, r, c) {
49
- const p = new Set(te), f = String(c);
48
+ function Qe(e, r, u) {
49
+ const p = new Set(te), f = String(u);
50
50
  e.removeQueries({
51
- predicate: (u) => p.has(u.queryKey[0]) && u.queryKey[1] === r && String(u.queryKey[2]) === f
51
+ predicate: (c) => p.has(c.queryKey[0]) && c.queryKey[1] === r && String(c.queryKey[2]) === f
52
52
  });
53
53
  }
54
- function Ge(e, r, c) {
55
- if (!r || c.length === 0) return;
56
- const p = new Set(te), f = new Set(c.map(String));
54
+ function Ge(e, r, u) {
55
+ if (!r || u.length === 0) return;
56
+ const p = new Set(te), f = new Set(u.map(String));
57
57
  e.invalidateQueries({
58
- predicate: (u) => p.has(u.queryKey[0]) && u.queryKey[1] === r && f.has(String(u.queryKey[2]))
58
+ predicate: (c) => p.has(c.queryKey[0]) && c.queryKey[1] === r && f.has(String(c.queryKey[2]))
59
59
  });
60
60
  }
61
- function Qe({ onBack: e }) {
62
- return /* @__PURE__ */ i("div", { className: "p-6", children: /* @__PURE__ */ m(
61
+ function qe({ onBack: e }) {
62
+ return /* @__PURE__ */ d("div", { className: "p-6", children: /* @__PURE__ */ m(
63
63
  "div",
64
64
  {
65
65
  "data-record-gone": "access",
66
66
  role: "alert",
67
67
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
68
68
  children: [
69
- /* @__PURE__ */ i(me, { className: "h-4 w-4 shrink-0 text-amber-500" }),
69
+ /* @__PURE__ */ d(me, { className: "h-4 w-4 shrink-0 text-amber-500" }),
70
70
  /* @__PURE__ */ m("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
71
- /* @__PURE__ */ i("span", { className: "font-semibold", children: "You no longer have access to this record." }),
71
+ /* @__PURE__ */ d("span", { className: "font-semibold", children: "You no longer have access to this record." }),
72
72
  " A role, scope or filter change hid it while you had it open."
73
73
  ] }),
74
74
  /* @__PURE__ */ m(
@@ -79,7 +79,7 @@ function Qe({ onBack: e }) {
79
79
  "data-record-gone-back": !0,
80
80
  className: "inline-flex h-7 shrink-0 items-center gap-1 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
81
81
  children: [
82
- /* @__PURE__ */ i(le, { className: "h-3.5 w-3.5" }),
82
+ /* @__PURE__ */ d(le, { className: "h-3.5 w-3.5" }),
83
83
  "Back"
84
84
  ]
85
85
  }
@@ -88,31 +88,31 @@ function Qe({ onBack: e }) {
88
88
  }
89
89
  ) });
90
90
  }
91
- const qe = (e) => {
91
+ const Ae = (e) => {
92
92
  var r;
93
93
  return (e == null ? void 0 : e.status) ?? ((r = e == null ? void 0 : e.response) == null ? void 0 : r.status);
94
94
  };
95
95
  function Je({
96
96
  collection: e,
97
97
  itemId: r,
98
- dirty: c = !1,
98
+ dirty: u = !1,
99
99
  loadDenied: p = !1,
100
100
  onGoneChange: f
101
101
  }) {
102
- const u = Ne(), T = ve(), x = ue(), [L, j] = w(!1), [A, se] = w([]), [o, ne] = w(null), [ae, C] = w({}), [B, F] = w(!1), [P, Y] = w(!1), S = g(null), N = g(null), _ = g(Date.now()), Q = g(null), $ = g(f);
102
+ const c = Ne(), T = ve(), y = ce(), [D, j] = w(!1), [L, se] = w([]), [o, ne] = w(null), [ae, Q] = w({}), [B, F] = w(!1), [P, Y] = w(!1), S = g(null), N = g(null), _ = g(Date.now()), q = g(null), $ = g(f);
103
103
  $.current = f;
104
- const y = g(null), W = ye(), H = g(W);
104
+ const x = g(null), W = ye(), H = g(W);
105
105
  H.current = W;
106
106
  const R = (s) => {
107
107
  var t;
108
- y.current = s, ne(s), (t = $.current) == null || t.call($, s), (s == null ? void 0 : s.kind) === "access" && setTimeout(() => Ce(x, e, r), 0);
108
+ x.current = s, ne(s), (t = $.current) == null || t.call($, s), (s == null ? void 0 : s.kind) === "access" && setTimeout(() => Qe(y, e, r), 0);
109
109
  };
110
110
  k(() => {
111
- _.current = Date.now(), Q.current = null, C({}), y.current && R(null);
111
+ _.current = Date.now(), q.current = null, Q({}), x.current && R(null);
112
112
  }, [e, r]);
113
113
  const l = (s) => {
114
- for (const t of s) x.invalidateQueries({ queryKey: t });
115
- }, q = async (s) => {
114
+ for (const t of s) y.invalidateQueries({ queryKey: t });
115
+ }, A = async (s) => {
116
116
  let t = null;
117
117
  try {
118
118
  t = (await T.request(
@@ -135,8 +135,8 @@ function Je({
135
135
  const t = (await T.request(
136
136
  U(`/pipelines/instance/${e}/${r}`)
137
137
  )).data, a = (s = t == null ? void 0 : t.history) == null ? void 0 : s[0];
138
- if (!a || a.id === Q.current || a.timestamp && new Date(a.timestamp).getTime() < _.current - 5e3 || (Q.current = a.id, typeof document < "u" && document.visibilityState === "hidden")) return;
139
- const b = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.user_email || null, d = a.to_state_label ?? "a new state", n = De(b, d, H.current);
138
+ if (!a || a.id === q.current || a.timestamp && new Date(a.timestamp).getTime() < _.current - 5e3 || (q.current = a.id, typeof document < "u" && document.visibilityState === "hidden")) return;
139
+ const b = [a.first_name, a.last_name].filter(Boolean).join(" ") || a.user_email || null, i = a.to_state_label ?? "a new state", n = Ke(b, i, H.current);
140
140
  O.info(
141
141
  n.text,
142
142
  n.open ? { action: { label: "Open", onClick: n.open } } : {}
@@ -146,12 +146,12 @@ function Je({
146
146
  }, ie = (s) => {
147
147
  var a, b;
148
148
  if (s.deleted) {
149
- q("deleted");
149
+ A("deleted");
150
150
  return;
151
151
  }
152
- if (y.current) return;
153
- s.events.some((d) => d.source === "import" && !d.own) && (Y(!0), S.current && clearTimeout(S.current), S.current = setTimeout(() => Y(!1), Ae));
154
- const t = (d) => Se(s, d);
152
+ if (x.current) return;
153
+ s.events.some((i) => i.source === "import" && !i.own) && (Y(!0), S.current && clearTimeout(S.current), S.current = setTimeout(() => Y(!1), Le));
154
+ const t = (i) => Se(s, i);
155
155
  if (t(v.state) && (l([
156
156
  ["pipeline-instance", e, r],
157
157
  ["pipeline-all-owners", e, r],
@@ -164,8 +164,10 @@ function Je({
164
164
  ]) : (t(v.state) || t(v.integrations) || t(v.addendums) || !s.aspectsOnly) && l([["comments-related", e, r]]), t(v.tasks) && l([["tasks", e, r]]), t(v.integrations) && l([
165
165
  ["erp-submissions", e, r],
166
166
  ["record-integrations", e, r]
167
- ]), !s.aspectsOnly) {
168
- if (s.ids.length > 0 && s.ids.every((d) => d === "*")) {
167
+ ]), y.invalidateQueries({
168
+ predicate: (i) => (i.queryKey[0] === "child-summary" || i.queryKey[0] === "field-lineage") && i.queryKey[1] === e && String(i.queryKey[2]) === String(r)
169
+ }), !s.aspectsOnly) {
170
+ if (s.ids.length > 0 && s.ids.every((i) => i === "*")) {
169
171
  l([
170
172
  ["item", e, r],
171
173
  ["pipeline-instance", e, r]
@@ -175,7 +177,7 @@ function Je({
175
177
  Ee(
176
178
  e,
177
179
  r,
178
- ((b = s.changedFields) == null ? void 0 : b.filter((d) => !d.startsWith("$"))) ?? null
180
+ ((b = s.changedFields) == null ? void 0 : b.filter((i) => !i.startsWith("$"))) ?? null
179
181
  ), V(!0);
180
182
  }
181
183
  }, V = async (s) => {
@@ -187,13 +189,13 @@ function Je({
187
189
  ["revisions", e, r]
188
190
  ]);
189
191
  const t = ["last-touch", e, String(r)];
190
- await x.invalidateQueries({ queryKey: t }).catch(() => {
191
- }), !(!s || Le(x.getQueryData(t), z.current)) && (j(!0), N.current && clearTimeout(N.current), N.current = setTimeout(() => j(!1), 4e3));
192
+ await y.invalidateQueries({ queryKey: t }).catch(() => {
193
+ }), !(!s || De(y.getQueryData(t), z.current)) && (j(!0), N.current && clearTimeout(N.current), N.current = setTimeout(() => j(!1), 4e3));
192
194
  };
193
195
  ke(e, r, ie);
194
196
  const { userId: E } = xe(), z = g(E);
195
197
  z.current = E, Re(E, "saved", e, r, () => {
196
- y.current || (V(!1), l([
198
+ x.current || (V(!1), l([
197
199
  ["pipeline-instance", e, r],
198
200
  ["comments", e, r],
199
201
  ["tasks", e, r],
@@ -209,7 +211,7 @@ function Je({
209
211
  ), ee(
210
212
  "owners:changed",
211
213
  () => {
212
- y.current || l([
214
+ x.current || l([
213
215
  ["pipeline-instance-owners", e, r],
214
216
  ["pipeline-owners-resolved", e, r],
215
217
  ["pipeline-all-owners", e, r],
@@ -229,15 +231,15 @@ function Je({
229
231
  if (!t) return;
230
232
  const a = G.current, b = a.get(t);
231
233
  b && clearTimeout(b), a.delete(t);
232
- const d = () => C((n) => {
234
+ const i = () => Q((n) => {
233
235
  const { [t]: h, ...M } = n;
234
236
  return M;
235
237
  });
236
238
  if ((s == null ? void 0 : s.state) === "end") {
237
- d();
239
+ i();
238
240
  return;
239
241
  }
240
- C((n) => ({ ...n, [t]: String((s == null ? void 0 : s.flow_name) || "An automation") })), a.set(t, setTimeout(d, 5 * 6e4));
242
+ Q((n) => ({ ...n, [t]: String((s == null ? void 0 : s.flow_name) || "An automation") })), a.set(t, setTimeout(i, 5 * 6e4));
241
243
  }), k(() => {
242
244
  const s = G.current;
243
245
  return () => {
@@ -250,12 +252,12 @@ function Je({
250
252
  setTimeout(
251
253
  () => {
252
254
  var s;
253
- ((s = y.current) == null ? void 0 : s.kind) !== "deleted" && T.request(U(`/items/${e}/${r}`, { fields: "id" })).then(() => {
255
+ ((s = x.current) == null ? void 0 : s.kind) !== "deleted" && T.request(U(`/items/${e}/${r}`, { fields: "id" })).then(() => {
254
256
  var t;
255
- ((t = y.current) == null ? void 0 : t.kind) === "access" && (R(null), l([["item", e, r]]));
257
+ ((t = x.current) == null ? void 0 : t.kind) === "access" && (R(null), l([["item", e, r]]));
256
258
  }).catch((t) => {
257
- const a = qe(t);
258
- (a === 403 || a === 404) && q("access");
259
+ const a = Ae(t);
260
+ (a === 403 || a === 404) && A("access");
259
261
  });
260
262
  },
261
263
  Math.floor(Math.random() * 1500)
@@ -263,16 +265,16 @@ function Je({
263
265
  },
264
266
  { debounceMs: 300 }
265
267
  ), k(() => {
266
- p && !y.current && q("access");
268
+ p && !x.current && A("access");
267
269
  }, [p]);
268
- const D = Te(e, r, c, E), [de, J] = w(!1);
270
+ const K = Te(e, r, u, E), [de, J] = w(!1);
269
271
  k(() => {
270
- D.otherDirty || J(!1);
271
- }, [D.otherDirty]), k(() => {
272
- if (!u) return;
272
+ K.otherDirty || J(!1);
273
+ }, [K.otherDirty]), k(() => {
274
+ if (!c) return;
273
275
  const s = (n) => {
274
276
  const h = n.detail;
275
- h != null && h.name && u.emit("record:uploading", {
277
+ h != null && h.name && c.emit("record:uploading", {
276
278
  collection: e,
277
279
  item: String(r),
278
280
  name: h.name,
@@ -287,14 +289,14 @@ function Je({
287
289
  const Z = M.filter((I) => !(I.user === h && I.name === n.name));
288
290
  return n.state === "start" ? [...Z, { user: h, name: String(n.name) }] : Z;
289
291
  });
290
- }, a = u.on("record:uploading", t), b = u.on("record:comment", (n) => {
291
- (n == null ? void 0 : n.collection) !== e || String(n == null ? void 0 : n.item) !== String(r) || (x.invalidateQueries({ queryKey: ["comments", e, r] }), x.invalidateQueries({ queryKey: ["comments-related", e, r] }));
292
- }), d = (n) => t(n.detail);
293
- return window.addEventListener("nvr:record-uploading", d), () => {
294
- window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", d), a(), b();
292
+ }, a = c.on("record:uploading", t), b = c.on("record:comment", (n) => {
293
+ (n == null ? void 0 : n.collection) !== e || String(n == null ? void 0 : n.item) !== String(r) || (y.invalidateQueries({ queryKey: ["comments", e, r] }), y.invalidateQueries({ queryKey: ["comments-related", e, r] }));
294
+ }), i = (n) => t(n.detail);
295
+ return window.addEventListener("nvr:record-uploading", i), () => {
296
+ window.removeEventListener("nvr:upload-state", s), window.removeEventListener("nvr:record-uploading", i), a(), b();
295
297
  };
296
- }, [u, e, r, x]);
297
- const ce = async () => {
298
+ }, [c, e, r, y]);
299
+ const ue = async () => {
298
300
  if (o != null && o.trashId) {
299
301
  F(!0);
300
302
  try {
@@ -305,8 +307,8 @@ function Je({
305
307
  F(!1);
306
308
  }
307
309
  }
308
- }, K = Object.values(ae), X = D.otherDirty && !de && !c && !o;
309
- return !o && K.length === 0 && !X && !P && (!u || !L && A.length === 0) ? null : /* @__PURE__ */ m("div", { className: "space-y-2", children: [
310
+ }, C = Object.values(ae), X = K.otherDirty && !de && !u && !o;
311
+ return !o && C.length === 0 && !X && !P && (!c || !D && L.length === 0) ? null : /* @__PURE__ */ m("div", { className: "space-y-2", children: [
310
312
  (o == null ? void 0 : o.kind) === "deleted" && /* @__PURE__ */ m(
311
313
  "div",
312
314
  {
@@ -314,19 +316,19 @@ function Je({
314
316
  role: "alert",
315
317
  className: "flex items-center gap-3 rounded-lg border border-rose-300 bg-rose-50 px-3.5 py-2.5 dark:border-rose-500/40 dark:bg-rose-500/10",
316
318
  children: [
317
- /* @__PURE__ */ i(fe, { className: "h-4 w-4 shrink-0 text-rose-500" }),
319
+ /* @__PURE__ */ d(fe, { className: "h-4 w-4 shrink-0 text-rose-500" }),
318
320
  /* @__PURE__ */ m("p", { className: "min-w-0 flex-1 text-[12px] text-rose-800 dark:text-rose-300", children: [
319
- /* @__PURE__ */ i("span", { className: "font-semibold", children: "This record was deleted" }),
321
+ /* @__PURE__ */ d("span", { className: "font-semibold", children: "This record was deleted" }),
320
322
  o.by ? ` by ${o.by}` : "",
321
323
  o.at ? ` ${$e(o.at)}` : "",
322
324
  ". Saving is turned off",
323
325
  o.canRestore ? " — restore it to keep working." : "."
324
326
  ] }),
325
- o.canRestore && o.trashId != null && /* @__PURE__ */ i(
327
+ o.canRestore && o.trashId != null && /* @__PURE__ */ d(
326
328
  "button",
327
329
  {
328
330
  type: "button",
329
- onClick: () => void ce(),
331
+ onClick: () => void ue(),
330
332
  disabled: B,
331
333
  className: "h-7 shrink-0 rounded-md border border-rose-300 bg-white px-2.5 text-[11.5px] font-medium text-rose-700 hover:bg-rose-100 disabled:opacity-50 dark:border-rose-500/40 dark:bg-transparent dark:text-rose-300 dark:hover:bg-rose-500/10",
332
334
  children: B ? "Restoring…" : "Restore"
@@ -335,25 +337,25 @@ function Je({
335
337
  ]
336
338
  }
337
339
  ),
338
- (o == null ? void 0 : o.kind) === "access" && !f && /* @__PURE__ */ i(Qe, { onBack: () => window.history.back() }),
340
+ (o == null ? void 0 : o.kind) === "access" && !f && /* @__PURE__ */ d(qe, { onBack: () => window.history.back() }),
339
341
  X && /* @__PURE__ */ m(
340
342
  "div",
341
343
  {
342
344
  "data-record-other-tab": !0,
343
345
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
344
346
  children: [
345
- /* @__PURE__ */ i(pe, { className: "h-4 w-4 shrink-0 text-amber-500" }),
346
- /* @__PURE__ */ i("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: "This record is open with unsaved changes in another tab — editing it here too may overwrite them." }),
347
- /* @__PURE__ */ i(
347
+ /* @__PURE__ */ d(pe, { className: "h-4 w-4 shrink-0 text-amber-500" }),
348
+ /* @__PURE__ */ d("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: "This record is open with unsaved changes in another tab — editing it here too may overwrite them." }),
349
+ /* @__PURE__ */ d(
348
350
  "button",
349
351
  {
350
352
  type: "button",
351
- onClick: D.focusOther,
353
+ onClick: K.focusOther,
352
354
  className: "h-7 shrink-0 rounded-md border border-amber-300 bg-white px-2.5 text-[11.5px] font-medium text-amber-800 hover:bg-amber-100 dark:border-amber-500/40 dark:bg-transparent dark:text-amber-300 dark:hover:bg-amber-500/10",
353
355
  children: "Switch to that tab"
354
356
  }
355
357
  ),
356
- /* @__PURE__ */ i(
358
+ /* @__PURE__ */ d(
357
359
  "button",
358
360
  {
359
361
  type: "button",
@@ -372,44 +374,44 @@ function Je({
372
374
  role: "status",
373
375
  className: "flex items-center gap-3 rounded-lg border border-amber-300 bg-amber-50 px-3.5 py-2.5 dark:border-amber-500/40 dark:bg-amber-500/10",
374
376
  children: [
375
- /* @__PURE__ */ i(be, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
377
+ /* @__PURE__ */ d(be, { className: "h-4 w-4 shrink-0 animate-pulse text-amber-500" }),
376
378
  /* @__PURE__ */ m("p", { className: "min-w-0 flex-1 text-[12px] text-amber-800 dark:text-amber-300", children: [
377
- /* @__PURE__ */ i("span", { className: "font-semibold", children: "An import is updating this record" }),
379
+ /* @__PURE__ */ d("span", { className: "font-semibold", children: "An import is updating this record" }),
378
380
  " — the changed fields refresh here as it goes.",
379
- c ? " Your unsaved edits may be out of date; check them before saving." : ""
381
+ u ? " Your unsaved edits may be out of date; check them before saving." : ""
380
382
  ] })
381
383
  ]
382
384
  }
383
385
  ),
384
- K.length > 0 && !o && /* @__PURE__ */ m(
386
+ C.length > 0 && !o && /* @__PURE__ */ m(
385
387
  "div",
386
388
  {
387
389
  "data-record-automation": !0,
388
390
  role: "status",
389
391
  className: "flex items-center gap-3 rounded-lg border border-nvr-cyan/40 bg-nvr-cyan/10 px-3.5 py-2.5",
390
392
  children: [
391
- /* @__PURE__ */ i(he, { className: "h-4 w-4 shrink-0 animate-pulse text-nvr-cyan" }),
393
+ /* @__PURE__ */ d(he, { className: "h-4 w-4 shrink-0 animate-pulse text-nvr-cyan" }),
392
394
  /* @__PURE__ */ m("p", { className: "min-w-0 flex-1 text-[12px] text-[#0e7490] dark:text-[#67e8f9]", children: [
393
- /* @__PURE__ */ i("span", { className: "font-semibold", children: "Automation is updating this record" }),
395
+ /* @__PURE__ */ d("span", { className: "font-semibold", children: "Automation is updating this record" }),
394
396
  " —",
395
397
  " ",
396
- K.join(", "),
398
+ C.join(", "),
397
399
  ". Its changes appear here when it finishes."
398
400
  ] })
399
401
  ]
400
402
  }
401
403
  ),
402
- u && (L || A.length > 0) && /* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-2", children: [
403
- L && /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-0.5 text-[11px] font-medium text-[#0e7490] dark:text-[#67e8f9]", children: [
404
- /* @__PURE__ */ i("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
404
+ c && (D || L.length > 0) && /* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-2", children: [
405
+ D && /* @__PURE__ */ m("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-2.5 py-0.5 text-[11px] font-medium text-[#0e7490] dark:text-[#67e8f9]", children: [
406
+ /* @__PURE__ */ d("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-nvr-cyan" }),
405
407
  "Updated just now by someone else"
406
408
  ] }),
407
- A.map((s) => /* @__PURE__ */ m(
409
+ L.map((s) => /* @__PURE__ */ m(
408
410
  "span",
409
411
  {
410
412
  className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-white px-2.5 py-0.5 text-[11px] text-slate-600 dark:border-border dark:bg-card dark:text-slate-300",
411
413
  children: [
412
- /* @__PURE__ */ i(ge, { className: "h-3 w-3 animate-pulse text-nvr-cyan" }),
414
+ /* @__PURE__ */ d(ge, { className: "h-3 w-3 animate-pulse text-nvr-cyan" }),
413
415
  s.user,
414
416
  " is uploading “",
415
417
  s.name.length > 32 ? `${s.name.slice(0, 32)}…` : s.name,
@@ -423,10 +425,10 @@ function Je({
423
425
  }
424
426
  export {
425
427
  te as RECORD_QUERY_HEADS,
426
- Qe as RecordAccessLostPanel,
428
+ qe as RecordAccessLostPanel,
427
429
  Je as RecordLiveSync,
428
430
  Ge as invalidateRecordQueries,
429
- De as moveNotice,
430
- Ce as purgeRecordQueries,
431
- Le as writtenBySelf
431
+ Ke as moveNotice,
432
+ Qe as purgeRecordQueries,
433
+ De as writtenBySelf
432
434
  };