@nivaro/react 0.3.48 → 0.3.50

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 (52) hide show
  1. package/dist/components/InlineGridField.js +166 -105
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +25 -1
  5. package/dist/shared/components/CellCopyLayer.js +81 -44
  6. package/dist/shared/components/CollectionBrowserView.js +306 -297
  7. package/dist/shared/components/DataTable.js +3 -3
  8. package/dist/shared/components/FulfilmentPill.js +98 -78
  9. package/dist/shared/components/ItemEditForm.js +4682 -4570
  10. package/dist/shared/components/NotificationSourcesCard.js +151 -147
  11. package/dist/shared/components/ProfileView.js +72 -70
  12. package/dist/shared/components/QueryTable.js +462 -333
  13. package/dist/shared/components/imports/ImportConsole.js +4 -4
  14. package/dist/shared/components/integrations/console/IntegrationsConsole.js +58 -50
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
  16. package/dist/shared/components/item-edit/CloneDialog.js +192 -142
  17. package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
  18. package/dist/shared/components/item-edit/FieldRow.js +236 -226
  19. package/dist/shared/components/item-edit/HeaderTools.js +118 -113
  20. package/dist/shared/components/item-edit/InlineGridField.js +92 -90
  21. package/dist/shared/components/item-edit/InlineTableField.js +3091 -2942
  22. package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
  23. package/dist/shared/components/item-edit/PlanGrid.js +162 -162
  24. package/dist/shared/components/item-edit/PolishFields.js +169 -162
  25. package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
  26. package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
  27. package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
  28. package/dist/shared/components/item-edit/helpers.js +181 -155
  29. package/dist/shared/components/item-edit/line-midair.js +201 -0
  30. package/dist/shared/components/item-edit/soft-rules.js +27 -0
  31. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  32. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +65 -65
  33. package/dist/shared/components/layout-editor/settings/settings-registry.js +4 -4
  34. package/dist/shared/components/notifications/DeliveryChips.js +9 -9
  35. package/dist/shared/components/panels/ItemLockBanner.js +414 -358
  36. package/dist/shared/components/panels/PipelinePanel.js +1171 -975
  37. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  38. package/dist/shared/components/panels/SlaBreachBanner.js +2 -2
  39. package/dist/shared/components/panels/TransitionRequirementsDialog.js +384 -380
  40. package/dist/shared/components/profile/PersonProfile.js +23 -21
  41. package/dist/shared/components/profile/SignedInDevices.js +126 -0
  42. package/dist/shared/components/queue/QueueItemSheet.js +38 -37
  43. package/dist/shared/components/queue/QueueWorklist.js +870 -827
  44. package/dist/shared/components/queue/column-chooser.js +21 -0
  45. package/dist/shared/components/queue/live-state-aspect.js +6 -0
  46. package/dist/shared/components/support/SupportView.js +1 -1
  47. package/dist/shared/components/ui/number-draft-input.js +93 -0
  48. package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
  49. package/dist/shared/lib/edit-lock-fields.js +7 -0
  50. package/dist/shared/lib/error-hints.js +1 -0
  51. package/dist/shared/lib/reimport-visibility.js +10 -0
  52. package/package.json +1 -1
@@ -1,153 +1,158 @@
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
- import { createPortal as M } from "react-dom";
5
- import { cn as _ } from "../../lib/utils.js";
6
- function N(c, t) {
1
+ import { jsx as v, jsxs as W } from "react/jsx-runtime";
2
+ import { MoreHorizontal as N } from "lucide-react";
3
+ import { useRef as b, useState as R, useEffect as _ } from "react";
4
+ import { createPortal as L } from "react-dom";
5
+ import { cn as y } from "../../lib/utils.js";
6
+ function B(c, t) {
7
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
11
  return !a || !!(t && a.contains(t));
12
12
  }
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
- if (k(() => {
19
- var x, R;
20
- const r = (x = t.current) == null ? void 0 : x.closest("[data-nvr-header-row]");
21
- if (!r) return;
13
+ function D({ children: c }) {
14
+ var g, x;
15
+ const t = b(null), d = b(null), [a, i] = R(!1), u = b(!1);
16
+ u.current = a;
17
+ const n = b(0), o = b(0), [s, l] = R(!1);
18
+ if (_(() => {
19
+ var k, C;
20
+ const e = (k = t.current) == null ? void 0 : k.closest("[data-nvr-header-row]");
21
+ if (!e) return;
22
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));
23
+ if (!u.current) {
24
+ e.scrollWidth > e.clientWidth + 2 && (n.current = e.scrollWidth, i(!0), l(!1));
25
+ return;
26
+ }
27
+ const E = e.hasAttribute("data-nvr-header-wrap");
28
+ !E && e.scrollWidth > e.clientWidth + 2 ? (o.current = e.scrollWidth, e.setAttribute("data-nvr-header-wrap", "")) : E && e.clientWidth > o.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !E && n.current > 0 && e.clientWidth > n.current + 32 && i(!1);
24
29
  };
25
30
  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
- }), k(() => {
31
- if (!e) return;
32
- const r = (f) => {
33
- f.key !== "Escape" || !N(f, t.current) || (f.stopPropagation(), u(!1));
31
+ const w = new ResizeObserver(f);
32
+ w.observe(e);
33
+ const p = (C = t.current) == null ? void 0 : C.parentElement;
34
+ return p && p !== e && w.observe(p), () => w.disconnect();
35
+ }), _(() => {
36
+ if (!s) return;
37
+ const e = (f) => {
38
+ f.key !== "Escape" || !B(f, t.current) || (f.stopPropagation(), l(!1));
34
39
  };
35
- return window.addEventListener("keydown", r, !0), () => window.removeEventListener("keydown", r, !0);
36
- }, [e]), k(() => {
37
- if (!e) return;
38
- const r = (b) => {
39
- const p = b.target;
40
+ return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
41
+ }, [s]), _(() => {
42
+ if (!s) return;
43
+ const e = (w) => {
44
+ const p = w.target;
40
45
  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
46
  return;
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);
47
+ const k = p.closest('[role="dialog"]');
48
+ k && !k.contains(t.current) || l(!1);
49
+ }, f = (w) => {
50
+ w.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && l(!1);
46
51
  };
47
- return window.addEventListener("mousedown", r, !0), window.addEventListener("click", f), () => {
48
- window.removeEventListener("mousedown", r, !0), window.removeEventListener("click", f);
52
+ return window.addEventListener("mousedown", e, !0), window.addEventListener("click", f), () => {
53
+ window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", f);
49
54
  };
50
- }, [e]), !a)
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
+ }, [s]), !a)
56
+ return /* @__PURE__ */ v("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: c });
57
+ const r = s ? (g = d.current) == null ? void 0 : g.getBoundingClientRect() : void 0, h = ((x = d.current) == null ? void 0 : x.closest('[role="dialog"]')) ?? document.body, m = r ? r.right - (h === document.body ? 0 : h.getBoundingClientRect().left) - 16 : 440;
58
+ return /* @__PURE__ */ W("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
59
+ /* @__PURE__ */ v(
55
60
  "button",
56
61
  {
57
62
  ref: d,
58
63
  type: "button",
59
64
  "data-nvr-header-tools-btn": !0,
60
- "aria-expanded": e,
65
+ "aria-expanded": s,
61
66
  "aria-label": "More tools",
62
67
  "data-tip": "More tools",
63
- onClick: () => u((r) => !r),
64
- className: _(
68
+ onClick: () => l((e) => !e),
69
+ className: y(
65
70
  "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
- e && "bg-accent text-accent-foreground dark:bg-accent"
71
+ s && "bg-accent text-accent-foreground dark:bg-accent"
67
72
  ),
68
- children: /* @__PURE__ */ m(W, { className: "h-4 w-4" })
73
+ children: /* @__PURE__ */ v(N, { className: "h-4 w-4" })
69
74
  }
70
75
  ),
71
- e && s && M(
72
- /* @__PURE__ */ m(
76
+ s && r && L(
77
+ /* @__PURE__ */ v(
73
78
  "div",
74
79
  {
75
80
  "data-nvr-header-tools-panel": !0,
76
- style: n === document.body ? {
81
+ style: h === document.body ? {
77
82
  position: "fixed",
78
- top: s.bottom + 6,
79
- right: Math.max(8, window.innerWidth - s.right),
80
- maxWidth: Math.min(440, w),
83
+ top: r.bottom + 6,
84
+ right: Math.max(8, window.innerWidth - r.right),
85
+ maxWidth: Math.min(440, m),
81
86
  zIndex: 110
82
87
  } : {
83
88
  position: "absolute",
84
- top: s.bottom - n.getBoundingClientRect().top + 6,
85
- right: Math.max(8, n.getBoundingClientRect().right - s.right),
86
- maxWidth: Math.min(440, w),
89
+ top: r.bottom - h.getBoundingClientRect().top + 6,
90
+ right: Math.max(8, h.getBoundingClientRect().right - r.right),
91
+ maxWidth: Math.min(440, m),
87
92
  zIndex: 110
88
93
  },
89
94
  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
95
  children: c
91
96
  }
92
97
  ),
93
- n
98
+ h
94
99
  )
95
100
  ] });
96
101
  }
97
- function D(c, t) {
98
- const [d, a] = y(!1), i = v(!1);
102
+ function P(c, t) {
103
+ const [d, a] = R(!1), i = b(!1);
99
104
  i.current = d;
100
- const l = v(0);
101
- return k(() => {
102
- const o = c.current, e = o == null ? void 0 : o.closest("[data-nvr-header-row]");
103
- if (!t || !o || !e) {
105
+ const u = b(0);
106
+ return _(() => {
107
+ const n = c.current, o = n == null ? void 0 : n.closest("[data-nvr-header-row]");
108
+ if (!t || !n || !o) {
104
109
  !t && i.current && a(!1);
105
110
  return;
106
111
  }
107
- const u = () => {
112
+ const s = () => {
108
113
  if (i.current)
109
- l.current > 0 && e.clientWidth > l.current + 32 && a(!1);
114
+ u.current > 0 && o.clientWidth > u.current + 32 && a(!1);
110
115
  else {
111
- if (e.scrollWidth <= e.clientWidth + 2) return;
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)
116
+ if (o.scrollWidth <= o.clientWidth + 2) return;
117
+ const r = o.querySelector("[data-nvr-header-tools]");
118
+ if ((r == null ? void 0 : r.getAttribute("data-nvr-header-tools")) === "inline" && r.childElementCount > 0)
114
119
  return;
115
- l.current = e.scrollWidth, a(!0);
120
+ u.current = o.scrollWidth, a(!0);
116
121
  }
117
122
  };
118
- u();
119
- const s = new ResizeObserver(u);
120
- return s.observe(e), o.parentElement && o.parentElement !== e && s.observe(o.parentElement), () => s.disconnect();
123
+ s();
124
+ const l = new ResizeObserver(s);
125
+ return l.observe(o), n.parentElement && n.parentElement !== o && l.observe(n.parentElement), () => l.disconnect();
121
126
  }), d;
122
127
  }
123
- const L = 240;
124
- function C(c, t) {
125
- return Math.max(8, Math.min(c, t - L - 8));
128
+ const z = 240;
129
+ function M(c, t) {
130
+ return Math.max(8, Math.min(c, t - z - 8));
126
131
  }
127
- function P({
132
+ function T({
128
133
  children: c,
129
134
  label: t = "More",
130
135
  className: d
131
136
  }) {
132
- var u, s;
133
- const a = v(null), [i, l] = y(!1);
134
- k(() => {
137
+ var s, l;
138
+ const a = b(null), [i, u] = R(!1);
139
+ _(() => {
135
140
  if (!i) return;
136
- const n = (h) => {
137
- var r;
138
- const g = h.target;
141
+ const r = (m) => {
142
+ var x;
143
+ const g = m.target;
139
144
  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));
145
+ g.closest('[role="dialog"]') && !((x = g.closest('[role="dialog"]')) != null && x.contains(a.current)) || u(!1);
146
+ }, h = (m) => {
147
+ m.key !== "Escape" || !B(m, a.current) || (m.stopPropagation(), u(!1));
143
148
  };
144
- return window.addEventListener("mousedown", n, !0), window.addEventListener("keydown", w, !0), () => {
145
- window.removeEventListener("mousedown", n, !0), window.removeEventListener("keydown", w, !0);
149
+ return window.addEventListener("mousedown", r, !0), window.addEventListener("keydown", h, !0), () => {
150
+ window.removeEventListener("mousedown", r, !0), window.removeEventListener("keydown", h, !0);
146
151
  };
147
152
  }, [i]);
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: [
150
- /* @__PURE__ */ E(
153
+ const n = i ? (s = a.current) == null ? void 0 : s.getBoundingClientRect() : void 0, o = ((l = a.current) == null ? void 0 : l.closest('[role="dialog"]')) ?? document.body;
154
+ return /* @__PURE__ */ W("div", { className: y("relative shrink-0", d), children: [
155
+ /* @__PURE__ */ W(
151
156
  "button",
152
157
  {
153
158
  ref: a,
@@ -157,41 +162,41 @@ function P({
157
162
  "aria-expanded": i,
158
163
  "aria-label": t,
159
164
  "data-tip": "More actions",
160
- onClick: () => l((n) => !n),
161
- className: _(
165
+ onClick: () => u((r) => !r),
166
+ className: y(
162
167
  "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",
163
168
  i && "bg-accent text-accent-foreground dark:bg-accent"
164
169
  ),
165
170
  children: [
166
- /* @__PURE__ */ m(W, { className: "h-4 w-4" }),
167
- /* @__PURE__ */ m("span", { className: "hidden lg:inline", children: t })
171
+ /* @__PURE__ */ v(N, { className: "h-4 w-4" }),
172
+ /* @__PURE__ */ v("span", { className: "hidden lg:inline", children: t })
168
173
  ]
169
174
  }
170
175
  ),
171
- i && o && M(
172
- /* @__PURE__ */ m(
176
+ i && n && L(
177
+ /* @__PURE__ */ v(
173
178
  "div",
174
179
  {
175
180
  "data-nvr-header-menu-panel": !0,
176
181
  role: "menu",
177
- onClick: (n) => {
178
- n.target.closest("[data-nvr-menu-close]") && l(!1);
182
+ onClick: (r) => {
183
+ r.target.closest("[data-nvr-menu-close]") && u(!1);
179
184
  },
180
- style: e === document.body ? {
185
+ style: o === document.body ? {
181
186
  position: "fixed",
182
- top: o.bottom + 6,
183
- right: C(window.innerWidth - o.right, window.innerWidth),
187
+ top: n.bottom + 6,
188
+ right: M(window.innerWidth - n.right, window.innerWidth),
184
189
  zIndex: 110
185
190
  } : {
186
191
  position: "absolute",
187
- top: o.bottom - e.getBoundingClientRect().top + 6,
188
- right: C(
189
- e.getBoundingClientRect().right - o.right,
190
- e.getBoundingClientRect().width
192
+ top: n.bottom - o.getBoundingClientRect().top + 6,
193
+ right: M(
194
+ o.getBoundingClientRect().right - n.right,
195
+ o.getBoundingClientRect().width
191
196
  ),
192
197
  zIndex: 110
193
198
  },
194
- className: _(
199
+ className: y(
195
200
  "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",
196
201
  "[&_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",
197
202
  "[&_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",
@@ -200,19 +205,19 @@ function P({
200
205
  children: c
201
206
  }
202
207
  ),
203
- e
208
+ o
204
209
  )
205
210
  ] });
206
211
  }
207
- function T({
212
+ function F({
208
213
  children: c,
209
214
  className: t
210
215
  }) {
211
- return /* @__PURE__ */ m(
216
+ return /* @__PURE__ */ v(
212
217
  "div",
213
218
  {
214
219
  "data-nvr-header-tool-group": !0,
215
- className: _(
220
+ className: y(
216
221
  "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",
217
222
  t
218
223
  ),
@@ -221,9 +226,9 @@ function T({
221
226
  );
222
227
  }
223
228
  export {
224
- P as HeaderMenu,
225
- T as HeaderToolGroup,
226
- j as HeaderTools,
227
- C as menuRight,
228
- D as useHeaderFold
229
+ T as HeaderMenu,
230
+ F as HeaderToolGroup,
231
+ D as HeaderTools,
232
+ M as menuRight,
233
+ P as useHeaderFold
229
234
  };