@nivaro/react 0.3.57 → 0.3.58

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/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +5 -1
  4. package/dist/shared/components/CollectionBrowserView.js +2633 -2590
  5. package/dist/shared/components/DataTable.js +247 -236
  6. package/dist/shared/components/ItemEditForm.js +1693 -1668
  7. package/dist/shared/components/ProfileView.js +716 -715
  8. package/dist/shared/components/RecordReadView.js +367 -364
  9. package/dist/shared/components/ReportView.js +64 -39
  10. package/dist/shared/components/alerts/AlertManagerView.js +284 -271
  11. package/dist/shared/components/cbv/row-focus.js +19 -0
  12. package/dist/shared/components/help-videos/HelpVideoPlayer.js +152 -147
  13. package/dist/shared/components/integrations/console/SignalCard.js +59 -59
  14. package/dist/shared/components/integrations/console/tone.js +52 -30
  15. package/dist/shared/components/item-edit/CatalogPickerField.js +525 -505
  16. package/dist/shared/components/item-edit/FieldRow.js +175 -173
  17. package/dist/shared/components/item-edit/InlineTableField.js +407 -402
  18. package/dist/shared/components/item-edit/M2MCombobox.js +313 -291
  19. package/dist/shared/components/item-edit/MidairCollisionDialog.js +1 -1
  20. package/dist/shared/components/item-edit/PlanGrid.js +826 -803
  21. package/dist/shared/components/item-edit/QuickCreateButton.js +115 -79
  22. package/dist/shared/components/item-edit/RecordLiveSync.js +77 -75
  23. package/dist/shared/components/item-edit/RelationCombobox.js +412 -328
  24. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +147 -125
  25. package/dist/shared/components/item-edit/SummaryPanel.js +406 -392
  26. package/dist/shared/components/item-edit/option-disambiguate.js +44 -32
  27. package/dist/shared/components/item-edit/related-missing.js +45 -0
  28. package/dist/shared/components/item-edit/save-outcome.js +5 -5
  29. package/dist/shared/components/notifications/NotificationRulesEditor.js +130 -123
  30. package/dist/shared/components/panels/AccessDeniedPanel.js +52 -48
  31. package/dist/shared/components/panels/ItemLockBanner.js +2 -3
  32. package/dist/shared/components/panels/PipelinePanel.js +1027 -978
  33. package/dist/shared/components/panels/RevisionsPanel.js +4 -1
  34. package/dist/shared/components/panels/TaskPanel.js +265 -249
  35. package/dist/shared/components/panels/landing-state.js +27 -0
  36. package/dist/shared/components/pipeline/PipelineEditorView.js +86 -78
  37. package/dist/shared/components/profile/AiMemoryCard.js +12 -10
  38. package/dist/shared/components/queue/OwnerAvatars.js +80 -41
  39. package/dist/shared/components/queue/QueueQuickFilters.js +48 -48
  40. package/dist/shared/components/queue/QueueWorklist.js +357 -358
  41. package/dist/shared/components/queue/group-sums.js +27 -0
  42. package/dist/shared/components/widgets/ReviewListWidget.js +186 -168
  43. package/dist/shared/lib/back-closes.js +25 -0
  44. package/dist/shared/lib/form-usage-beacon.js +7 -7
  45. package/dist/shared/lib/list-page-memory.js +41 -0
  46. package/dist/shared/lib/live.js +44 -44
  47. package/dist/shared/lib/own-writes.js +76 -28
  48. package/dist/shared/lib/request-gate.js +110 -109
  49. package/dist/shared/lib/validation-rules.js +34 -19
  50. package/package.json +1 -1
@@ -1,8 +1,25 @@
1
- import { jsx as a, jsxs as l } from "react/jsx-runtime";
2
- import { UserAvatar as m } from "../UserAvatar.js";
3
- import { useState as x } from "react";
4
- import { cn as i } from "../../lib/utils.js";
5
- import { Popover as h, PopoverTrigger as u, PopoverContent as b } from "../ui/popover.js";
1
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as u } from "react";
3
+ import { cn as l } from "../../lib/utils.js";
4
+ import { UserAvatar as h } from "../UserAvatar.js";
5
+ import { Popover as b, PopoverTrigger as v, PopoverContent as k } from "../ui/popover.js";
6
+ const g = {
7
+ suspended: "suspended",
8
+ former: "former user"
9
+ };
10
+ function N(e) {
11
+ return e.inactive ? `${e.name} (${g[e.inactive]})` : e.name;
12
+ }
13
+ function f({ owner: e }) {
14
+ return e.inactive ? /* @__PURE__ */ a(
15
+ "span",
16
+ {
17
+ "data-owner-inactive": e.inactive,
18
+ className: "ml-1 shrink-0 rounded bg-slate-100 px-1 py-px text-[10px] font-medium text-slate-600 dark:bg-muted dark:text-slate-300",
19
+ children: g[e.inactive]
20
+ }
21
+ ) : null;
22
+ }
6
23
  const o = [
7
24
  { bg: "#e0f2fe", fg: "#075985" },
8
25
  // sky
@@ -29,88 +46,110 @@ const o = [
29
46
  { bg: "#f3e8ff", fg: "#6b21a8" }
30
47
  // purple
31
48
  ];
32
- function k(e) {
33
- let t = 0;
34
- for (let r = 0; r < e.length; r++) t = t * 31 + e.charCodeAt(r) | 0;
35
- return o[Math.abs(t) % o.length];
49
+ function y(e) {
50
+ let n = 0;
51
+ for (let r = 0; r < e.length; r++) n = n * 31 + e.charCodeAt(r) | 0;
52
+ return o[Math.abs(n) % o.length];
36
53
  }
37
- function v(e) {
38
- const t = e.trim().split(/\s+/);
39
- return t.length === 1 ? t[0].slice(0, 2).toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
54
+ function C(e) {
55
+ const n = e.trim().split(/\s+/);
56
+ return n.length === 1 ? n[0].slice(0, 2).toUpperCase() : (n[0][0] + n[n.length - 1][0]).toUpperCase();
40
57
  }
41
- function f({ owner: e, className: t }) {
42
- const r = k(e.id);
58
+ function d({ owner: e, className: n }) {
59
+ const r = y(e.id);
43
60
  return /* @__PURE__ */ a(
44
- m,
61
+ h,
45
62
  {
46
63
  userId: e.id,
47
64
  alt: e.name,
48
- className: i("h-[22px] w-[22px] ring-2 ring-white dark:ring-card", t),
65
+ className: l("h-[22px] w-[22px] ring-2 ring-white dark:ring-card", n),
49
66
  fallback: /* @__PURE__ */ a(
50
67
  "span",
51
68
  {
52
69
  title: e.name,
53
- className: i(
70
+ className: l(
54
71
  "inline-flex h-[22px] w-[22px] shrink-0 items-center justify-center rounded-full text-[9px] font-semibold ring-2 ring-white dark:ring-card",
55
- t
72
+ n
56
73
  ),
57
74
  style: { backgroundColor: r.bg, color: r.fg },
58
- children: v(e.name)
75
+ children: C(e.name)
59
76
  }
60
77
  )
61
78
  }
62
79
  );
63
80
  }
64
- function O({
81
+ function T({
65
82
  owners: e,
66
- max: t = 4,
83
+ max: n = 4,
67
84
  emptyLabel: r = "No owners"
68
85
  }) {
69
- const [g, p] = x(!1);
86
+ const [p, m] = u(!1);
70
87
  if (e.length === 0)
71
88
  return /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-300 dark:text-muted-foreground", children: r });
72
- const s = e.slice(0, t), c = e.length - s.length;
73
- return /* @__PURE__ */ l(h, { open: g, onOpenChange: p, children: [
74
- /* @__PURE__ */ a(u, { asChild: !0, children: /* @__PURE__ */ l(
89
+ const c = e.slice(0, n), s = e.length - c.length;
90
+ return /* @__PURE__ */ i(b, { open: p, onOpenChange: m, children: [
91
+ /* @__PURE__ */ a(v, { asChild: !0, children: /* @__PURE__ */ i(
75
92
  "button",
76
93
  {
77
94
  type: "button",
78
- onClick: (n) => n.stopPropagation(),
79
- "aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map((n) => n.name).join(", ")}`,
95
+ onClick: (t) => t.stopPropagation(),
96
+ "aria-label": `${e.length} owner${e.length === 1 ? "" : "s"}: ${e.map(N).join(", ")}`,
80
97
  className: "group/owners flex items-center rounded-full focus:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan",
81
98
  children: [
82
- /* @__PURE__ */ l("span", { className: "flex items-center transition-[gap]", children: [
83
- s.map((n, d) => /* @__PURE__ */ a(f, { owner: n, className: i(d > 0 && "-ml-1.5") }, n.id)),
84
- c > 0 && /* @__PURE__ */ l("span", { className: "-ml-1.5 inline-flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold text-slate-600 ring-2 ring-white dark:bg-muted dark:text-slate-300 dark:ring-card", children: [
99
+ /* @__PURE__ */ i("span", { className: "flex items-center transition-[gap]", children: [
100
+ c.map((t, x) => /* @__PURE__ */ a(
101
+ d,
102
+ {
103
+ owner: t,
104
+ className: l(x > 0 && "-ml-1.5", t.inactive && "opacity-50 grayscale")
105
+ },
106
+ t.id
107
+ )),
108
+ s > 0 && /* @__PURE__ */ i("span", { className: "-ml-1.5 inline-flex h-[22px] min-w-[22px] shrink-0 items-center justify-center rounded-full bg-slate-100 px-1 text-[9px] font-semibold text-slate-600 ring-2 ring-white dark:bg-muted dark:text-slate-300 dark:ring-card", children: [
85
109
  "+",
86
- c
110
+ s
87
111
  ] })
88
112
  ] }),
89
- e.length === 1 && /* @__PURE__ */ a("span", { className: "ml-1.5 truncate text-[12px] text-slate-600 group-hover/owners:text-slate-800 dark:text-slate-300", children: e[0].name })
113
+ e.length === 1 && /* @__PURE__ */ i("span", { className: "ml-1.5 flex min-w-0 items-center", children: [
114
+ /* @__PURE__ */ a(
115
+ "span",
116
+ {
117
+ className: l(
118
+ "truncate text-[12px] text-slate-600 group-hover/owners:text-slate-800 dark:text-slate-300",
119
+ e[0].inactive && "line-through decoration-slate-400"
120
+ ),
121
+ children: e[0].name
122
+ }
123
+ ),
124
+ /* @__PURE__ */ a(f, { owner: e[0] })
125
+ ] }),
126
+ e.length > 1 && e.some((t) => t.inactive) && /* @__PURE__ */ a("span", { className: "ml-1.5 text-[10px] text-slate-500 dark:text-slate-400", children: e.every((t) => t.inactive) ? "none can act" : `${e.filter((t) => t.inactive).length} can’t act` })
90
127
  ]
91
128
  }
92
129
  ) }),
93
- /* @__PURE__ */ l(
94
- b,
130
+ /* @__PURE__ */ i(
131
+ k,
95
132
  {
96
133
  className: "w-[240px] p-1.5",
97
134
  align: "start",
98
- onClick: (n) => n.stopPropagation(),
135
+ onClick: (t) => t.stopPropagation(),
99
136
  children: [
100
- /* @__PURE__ */ l("p", { className: "px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: [
137
+ /* @__PURE__ */ i("p", { className: "px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: [
101
138
  e.length,
102
139
  " owner",
103
140
  e.length === 1 ? "" : "s"
104
141
  ] }),
105
- /* @__PURE__ */ a("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((n) => /* @__PURE__ */ l("div", { className: "flex items-center gap-2 rounded px-2 py-1", children: [
106
- /* @__PURE__ */ a(f, { owner: n }),
107
- /* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: n.name })
108
- ] }, n.id)) })
142
+ /* @__PURE__ */ a("div", { className: "max-h-[260px] space-y-0.5 overflow-y-auto", children: e.map((t) => /* @__PURE__ */ i("div", { className: "flex items-center gap-2 rounded px-2 py-1", children: [
143
+ /* @__PURE__ */ a(d, { owner: t }),
144
+ /* @__PURE__ */ a("span", { className: "truncate text-[12px] text-slate-700 dark:text-slate-200", children: t.name }),
145
+ /* @__PURE__ */ a(f, { owner: t })
146
+ ] }, t.id)) })
109
147
  ]
110
148
  }
111
149
  )
112
150
  ] });
113
151
  }
114
152
  export {
115
- O as OwnerAvatars
153
+ T as OwnerAvatars,
154
+ N as ownerText
116
155
  };
@@ -1,36 +1,36 @@
1
- import { jsxs as f, jsx as i, Fragment as S } from "react/jsx-runtime";
2
- import { useQuery as N } from "@tanstack/react-query";
3
- import { useState as x, useEffect as O, useMemo as C } from "react";
1
+ import { jsxs as f, jsx as c, Fragment as S } from "react/jsx-runtime";
2
+ import { useQuery as v } from "@tanstack/react-query";
3
+ import { useState as x, useEffect as N, useMemo as w } from "react";
4
4
  import { MultiPick as q } from "../CollectionBrowserView.js";
5
- const d = (r) => Array.isArray(r) ? r : r ? [r] : [];
6
- function v({
5
+ const b = (r) => Array.isArray(r) ? r : r ? [r] : [];
6
+ function C({
7
7
  def: r,
8
8
  selected: n,
9
- onChange: h,
10
- badge: y,
9
+ onChange: g,
10
+ badge: u,
11
11
  narrowBy: p
12
12
  }) {
13
- const [c, g] = x(!1), [o, m] = x(""), u = r.loadOptions, e = JSON.stringify(p), { data: a = [], isLoading: l } = N({
13
+ const [i, d] = x(!1), [o, h] = x(""), y = r.loadOptions, e = JSON.stringify(p), { data: a = [], isLoading: l } = v({
14
14
  queryKey: ["queue-quick-facet", r.key, o, e],
15
- queryFn: () => u ? u(o, { narrowBy: p }) : Promise.resolve([]),
16
- enabled: !!u && (c || n.length > 0),
15
+ queryFn: () => y ? y(o, { narrowBy: p }) : Promise.resolve([]),
16
+ enabled: !!y && (i || n.length > 0),
17
17
  staleTime: 6e4
18
- }), k = C(() => {
18
+ }), m = w(() => {
19
19
  const s = new Set(a.map((t) => t.value));
20
20
  return [...a, ...n.filter((t) => !s.has(t)).map((t) => ({ label: t, value: t }))];
21
21
  }, [a, n]);
22
- return /* @__PURE__ */ i(
22
+ return /* @__PURE__ */ c(
23
23
  q,
24
24
  {
25
25
  label: r.placeholder,
26
- options: k,
26
+ options: m,
27
27
  selected: n,
28
- onChange: (s) => h(s.map(String)),
28
+ onChange: (s) => g(s.map(String)),
29
29
  loading: l,
30
- badge: y,
31
- onSearch: m,
30
+ badge: u,
31
+ onSearch: h,
32
32
  onOpenChange: (s) => {
33
- s && g(!0);
33
+ s && d(!0);
34
34
  }
35
35
  }
36
36
  );
@@ -38,69 +38,69 @@ function v({
38
38
  function Q({
39
39
  defs: r,
40
40
  values: n,
41
- seededKeys: h,
42
- onApply: y,
41
+ seededKeys: g,
42
+ onApply: u,
43
43
  onClear: p,
44
- right: c
44
+ right: i
45
45
  }) {
46
- const g = JSON.stringify(r.map((e) => [e.key, d(n[e.key])])), [o, m] = x({});
47
- O(() => {
46
+ const d = JSON.stringify(r.map((e) => [e.key, b(n[e.key])])), [o, h] = x({});
47
+ N(() => {
48
48
  const e = {};
49
- for (const a of r) e[a.key] = d(n[a.key]);
50
- m(e);
51
- }, [g]);
52
- const u = r.some(
53
- (e) => JSON.stringify(o[e.key] ?? []) !== JSON.stringify(d(n[e.key]))
49
+ for (const a of r) e[a.key] = b(n[a.key]);
50
+ h(e);
51
+ }, [d]);
52
+ const y = r.some(
53
+ (e) => JSON.stringify(o[e.key] ?? []) !== JSON.stringify(b(n[e.key]))
54
54
  );
55
- return r.length === 0 && !c ? null : /* @__PURE__ */ f(
55
+ return r.length === 0 && !i ? null : /* @__PURE__ */ f(
56
56
  "div",
57
57
  {
58
58
  className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-slate-100 bg-white px-4 py-1.5 dark:border-slate-800 dark:bg-slate-900",
59
59
  "data-queue-quick-filters": !0,
60
60
  children: [
61
61
  r.map((e) => {
62
- const a = o[e.key] ?? [], l = e.restricted ? {
63
- label: "restricted",
64
- cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
65
- title: `Options limited to your restricted ${e.placeholder} scope`
66
- } : h.has(e.key) && a.length > 0 ? {
62
+ const a = o[e.key] ?? [], l = g.has(e.key) && a.length > 0 ? {
67
63
  label: "your default",
68
64
  cls: "bg-nvr-cyan/[0.12] text-[#0284a8] dark:text-nvr-cyan",
69
- title: `Pre-selected from your default ${e.placeholder} scope — adjust freely`
70
- } : null, k = (t) => {
71
- m((b) => ({ ...b, [e.key]: t })), t.length === 0 && d(n[e.key]).length > 0 && y({ [e.key]: e.multi || e.type === "combobox" ? [] : "" });
65
+ title: `Pre-selected from your default ${e.placeholder} — change it freely.${e.restricted ? " The list shows only the ones you have access to." : ""}`
66
+ } : e.restricted ? {
67
+ label: "your access",
68
+ cls: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
69
+ title: `The ${e.placeholder} list shows only the ones you have access to.`
70
+ } : null, m = (t) => {
71
+ h((k) => ({ ...k, [e.key]: t })), t.length === 0 && b(n[e.key]).length > 0 && u({ [e.key]: e.multi || e.type === "combobox" ? [] : "" });
72
72
  }, s = r.filter((t) => {
73
- var b;
74
- return t.key !== e.key && t.cascade && (((b = o[t.key]) == null ? void 0 : b.length) ?? 0) > 0;
73
+ var k;
74
+ return t.key !== e.key && t.cascade && (((k = o[t.key]) == null ? void 0 : k.length) ?? 0) > 0;
75
75
  }).map((t) => ({
76
76
  collection: t.cascade.collection,
77
77
  field: t.cascade.field,
78
78
  values: o[t.key] ?? []
79
79
  }));
80
- return e.loadOptions ? /* @__PURE__ */ i(
81
- v,
80
+ return e.loadOptions ? /* @__PURE__ */ c(
81
+ C,
82
82
  {
83
83
  def: e,
84
84
  selected: a,
85
- onChange: k,
85
+ onChange: m,
86
86
  badge: l,
87
87
  narrowBy: s
88
88
  },
89
89
  e.key
90
- ) : /* @__PURE__ */ i(
90
+ ) : /* @__PURE__ */ c(
91
91
  q,
92
92
  {
93
93
  label: e.placeholder,
94
94
  options: e.options ?? [],
95
95
  selected: a,
96
- onChange: (t) => k(t.map(String)),
96
+ onChange: (t) => m(t.map(String)),
97
97
  badge: l
98
98
  },
99
99
  e.key
100
100
  );
101
101
  }),
102
102
  r.length > 0 && /* @__PURE__ */ f(S, { children: [
103
- /* @__PURE__ */ i(
103
+ /* @__PURE__ */ c(
104
104
  "button",
105
105
  {
106
106
  type: "button",
@@ -110,14 +110,14 @@ function Q({
110
110
  const l = o[a.key] ?? [];
111
111
  e[a.key] = a.multi || a.type === "combobox" ? l : l[0] ?? "";
112
112
  }
113
- y(e);
113
+ u(e);
114
114
  },
115
- className: `h-6 rounded px-2.5 text-[11px] font-semibold text-white transition-[filter] hover:brightness-110 ${u ? "bg-nvr-cyan" : "bg-nvr-cyan opacity-60"}`,
115
+ className: `h-6 rounded px-2.5 text-[11px] font-semibold text-white transition-[filter] hover:brightness-110 ${y ? "bg-nvr-cyan" : "bg-nvr-cyan opacity-60"}`,
116
116
  "data-queue-quick-apply": !0,
117
117
  children: "Apply"
118
118
  }
119
119
  ),
120
- /* @__PURE__ */ i(
120
+ /* @__PURE__ */ c(
121
121
  "button",
122
122
  {
123
123
  type: "button",
@@ -128,7 +128,7 @@ function Q({
128
128
  }
129
129
  )
130
130
  ] }),
131
- c && /* @__PURE__ */ i("div", { className: "ml-auto flex items-center gap-2", children: c })
131
+ i && /* @__PURE__ */ c("div", { className: "ml-auto flex items-center gap-2", children: i })
132
132
  ]
133
133
  }
134
134
  );