@nivaro/react 0.3.15 → 0.3.17

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 (37) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +127 -6
  4. package/dist/index.js +736 -734
  5. package/dist/shared/components/CollectionBrowserView.js +2344 -2309
  6. package/dist/shared/components/ItemEditForm.js +3773 -3604
  7. package/dist/shared/components/RecordGridEditor.js +319 -282
  8. package/dist/shared/components/RecordReadView.js +202 -200
  9. package/dist/shared/components/cbv/unknown-fields.js +18 -8
  10. package/dist/shared/components/chat/ChatAnalyticsView.js +2 -2
  11. package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
  13. package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
  14. package/dist/shared/components/item-edit/FieldRow.js +198 -184
  15. package/dist/shared/components/item-edit/HeaderTools.js +107 -99
  16. package/dist/shared/components/item-edit/InlineTableField.js +138 -136
  17. package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
  18. package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
  19. package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
  20. package/dist/shared/components/item-edit/column-length.js +12 -0
  21. package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
  22. package/dist/shared/components/panels/ItemLockBanner.js +307 -285
  23. package/dist/shared/components/panels/PipelinePanel.js +486 -465
  24. package/dist/shared/components/panels/RevisionsPanel.js +210 -204
  25. package/dist/shared/components/pipeline/PipelineEditorView.js +1672 -1568
  26. package/dist/shared/components/profile/DelegationCard.js +178 -121
  27. package/dist/shared/components/profile/PersonActivity.js +152 -139
  28. package/dist/shared/components/queue/QueueWorklist.js +668 -659
  29. package/dist/shared/components/queue/transition-note.js +90 -0
  30. package/dist/shared/components/support/SupportRequestDialog.js +100 -89
  31. package/dist/shared/components/support/TicketDetailSheet.js +104 -91
  32. package/dist/shared/lib/autofill-runs.js +33 -26
  33. package/dist/shared/lib/draft-store.js +40 -24
  34. package/dist/shared/lib/live-queries.js +10 -9
  35. package/dist/shared/lib/request-gate.js +140 -127
  36. package/dist/shared/lib/restore-skipped.js +10 -0
  37. package/package.json +1 -1
@@ -1,57 +1,57 @@
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";
1
+ import { jsx as m, jsxs as E } from "react/jsx-runtime";
2
+ import { MoreHorizontal as W } from "lucide-react";
3
+ import { useRef as v, useState as y, useEffect as k } from "react";
4
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;
5
+ import { cn as _ } from "../../lib/utils.js";
6
+ function N(c, t) {
7
+ const d = c.target;
8
8
  if (!(d != null && d.closest)) return !0;
9
9
  if (d.closest("[data-radix-popper-content-wrapper]")) return !1;
10
10
  const a = d.closest('[role="dialog"]');
11
- return !a || !!(r && a.contains(r));
11
+ return !a || !!(t && a.contains(t));
12
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);
13
+ function j({ children: c }) {
14
+ var h, g;
15
+ const t = v(null), d = v(null), [a, i] = y(!1), l = v(!1);
16
+ l.current = a;
17
+ const o = v(0), [e, u] = y(!1);
18
18
  if (k(() => {
19
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));
20
+ const r = (x = t.current) == null ? void 0 : x.closest("[data-nvr-header-row]");
21
+ if (!r) return;
22
+ const f = () => {
23
+ l.current ? o.current > 0 && r.clientWidth > o.current + 32 && i(!1) : r.scrollWidth > r.clientWidth + 2 && (o.current = r.scrollWidth, i(!0), u(!1));
24
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();
25
+ f();
26
+ const b = new ResizeObserver(f);
27
+ b.observe(r);
28
+ const p = (R = t.current) == null ? void 0 : R.parentElement;
29
+ return p && p !== r && b.observe(p), () => b.disconnect();
30
30
  }), k(() => {
31
31
  if (!e) return;
32
- const n = (p) => {
33
- p.key !== "Escape" || !W(p, r.current) || (p.stopPropagation(), l(!1));
32
+ const r = (f) => {
33
+ f.key !== "Escape" || !N(f, t.current) || (f.stopPropagation(), u(!1));
34
34
  };
35
- return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
35
+ return window.addEventListener("keydown", r, !0), () => window.removeEventListener("keydown", r, !0);
36
36
  }, [e]), k(() => {
37
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]"))
38
+ const r = (b) => {
39
+ const p = b.target;
40
+ if (p.closest("[data-nvr-header-tools-panel]") || p.closest("[data-nvr-header-tools-btn]") || p.closest("[data-nvr-header-menu-panel]") || p.closest("[data-radix-popper-content-wrapper]"))
41
41
  return;
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);
42
+ const x = p.closest('[role="dialog"]');
43
+ x && !x.contains(t.current) || u(!1);
44
+ }, f = (b) => {
45
+ b.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && u(!1);
46
46
  };
47
- return window.addEventListener("mousedown", n, !0), window.addEventListener("click", p), () => {
48
- window.removeEventListener("mousedown", n, !0), window.removeEventListener("click", p);
47
+ return window.addEventListener("mousedown", r, !0), window.addEventListener("click", f), () => {
48
+ window.removeEventListener("mousedown", r, !0), window.removeEventListener("click", f);
49
49
  };
50
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(
51
+ return /* @__PURE__ */ m("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
52
+ const s = e ? (h = d.current) == null ? void 0 : h.getBoundingClientRect() : void 0, n = ((g = d.current) == null ? void 0 : g.closest('[role="dialog"]')) ?? document.body, w = s ? s.right - (n === document.body ? 0 : n.getBoundingClientRect().left) - 16 : 440;
53
+ return /* @__PURE__ */ E("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
54
+ /* @__PURE__ */ m(
55
55
  "button",
56
56
  {
57
57
  ref: d,
@@ -60,20 +60,20 @@ function I({ children: u }) {
60
60
  "aria-expanded": e,
61
61
  "aria-label": "More tools",
62
62
  "data-tip": "More tools",
63
- onClick: () => l((n) => !n),
64
- className: y(
63
+ onClick: () => u((r) => !r),
64
+ className: _(
65
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",
66
66
  e && "bg-accent text-accent-foreground dark:bg-accent"
67
67
  ),
68
- children: /* @__PURE__ */ h(C, { className: "h-4 w-4" })
68
+ children: /* @__PURE__ */ m(W, { className: "h-4 w-4" })
69
69
  }
70
70
  ),
71
71
  e && s && M(
72
- /* @__PURE__ */ h(
72
+ /* @__PURE__ */ m(
73
73
  "div",
74
74
  {
75
75
  "data-nvr-header-tools-panel": !0,
76
- style: t === document.body ? {
76
+ style: n === document.body ? {
77
77
  position: "fixed",
78
78
  top: s.bottom + 6,
79
79
  right: Math.max(8, window.innerWidth - s.right),
@@ -81,68 +81,72 @@ function I({ children: u }) {
81
81
  zIndex: 110
82
82
  } : {
83
83
  position: "absolute",
84
- top: s.bottom - t.getBoundingClientRect().top + 6,
85
- right: Math.max(8, t.getBoundingClientRect().right - s.right),
84
+ top: s.bottom - n.getBoundingClientRect().top + 6,
85
+ right: Math.max(8, n.getBoundingClientRect().right - s.right),
86
86
  maxWidth: Math.min(440, w),
87
87
  zIndex: 110
88
88
  },
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
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 [&_[data-nvr-header-tool-group]]:h-auto [&_[data-nvr-header-tool-group]]:min-h-9 [&_[data-nvr-header-tool-group]]:max-w-full [&_[data-nvr-header-tool-group]]:shrink [&_[data-nvr-header-tool-group]]:flex-wrap",
90
+ children: c
91
91
  }
92
92
  ),
93
- t
93
+ n
94
94
  )
95
95
  ] });
96
96
  }
97
- function O(u, r) {
98
- const [d, a] = _(!1), i = v(!1);
97
+ function D(c, t) {
98
+ const [d, a] = y(!1), i = v(!1);
99
99
  i.current = d;
100
- const c = v(0);
100
+ const l = v(0);
101
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);
102
+ const o = c.current, e = o == null ? void 0 : o.closest("[data-nvr-header-row]");
103
+ if (!t || !o || !e) {
104
+ !t && i.current && a(!1);
105
105
  return;
106
106
  }
107
- const l = () => {
107
+ const u = () => {
108
108
  if (i.current)
109
- c.current > 0 && e.clientWidth > c.current + 32 && a(!1);
109
+ l.current > 0 && e.clientWidth > l.current + 32 && a(!1);
110
110
  else {
111
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)
112
+ const n = e.querySelector("[data-nvr-header-tools]");
113
+ if ((n == null ? void 0 : n.getAttribute("data-nvr-header-tools")) === "inline" && n.childElementCount > 0)
114
114
  return;
115
- c.current = e.scrollWidth, a(!0);
115
+ l.current = e.scrollWidth, a(!0);
116
116
  }
117
117
  };
118
- l();
119
- const s = new ResizeObserver(l);
118
+ u();
119
+ const s = new ResizeObserver(u);
120
120
  return s.observe(e), o.parentElement && o.parentElement !== e && s.observe(o.parentElement), () => s.disconnect();
121
121
  }), d;
122
122
  }
123
- function j({
124
- children: u,
125
- label: r = "More",
123
+ const L = 240;
124
+ function C(c, t) {
125
+ return Math.max(8, Math.min(c, t - L - 8));
126
+ }
127
+ function P({
128
+ children: c,
129
+ label: t = "More",
126
130
  className: d
127
131
  }) {
128
- var l, s;
129
- const a = v(null), [i, c] = _(!1);
132
+ var u, s;
133
+ const a = v(null), [i, l] = y(!1);
130
134
  k(() => {
131
135
  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));
136
+ const n = (h) => {
137
+ var r;
138
+ const g = h.target;
139
+ g.closest("[data-nvr-header-menu-panel]") || g.closest("[data-nvr-header-menu-btn]") || g.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
140
+ g.closest('[role="dialog"]') && !((r = g.closest('[role="dialog"]')) != null && r.contains(a.current)) || l(!1);
141
+ }, w = (h) => {
142
+ h.key !== "Escape" || !N(h, a.current) || (h.stopPropagation(), l(!1));
139
143
  };
140
- return window.addEventListener("mousedown", t, !0), window.addEventListener("keydown", w, !0), () => {
141
- window.removeEventListener("mousedown", t, !0), window.removeEventListener("keydown", w, !0);
144
+ return window.addEventListener("mousedown", n, !0), window.addEventListener("keydown", w, !0), () => {
145
+ window.removeEventListener("mousedown", n, !0), window.removeEventListener("keydown", w, !0);
142
146
  };
143
147
  }, [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: [
148
+ const o = i ? (u = a.current) == null ? void 0 : u.getBoundingClientRect() : void 0, e = ((s = a.current) == null ? void 0 : s.closest('[role="dialog"]')) ?? document.body;
149
+ return /* @__PURE__ */ E("div", { className: _("relative shrink-0", d), children: [
146
150
  /* @__PURE__ */ E(
147
151
  "button",
148
152
  {
@@ -151,71 +155,75 @@ function j({
151
155
  "data-nvr-header-menu-btn": !0,
152
156
  "aria-haspopup": "menu",
153
157
  "aria-expanded": i,
154
- "aria-label": r,
158
+ "aria-label": t,
155
159
  "data-tip": "More actions",
156
- onClick: () => c((t) => !t),
157
- className: y(
160
+ onClick: () => l((n) => !n),
161
+ className: _(
158
162
  "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",
159
163
  i && "bg-accent text-accent-foreground dark:bg-accent"
160
164
  ),
161
165
  children: [
162
- /* @__PURE__ */ h(C, { className: "h-4 w-4" }),
163
- /* @__PURE__ */ h("span", { className: "hidden lg:inline", children: r })
166
+ /* @__PURE__ */ m(W, { className: "h-4 w-4" }),
167
+ /* @__PURE__ */ m("span", { className: "hidden lg:inline", children: t })
164
168
  ]
165
169
  }
166
170
  ),
167
171
  i && o && M(
168
- /* @__PURE__ */ h(
172
+ /* @__PURE__ */ m(
169
173
  "div",
170
174
  {
171
175
  "data-nvr-header-menu-panel": !0,
172
176
  role: "menu",
173
- onClick: (t) => {
174
- t.target.closest("[data-nvr-menu-close]") && c(!1);
177
+ onClick: (n) => {
178
+ n.target.closest("[data-nvr-menu-close]") && l(!1);
175
179
  },
176
180
  style: e === document.body ? {
177
181
  position: "fixed",
178
182
  top: o.bottom + 6,
179
- right: Math.max(8, window.innerWidth - o.right),
183
+ right: C(window.innerWidth - o.right, window.innerWidth),
180
184
  zIndex: 110
181
185
  } : {
182
186
  position: "absolute",
183
187
  top: o.bottom - e.getBoundingClientRect().top + 6,
184
- right: Math.max(8, e.getBoundingClientRect().right - o.right),
188
+ right: C(
189
+ e.getBoundingClientRect().right - o.right,
190
+ e.getBoundingClientRect().width
191
+ ),
185
192
  zIndex: 110
186
193
  },
187
- className: y(
194
+ className: _(
188
195
  "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",
189
196
  "[&_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",
190
197
  "[&_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",
191
198
  "[&>[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"
192
199
  ),
193
- children: u
200
+ children: c
194
201
  }
195
202
  ),
196
203
  e
197
204
  )
198
205
  ] });
199
206
  }
200
- function P({
201
- children: u,
202
- className: r
207
+ function T({
208
+ children: c,
209
+ className: t
203
210
  }) {
204
- return /* @__PURE__ */ h(
211
+ return /* @__PURE__ */ m(
205
212
  "div",
206
213
  {
207
214
  "data-nvr-header-tool-group": !0,
208
- className: y(
215
+ className: _(
209
216
  "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",
210
- r
217
+ t
211
218
  ),
212
- children: u
219
+ children: c
213
220
  }
214
221
  );
215
222
  }
216
223
  export {
217
- j as HeaderMenu,
218
- P as HeaderToolGroup,
219
- I as HeaderTools,
220
- O as useHeaderFold
224
+ P as HeaderMenu,
225
+ T as HeaderToolGroup,
226
+ j as HeaderTools,
227
+ C as menuRight,
228
+ D as useHeaderFold
221
229
  };