@nivaro/react 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/components/slots/pipeline/OwnersSection.js +79 -75
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +50 -2
  5. package/dist/index.js +601 -596
  6. package/dist/shared/components/CollectionBrowserView.js +2373 -2298
  7. package/dist/shared/components/DataTable.js +347 -335
  8. package/dist/shared/components/ItemEditForm.js +5278 -5149
  9. package/dist/shared/components/ListLoadError.js +33 -0
  10. package/dist/shared/components/PageRenderer.js +562 -529
  11. package/dist/shared/components/ProfileView.js +53 -51
  12. package/dist/shared/components/RecordReadView.js +119 -117
  13. package/dist/shared/components/ReportView.js +1268 -1241
  14. package/dist/shared/components/cbv/export-rows.js +69 -0
  15. package/dist/shared/components/cbv/saved-view-risk.js +35 -0
  16. package/dist/shared/components/cbv/unknown-fields.js +18 -0
  17. package/dist/shared/components/integrations/console/AlertsView.js +27 -25
  18. package/dist/shared/components/integrations/console/EventsView.js +244 -209
  19. package/dist/shared/components/item-edit/CatalogPickerField.js +946 -878
  20. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +84 -57
  21. package/dist/shared/components/item-edit/FieldAffordances.js +63 -61
  22. package/dist/shared/components/item-edit/FieldRow.js +195 -179
  23. package/dist/shared/components/item-edit/FilePickerField.js +257 -254
  24. package/dist/shared/components/item-edit/HeaderTools.js +139 -95
  25. package/dist/shared/components/item-edit/InlineTableField.js +2087 -2075
  26. package/dist/shared/components/item-edit/RecordLiveSync.js +196 -181
  27. package/dist/shared/components/item-edit/RowComments.js +1 -3
  28. package/dist/shared/components/item-edit/SummaryPanel.js +62 -62
  29. package/dist/shared/components/item-edit/UserChip.js +113 -113
  30. package/dist/shared/components/item-edit/file-download.js +18 -0
  31. package/dist/shared/components/item-edit/line-qty.js +67 -32
  32. package/dist/shared/components/item-edit/save-refusal.js +23 -0
  33. package/dist/shared/components/monitoring/TrafficMiniMap.js +9 -9
  34. package/dist/shared/components/panels/CommentPanel.js +30 -30
  35. package/dist/shared/components/panels/ItemLockBanner.js +207 -185
  36. package/dist/shared/components/panels/PipelinePanel.js +915 -786
  37. package/dist/shared/components/pipeline/PipelineEditorView.js +45 -25
  38. package/dist/shared/components/profile/DelegationCard.js +1 -1
  39. package/dist/shared/components/profile/session-actions.js +24 -24
  40. package/dist/shared/components/queue/QueueItemSheet.js +18 -18
  41. package/dist/shared/components/queue/QueueWorklist.js +517 -504
  42. package/dist/shared/components/ui/dropdown-menu.js +8 -7
  43. package/dist/shared/context.js +71 -66
  44. package/dist/shared/lib/draft-store.js +60 -33
  45. package/dist/shared/lib/leave-guard.js +38 -0
  46. package/dist/shared/lib/load-error.js +38 -17
  47. package/dist/shared/lib/summary-mode.js +25 -25
  48. package/dist/shared/lib/table-pins.js +23 -0
  49. package/dist/shared/lib/validation-rules.js +55 -51
  50. package/package.json +1 -1
@@ -1,177 +1,221 @@
1
- import { jsx as c, jsxs as x } from "react/jsx-runtime";
2
- import { MoreHorizontal as R } from "lucide-react";
3
- import { useRef as v, useState as k, useEffect as _ } from "react";
4
- import { createPortal as C } from "react-dom";
5
- import { cn as w } from "../../lib/utils.js";
6
- function B({ children: m }) {
7
- var f, p;
8
- const r = v(null), h = v(null), [l, o] = k(!1), u = v(!1);
9
- u.current = l;
10
- const a = v(0), [t, b] = k(!1);
11
- if (_(() => {
12
- var d;
13
- const e = (d = r.current) == null ? void 0 : d.closest("[data-nvr-header-row]");
1
+ import { jsx as h, jsxs as E } from "react/jsx-runtime";
2
+ import { MoreHorizontal as C } from "lucide-react";
3
+ import { useRef as v, useState as _, useEffect as k } from "react";
4
+ import { createPortal as M } from "react-dom";
5
+ import { cn as y } from "../../lib/utils.js";
6
+ function W(u, r) {
7
+ const d = u.target;
8
+ if (!(d != null && d.closest)) return !0;
9
+ if (d.closest("[data-radix-popper-content-wrapper]")) return !1;
10
+ const a = d.closest('[role="dialog"]');
11
+ return !a || !!(r && a.contains(r));
12
+ }
13
+ function I({ children: u }) {
14
+ var m, b;
15
+ const r = v(null), d = v(null), [a, i] = _(!1), c = v(!1);
16
+ c.current = a;
17
+ const o = v(0), [e, l] = _(!1);
18
+ if (k(() => {
19
+ var x, R;
20
+ const n = (x = r.current) == null ? void 0 : x.closest("[data-nvr-header-row]");
21
+ if (!n) return;
22
+ const p = () => {
23
+ c.current ? o.current > 0 && n.clientWidth > o.current + 32 && i(!1) : n.scrollWidth > n.clientWidth + 2 && (o.current = n.scrollWidth, i(!0), l(!1));
24
+ };
25
+ p();
26
+ const g = new ResizeObserver(p);
27
+ g.observe(n);
28
+ const f = (R = r.current) == null ? void 0 : R.parentElement;
29
+ return f && f !== n && g.observe(f), () => g.disconnect();
30
+ }), k(() => {
14
31
  if (!e) return;
15
- const i = () => {
16
- u.current ? a.current > 0 && e.clientWidth > a.current + 32 && o(!1) : e.scrollWidth > e.clientWidth + 2 && (a.current = e.scrollWidth, o(!0), b(!1));
32
+ const n = (p) => {
33
+ p.key !== "Escape" || !W(p, r.current) || (p.stopPropagation(), l(!1));
17
34
  };
18
- i();
19
- const g = new ResizeObserver(i);
20
- return g.observe(e), () => g.disconnect();
21
- }), _(() => {
22
- if (!t) return;
23
- const e = (g) => {
24
- const d = g.target;
25
- if (d.closest("[data-nvr-header-tools-panel]") || d.closest("[data-nvr-header-tools-btn]") || d.closest("[data-nvr-header-menu-panel]") || d.closest("[data-radix-popper-content-wrapper]"))
35
+ return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
36
+ }, [e]), k(() => {
37
+ if (!e) return;
38
+ const n = (g) => {
39
+ const f = g.target;
40
+ if (f.closest("[data-nvr-header-tools-panel]") || f.closest("[data-nvr-header-tools-btn]") || f.closest("[data-nvr-header-menu-panel]") || f.closest("[data-radix-popper-content-wrapper]"))
26
41
  return;
27
- const y = d.closest('[role="dialog"]');
28
- y && !y.contains(r.current) || b(!1);
29
- }, i = (g) => {
30
- g.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && b(!1);
42
+ const x = f.closest('[role="dialog"]');
43
+ x && !x.contains(r.current) || l(!1);
44
+ }, p = (g) => {
45
+ g.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && l(!1);
31
46
  };
32
- return window.addEventListener("mousedown", e, !0), window.addEventListener("click", i), () => {
33
- window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", i);
47
+ return window.addEventListener("mousedown", n, !0), window.addEventListener("click", p), () => {
48
+ window.removeEventListener("mousedown", n, !0), window.removeEventListener("click", p);
34
49
  };
35
- }, [t]), !l)
36
- return /* @__PURE__ */ c("div", { ref: r, className: "contents", children: m });
37
- const s = t ? (f = h.current) == null ? void 0 : f.getBoundingClientRect() : void 0, n = ((p = h.current) == null ? void 0 : p.closest('[role="dialog"]')) ?? document.body;
38
- return /* @__PURE__ */ x("div", { ref: r, className: "flex shrink-0 items-center", children: [
39
- /* @__PURE__ */ c(
50
+ }, [e]), !a)
51
+ return /* @__PURE__ */ h("div", { ref: r, className: "contents", "data-nvr-header-tools": "inline", children: u });
52
+ const s = e ? (m = d.current) == null ? void 0 : m.getBoundingClientRect() : void 0, t = ((b = d.current) == null ? void 0 : b.closest('[role="dialog"]')) ?? document.body, w = s ? s.right - (t === document.body ? 0 : t.getBoundingClientRect().left) - 16 : 440;
53
+ return /* @__PURE__ */ E("div", { ref: r, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
54
+ /* @__PURE__ */ h(
40
55
  "button",
41
56
  {
42
- ref: h,
57
+ ref: d,
43
58
  type: "button",
44
59
  "data-nvr-header-tools-btn": !0,
45
- "aria-expanded": t,
60
+ "aria-expanded": e,
46
61
  "aria-label": "More tools",
47
62
  "data-tip": "More tools",
48
- onClick: () => b((e) => !e),
49
- className: w(
63
+ onClick: () => l((n) => !n),
64
+ className: y(
50
65
  "inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
51
- t && "bg-accent text-accent-foreground dark:bg-accent"
66
+ e && "bg-accent text-accent-foreground dark:bg-accent"
52
67
  ),
53
- children: /* @__PURE__ */ c(R, { className: "h-4 w-4" })
68
+ children: /* @__PURE__ */ h(C, { className: "h-4 w-4" })
54
69
  }
55
70
  ),
56
- t && s && C(
57
- /* @__PURE__ */ c(
71
+ e && s && M(
72
+ /* @__PURE__ */ h(
58
73
  "div",
59
74
  {
60
75
  "data-nvr-header-tools-panel": !0,
61
- style: n === document.body ? {
76
+ style: t === document.body ? {
62
77
  position: "fixed",
63
78
  top: s.bottom + 6,
64
79
  right: Math.max(8, window.innerWidth - s.right),
80
+ maxWidth: Math.min(440, w),
65
81
  zIndex: 110
66
82
  } : {
67
83
  position: "absolute",
68
- top: s.bottom - n.getBoundingClientRect().top + 6,
69
- right: Math.max(8, n.getBoundingClientRect().right - s.right),
84
+ top: s.bottom - t.getBoundingClientRect().top + 6,
85
+ right: Math.max(8, t.getBoundingClientRect().right - s.right),
86
+ maxWidth: Math.min(440, w),
70
87
  zIndex: 110
71
88
  },
72
- className: "flex max-w-[440px] flex-wrap items-center justify-end gap-1.5 rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card",
73
- children: m
89
+ className: "flex flex-wrap items-center justify-end gap-1.5 rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card",
90
+ children: u
74
91
  }
75
92
  ),
76
- n
93
+ t
77
94
  )
78
95
  ] });
79
96
  }
80
- function W({
81
- children: m,
97
+ function O(u, r) {
98
+ const [d, a] = _(!1), i = v(!1);
99
+ i.current = d;
100
+ const c = v(0);
101
+ return k(() => {
102
+ const o = u.current, e = o == null ? void 0 : o.closest("[data-nvr-header-row]");
103
+ if (!r || !o || !e) {
104
+ !r && i.current && a(!1);
105
+ return;
106
+ }
107
+ const l = () => {
108
+ if (i.current)
109
+ c.current > 0 && e.clientWidth > c.current + 32 && a(!1);
110
+ else {
111
+ if (e.scrollWidth <= e.clientWidth + 2) return;
112
+ const t = e.querySelector("[data-nvr-header-tools]");
113
+ if ((t == null ? void 0 : t.getAttribute("data-nvr-header-tools")) === "inline" && t.childElementCount > 0)
114
+ return;
115
+ c.current = e.scrollWidth, a(!0);
116
+ }
117
+ };
118
+ l();
119
+ const s = new ResizeObserver(l);
120
+ return s.observe(e), o.parentElement && o.parentElement !== e && s.observe(o.parentElement), () => s.disconnect();
121
+ }), d;
122
+ }
123
+ function j({
124
+ children: u,
82
125
  label: r = "More",
83
- className: h
126
+ className: d
84
127
  }) {
85
- var b, s;
86
- const l = v(null), [o, u] = k(!1);
87
- _(() => {
88
- if (!o) return;
89
- const n = (p) => {
90
- var i;
91
- const e = p.target;
92
- e.closest("[data-nvr-header-menu-panel]") || e.closest("[data-nvr-header-menu-btn]") || e.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
93
- e.closest('[role="dialog"]') && !((i = e.closest('[role="dialog"]')) != null && i.contains(l.current)) || u(!1);
94
- }, f = (p) => {
95
- p.key === "Escape" && u(!1);
128
+ var l, s;
129
+ const a = v(null), [i, c] = _(!1);
130
+ k(() => {
131
+ if (!i) return;
132
+ const t = (m) => {
133
+ var n;
134
+ const b = m.target;
135
+ b.closest("[data-nvr-header-menu-panel]") || b.closest("[data-nvr-header-menu-btn]") || b.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
136
+ b.closest('[role="dialog"]') && !((n = b.closest('[role="dialog"]')) != null && n.contains(a.current)) || c(!1);
137
+ }, w = (m) => {
138
+ m.key !== "Escape" || !W(m, a.current) || (m.stopPropagation(), c(!1));
96
139
  };
97
- return window.addEventListener("mousedown", n, !0), window.addEventListener("keydown", f), () => {
98
- window.removeEventListener("mousedown", n, !0), window.removeEventListener("keydown", f);
140
+ return window.addEventListener("mousedown", t, !0), window.addEventListener("keydown", w, !0), () => {
141
+ window.removeEventListener("mousedown", t, !0), window.removeEventListener("keydown", w, !0);
99
142
  };
100
- }, [o]);
101
- const a = o ? (b = l.current) == null ? void 0 : b.getBoundingClientRect() : void 0, t = ((s = l.current) == null ? void 0 : s.closest('[role="dialog"]')) ?? document.body;
102
- return /* @__PURE__ */ x("div", { className: w("relative shrink-0", h), children: [
103
- /* @__PURE__ */ x(
143
+ }, [i]);
144
+ const o = i ? (l = a.current) == null ? void 0 : l.getBoundingClientRect() : void 0, e = ((s = a.current) == null ? void 0 : s.closest('[role="dialog"]')) ?? document.body;
145
+ return /* @__PURE__ */ E("div", { className: y("relative shrink-0", d), children: [
146
+ /* @__PURE__ */ E(
104
147
  "button",
105
148
  {
106
- ref: l,
149
+ ref: a,
107
150
  type: "button",
108
151
  "data-nvr-header-menu-btn": !0,
109
152
  "aria-haspopup": "menu",
110
- "aria-expanded": o,
153
+ "aria-expanded": i,
111
154
  "aria-label": r,
112
155
  "data-tip": "More actions",
113
- onClick: () => u((n) => !n),
114
- className: w(
156
+ onClick: () => c((t) => !t),
157
+ className: y(
115
158
  "inline-flex h-9 items-center gap-1 rounded-md border border-input bg-background px-2.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
116
- o && "bg-accent text-accent-foreground dark:bg-accent"
159
+ i && "bg-accent text-accent-foreground dark:bg-accent"
117
160
  ),
118
161
  children: [
119
- /* @__PURE__ */ c(R, { className: "h-4 w-4" }),
120
- /* @__PURE__ */ c("span", { className: "hidden lg:inline", children: r })
162
+ /* @__PURE__ */ h(C, { className: "h-4 w-4" }),
163
+ /* @__PURE__ */ h("span", { className: "hidden lg:inline", children: r })
121
164
  ]
122
165
  }
123
166
  ),
124
- o && a && C(
125
- /* @__PURE__ */ c(
167
+ i && o && M(
168
+ /* @__PURE__ */ h(
126
169
  "div",
127
170
  {
128
171
  "data-nvr-header-menu-panel": !0,
129
172
  role: "menu",
130
- onClick: (n) => {
131
- n.target.closest("[data-nvr-menu-close]") && u(!1);
173
+ onClick: (t) => {
174
+ t.target.closest("[data-nvr-menu-close]") && c(!1);
132
175
  },
133
- style: t === document.body ? {
176
+ style: e === document.body ? {
134
177
  position: "fixed",
135
- top: a.bottom + 6,
136
- right: Math.max(8, window.innerWidth - a.right),
178
+ top: o.bottom + 6,
179
+ right: Math.max(8, window.innerWidth - o.right),
137
180
  zIndex: 110
138
181
  } : {
139
182
  position: "absolute",
140
- top: a.bottom - t.getBoundingClientRect().top + 6,
141
- right: Math.max(8, t.getBoundingClientRect().right - a.right),
183
+ top: o.bottom - e.getBoundingClientRect().top + 6,
184
+ right: Math.max(8, e.getBoundingClientRect().right - o.right),
142
185
  zIndex: 110
143
186
  },
144
- className: w(
187
+ className: y(
145
188
  "flex w-[240px] flex-col gap-px rounded-lg border border-slate-200 bg-white p-1 shadow-xl dark:border-border dark:bg-card",
146
189
  "[&_button]:h-8 [&_button]:w-full [&_button]:justify-start [&_button]:gap-2 [&_button]:rounded-sm [&_button]:border-0 [&_button]:bg-transparent [&_button]:px-2 [&_button]:text-[12.5px] [&_button]:font-medium [&_button]:shadow-none",
147
190
  "[&_button:hover]:bg-accent [&_button:hover]:text-accent-foreground [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button_svg]:shrink-0 [&_button_svg]:text-slate-500",
148
191
  "[&>[data-nvr-menu-divider]]:my-1 [&>[data-nvr-menu-divider]]:h-px [&>[data-nvr-menu-divider]]:bg-slate-100 dark:[&>[data-nvr-menu-divider]]:bg-border"
149
192
  ),
150
- children: m
193
+ children: u
151
194
  }
152
195
  ),
153
- t
196
+ e
154
197
  )
155
198
  ] });
156
199
  }
157
- function j({
158
- children: m,
200
+ function P({
201
+ children: u,
159
202
  className: r
160
203
  }) {
161
- return /* @__PURE__ */ c(
204
+ return /* @__PURE__ */ h(
162
205
  "div",
163
206
  {
164
207
  "data-nvr-header-tool-group": !0,
165
- className: w(
208
+ className: y(
166
209
  "inline-flex h-9 shrink-0 items-center rounded-md border border-input bg-background px-0.5 shadow-sm [&>*+*]:border-l [&>*+*]:border-input/70",
167
210
  r
168
211
  ),
169
- children: m
212
+ children: u
170
213
  }
171
214
  );
172
215
  }
173
216
  export {
174
- W as HeaderMenu,
175
- j as HeaderToolGroup,
176
- B as HeaderTools
217
+ j as HeaderMenu,
218
+ P as HeaderToolGroup,
219
+ I as HeaderTools,
220
+ O as useHeaderFold
177
221
  };