@nivaro/react 0.3.57 → 0.3.59

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 (69) hide show
  1. package/dist/components/fields/RelationField.js +110 -80
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useRelationOptions.js +1 -0
  4. package/dist/hooks/useSessionRecorder.js +1 -1
  5. package/dist/index.d.ts +37 -2
  6. package/dist/index.js +523 -520
  7. package/dist/shared/components/CollectionBrowserView.js +2693 -2619
  8. package/dist/shared/components/DataTable.js +538 -495
  9. package/dist/shared/components/ItemEditForm.js +4559 -4386
  10. package/dist/shared/components/PageRenderer.js +537 -508
  11. package/dist/shared/components/ProfileView.js +716 -715
  12. package/dist/shared/components/QueryTable.js +74 -74
  13. package/dist/shared/components/RecordReadView.js +367 -364
  14. package/dist/shared/components/ReportView.js +64 -39
  15. package/dist/shared/components/WidgetSlot.js +543 -520
  16. package/dist/shared/components/alerts/AlertManagerView.js +324 -317
  17. package/dist/shared/components/alerts/types.js +37 -14
  18. package/dist/shared/components/cbv/row-focus.js +19 -0
  19. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  20. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  21. package/dist/shared/components/integrations/console/tone.js +52 -30
  22. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  23. package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
  24. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  25. package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
  26. package/dist/shared/components/item-edit/InlineTableField.js +2487 -2442
  27. package/dist/shared/components/item-edit/M2MCombobox.js +321 -295
  28. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  29. package/dist/shared/components/item-edit/PlanGrid.js +973 -894
  30. package/dist/shared/components/item-edit/QuickCreateButton.js +335 -106
  31. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  32. package/dist/shared/components/item-edit/RelationCombobox.js +452 -335
  33. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +262 -141
  34. package/dist/shared/components/item-edit/SummaryPanel.js +385 -358
  35. package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
  36. package/dist/shared/components/item-edit/line-midair.js +82 -75
  37. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  38. package/dist/shared/components/item-edit/related-missing.js +45 -0
  39. package/dist/shared/components/item-edit/save-outcome.js +9 -7
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  41. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  42. package/dist/shared/components/panels/ItemLockBanner.js +213 -211
  43. package/dist/shared/components/panels/PipelinePanel.js +1140 -1053
  44. package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
  45. package/dist/shared/components/panels/RevisionsPanel.js +316 -299
  46. package/dist/shared/components/panels/TaskPanel.js +265 -249
  47. package/dist/shared/components/panels/landing-state.js +27 -0
  48. package/dist/shared/components/pipeline/PipelineEditorView.js +110 -92
  49. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  50. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  51. package/dist/shared/components/queue/QueueQuickFilters.js +52 -52
  52. package/dist/shared/components/queue/QueueWorklist.js +1050 -1026
  53. package/dist/shared/components/queue/group-sums.js +27 -0
  54. package/dist/shared/components/queue/live-state-aspect.js +9 -5
  55. package/dist/shared/components/widgets/ReviewListWidget.js +175 -154
  56. package/dist/shared/lib/back-closes.js +25 -0
  57. package/dist/shared/lib/display-prefs.js +60 -52
  58. package/dist/shared/lib/draft-store.js +71 -48
  59. package/dist/shared/lib/expression.js +53 -53
  60. package/dist/shared/lib/form-usage-beacon.js +7 -7
  61. package/dist/shared/lib/list-page-memory.js +63 -0
  62. package/dist/shared/lib/live.js +44 -44
  63. package/dist/shared/lib/money-input.js +45 -0
  64. package/dist/shared/lib/own-writes.js +76 -28
  65. package/dist/shared/lib/request-gate.js +110 -109
  66. package/dist/shared/lib/sanitize-html.js +10 -6
  67. package/dist/shared/lib/staged-row-labels.js +18 -0
  68. package/dist/shared/lib/validation-rules.js +34 -19
  69. package/package.json +1 -1
@@ -1,104 +1,105 @@
1
- import { jsx as l, jsxs as n, Fragment as z } from "react/jsx-runtime";
2
- import { RotateCcw as A, Loader2 as B } from "lucide-react";
3
- import { useState as y, useMemo as E, useEffect as F } from "react";
4
- import { titleCase as j, cn as L } from "../../lib/utils.js";
5
- import { Dialog as R, DialogContent as G, DialogHeader as H, DialogTitle as I, DialogDescription as M, DialogBody as O, DialogFooter as V } from "../ui/dialog.js";
6
- import { FieldRenderer as q } from "./FieldRenderer.js";
7
- function X({
1
+ import { jsx as l, jsxs as i, Fragment as A } from "react/jsx-runtime";
2
+ import { RotateCcw as B, Loader2 as F } from "lucide-react";
3
+ import { useState as k, useMemo as j, useEffect as L } from "react";
4
+ import { titleCase as R, cn as G } from "../../lib/utils.js";
5
+ import { Dialog as H, DialogContent as M, DialogHeader as O, DialogTitle as V, DialogDescription as q, DialogBody as J, DialogFooter as K } from "../ui/dialog.js";
6
+ import { FieldRenderer as P } from "./FieldRenderer.js";
7
+ function _({
8
8
  open: p,
9
9
  onOpenChange: u,
10
10
  columns: o,
11
11
  rows: d,
12
- relations: N,
13
- collection: w,
12
+ relations: w,
13
+ collection: D,
14
14
  cascadeFilters: f,
15
- onApply: D
15
+ onApply: C,
16
+ onEditIntent: h
16
17
  }) {
17
- const [k, h] = y({}), [i, x] = y(/* @__PURE__ */ new Set()), [s, g] = y(!1), b = E(() => {
18
+ const [N, x] = k({}), [n, g] = k(/* @__PURE__ */ new Set()), [s, b] = k(!1), v = j(() => {
18
19
  const e = {};
19
20
  for (const a of o) {
20
21
  if (d.length === 0) {
21
22
  e[a.field] = { value: null, varies: !1 };
22
23
  continue;
23
24
  }
24
- const t = d[0][a.field] ?? null, c = d.every((v) => String(v[a.field] ?? "") === String(t ?? ""));
25
+ const t = d[0][a.field] ?? null, c = d.every((y) => String(y[a.field] ?? "") === String(t ?? ""));
25
26
  e[a.field] = { value: c ? t : null, varies: !c };
26
27
  }
27
28
  return e;
28
29
  }, [o, d]);
29
- F(() => {
30
+ L(() => {
30
31
  var a;
31
32
  if (!p) return;
32
33
  const e = {};
33
- for (const t of o) e[t.field] = ((a = b[t.field]) == null ? void 0 : a.value) ?? null;
34
- h(e), x(/* @__PURE__ */ new Set()), g(!1);
34
+ for (const t of o) e[t.field] = ((a = v[t.field]) == null ? void 0 : a.value) ?? null;
35
+ x(e), g(/* @__PURE__ */ new Set()), b(!1);
35
36
  }, [p]);
36
- const C = (e, a) => {
37
- h((t) => ({ ...t, [e]: a })), x((t) => /* @__PURE__ */ new Set([...t, e]));
38
- }, $ = (e) => {
39
- h((a) => {
37
+ const $ = (e, a) => {
38
+ h == null || h(), x((t) => ({ ...t, [e]: a })), g((t) => /* @__PURE__ */ new Set([...t, e]));
39
+ }, S = (e) => {
40
+ x((a) => {
40
41
  var t;
41
- return { ...a, [e]: ((t = b[e]) == null ? void 0 : t.value) ?? null };
42
- }), x((a) => {
42
+ return { ...a, [e]: ((t = v[e]) == null ? void 0 : t.value) ?? null };
43
+ }), g((a) => {
43
44
  const t = new Set(a);
44
45
  return t.delete(e), t;
45
46
  });
46
47
  }, r = d.length, m = r === 1 ? "line" : "lines";
47
- async function S() {
48
- if (i.size === 0 || s) return;
48
+ async function T() {
49
+ if (n.size === 0 || s) return;
49
50
  const e = {};
50
- for (const a of i) e[a] = k[a] ?? null;
51
- g(!0);
51
+ for (const a of n) e[a] = N[a] ?? null;
52
+ b(!0);
52
53
  try {
53
- await D(e), u(!1);
54
+ await C(e), u(!1);
54
55
  } finally {
55
- g(!1);
56
+ b(!1);
56
57
  }
57
58
  }
58
- return /* @__PURE__ */ l(R, { open: p, onOpenChange: (e) => !s && u(e), children: /* @__PURE__ */ n(
59
- G,
59
+ return /* @__PURE__ */ l(H, { open: p, onOpenChange: (e) => !s && u(e), children: /* @__PURE__ */ i(
60
+ M,
60
61
  {
61
62
  className: "max-w-3xl dark:bg-card",
62
63
  "data-o2m-editing": "",
63
64
  onOpenAutoFocus: (e) => e.preventDefault(),
64
65
  children: [
65
- /* @__PURE__ */ n(H, { children: [
66
- /* @__PURE__ */ n(I, { children: [
66
+ /* @__PURE__ */ i(O, { children: [
67
+ /* @__PURE__ */ i(V, { children: [
67
68
  "Edit ",
68
69
  r,
69
70
  " selected ",
70
71
  m
71
72
  ] }),
72
- /* @__PURE__ */ l(M, { children: "Only the fields you change here are written. Fields left as prefilled keep each line's own value." })
73
+ /* @__PURE__ */ l(q, { children: "Only the fields you change here are written. Fields left as prefilled keep each line's own value." })
73
74
  ] }),
74
- /* @__PURE__ */ l(O, { className: "max-h-[60vh] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ l("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "This table has no columns that can be edited in bulk." }) : /* @__PURE__ */ l(
75
+ /* @__PURE__ */ l(J, { className: "max-h-[60vh] overflow-y-auto", children: o.length === 0 ? /* @__PURE__ */ l("p", { className: "py-6 text-center text-[12px] text-slate-400", children: "This table has no columns that can be edited in bulk." }) : /* @__PURE__ */ l(
75
76
  "div",
76
77
  {
77
78
  className: "grid items-start gap-x-4 gap-y-3",
78
79
  style: { gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))" },
79
80
  children: o.map((e) => {
80
- const a = e.label || j(e.field), t = b[e.field], c = i.has(e.field), v = t != null && t.varies ? { ...e, placeholder: "(varies)", sort: e.sort ?? 0 } : { ...e, sort: e.sort ?? 0 };
81
- return /* @__PURE__ */ n(
81
+ const a = e.label || R(e.field), t = v[e.field], c = n.has(e.field), y = t != null && t.varies ? { ...e, placeholder: "(varies)", sort: e.sort ?? 0 } : { ...e, sort: e.sort ?? 0 };
82
+ return /* @__PURE__ */ i(
82
83
  "div",
83
84
  {
84
- className: L(
85
+ className: G(
85
86
  "flex min-w-0 flex-col gap-1 rounded-md p-1.5 -m-1.5 transition-colors",
86
87
  c && "bg-amber-50/70 dark:bg-amber-400/10"
87
88
  ),
88
89
  children: [
89
- /* @__PURE__ */ n("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: [
90
+ /* @__PURE__ */ i("span", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-slate-400", children: [
90
91
  /* @__PURE__ */ l("span", { className: "truncate", children: a }),
91
- c ? /* @__PURE__ */ n(z, { children: [
92
+ c ? /* @__PURE__ */ i(A, { children: [
92
93
  /* @__PURE__ */ l("span", { className: "rounded bg-amber-100 px-1 py-px text-[9px] normal-case tracking-normal text-amber-700 dark:bg-amber-400/20 dark:text-amber-300", children: "will apply" }),
93
- /* @__PURE__ */ n(
94
+ /* @__PURE__ */ i(
94
95
  "button",
95
96
  {
96
97
  type: "button",
97
- onClick: () => $(e.field),
98
+ onClick: () => S(e.field),
98
99
  className: "ml-auto inline-flex items-center gap-0.5 rounded px-1 text-[10px] normal-case tracking-normal text-slate-400 hover:text-slate-700 dark:hover:text-slate-200",
99
100
  "data-tip": "Leave this field as each line has it",
100
101
  children: [
101
- /* @__PURE__ */ l(A, { className: "h-2.5 w-2.5", "aria-hidden": "true" }),
102
+ /* @__PURE__ */ l(B, { className: "h-2.5 w-2.5", "aria-hidden": "true" }),
102
103
  "keep"
103
104
  ]
104
105
  }
@@ -113,13 +114,13 @@ function X({
113
114
  ) : null
114
115
  ] }),
115
116
  /* @__PURE__ */ l(
116
- q,
117
+ P,
117
118
  {
118
- field: v,
119
- value: k[e.field] ?? null,
120
- onChange: (T) => C(e.field, T),
121
- relations: N,
122
- collection: w,
119
+ field: y,
120
+ value: N[e.field] ?? null,
121
+ onChange: (z) => $(e.field, z),
122
+ relations: w,
123
+ collection: D,
123
124
  itemId: "new",
124
125
  cascadeFilter: f == null ? void 0 : f[e.field]
125
126
  }
@@ -131,8 +132,8 @@ function X({
131
132
  })
132
133
  }
133
134
  ) }),
134
- /* @__PURE__ */ n(V, { className: "items-center", children: [
135
- /* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children: i.size === 0 ? "Change a field to enable Apply" : `${i.size} ${i.size === 1 ? "field" : "fields"} → ${r} ${m}` }),
135
+ /* @__PURE__ */ i(K, { className: "items-center", children: [
136
+ /* @__PURE__ */ l("span", { className: "mr-auto text-[11px] text-slate-500 dark:text-slate-400", children: n.size === 0 ? "Change a field to enable Apply" : `${n.size} ${n.size === 1 ? "field" : "fields"} → ${r} ${m}` }),
136
137
  /* @__PURE__ */ l(
137
138
  "button",
138
139
  {
@@ -143,15 +144,15 @@ function X({
143
144
  children: "Cancel"
144
145
  }
145
146
  ),
146
- /* @__PURE__ */ n(
147
+ /* @__PURE__ */ i(
147
148
  "button",
148
149
  {
149
150
  type: "button",
150
- disabled: s || i.size === 0 || r === 0,
151
- onClick: () => void S(),
151
+ disabled: s || n.size === 0 || r === 0,
152
+ onClick: () => void T(),
152
153
  className: "inline-flex items-center gap-1.5 rounded bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:brightness-110 disabled:opacity-50",
153
154
  children: [
154
- s && /* @__PURE__ */ l(B, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }),
155
+ s && /* @__PURE__ */ l(F, { className: "h-3.5 w-3.5 animate-spin", "aria-hidden": "true" }),
155
156
  s ? "Applying…" : `Apply to ${r} ${m}`
156
157
  ]
157
158
  }
@@ -162,5 +163,5 @@ function X({
162
163
  ) });
163
164
  }
164
165
  export {
165
- X as GridBulkEditDialog
166
+ _ as GridBulkEditDialog
166
167
  };