@nivaro/react 0.3.65 → 0.3.67

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 (43) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +21 -5
  4. package/dist/shared/components/ActivityEntry.js +28 -28
  5. package/dist/shared/components/CollectionBrowserView.js +2432 -2592
  6. package/dist/shared/components/ItemEditForm.js +3912 -3773
  7. package/dist/shared/components/MyWorkView.js +124 -113
  8. package/dist/shared/components/ProfileView.js +483 -472
  9. package/dist/shared/components/RecordCompare.js +149 -129
  10. package/dist/shared/components/ReportView.js +1100 -1094
  11. package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
  12. package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
  13. package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
  14. package/dist/shared/components/integrations/console/EventsView.js +22 -24
  15. package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
  16. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
  17. package/dist/shared/components/integrations/console/tone.js +22 -21
  18. package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
  19. package/dist/shared/components/item-edit/FieldRow.js +193 -193
  20. package/dist/shared/components/item-edit/GroupSection.js +559 -542
  21. package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
  22. package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
  23. package/dist/shared/components/item-edit/RecordInsights.js +46 -45
  24. package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
  25. package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
  26. package/dist/shared/components/item-edit/UserChip.js +264 -229
  27. package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
  28. package/dist/shared/components/item-edit/header-path-preview.js +52 -0
  29. package/dist/shared/components/item-edit/line-merge.js +73 -47
  30. package/dist/shared/components/item-edit/picker-search.js +25 -21
  31. package/dist/shared/components/panels/BranchLanes.js +7 -7
  32. package/dist/shared/components/panels/CommentPanel.js +72 -72
  33. package/dist/shared/components/panels/PipelinePanel.js +261 -261
  34. package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
  35. package/dist/shared/components/panels/RevisionsPanel.js +220 -220
  36. package/dist/shared/components/panels/TaskPanel.js +75 -75
  37. package/dist/shared/components/queue/QueueWorklist.js +1007 -979
  38. package/dist/shared/lib/compare-value.js +73 -0
  39. package/dist/shared/lib/format-value.js +19 -18
  40. package/dist/shared/lib/obligation-reason-text.js +1 -1
  41. package/dist/shared/lib/quick-filter-cascade.js +29 -19
  42. package/dist/shared/lib/utils.js +59 -57
  43. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
- import { jsxs as d, jsx as s, Fragment as y } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as s, Fragment as w } from "react/jsx-runtime";
2
2
  import { useQuery as p } from "@tanstack/react-query";
3
- import { Info as w } from "lucide-react";
4
- import { useState as f, useRef as v, useEffect as N } from "react";
5
- import { useNivaroClient as h } from "../../context.js";
3
+ import { Info as v } from "lucide-react";
4
+ import { useState as f, useRef as N, useEffect as k } from "react";
5
+ import { useNivaroClient as m } from "../../context.js";
6
6
  import { get as u } from "../../lib/commands.js";
7
- function C(a, t, n) {
7
+ import { formatDateTime as y } from "../../lib/utils.js";
8
+ function B(a, t, n) {
8
9
  for (const r of [
9
10
  ["record-audience", t, n],
10
11
  ["erp-submissions", t, String(n)],
@@ -17,34 +18,34 @@ function C(a, t, n) {
17
18
  ])
18
19
  a.invalidateQueries({ queryKey: r });
19
20
  }
20
- function M(a, t, n) {
21
+ function P(a, t, n) {
21
22
  a.invalidateQueries({ queryKey: ["item", t, n] }), a.invalidateQueries({
22
23
  predicate: (r) => r.queryKey[0] === "o2m-rows" && String(r.queryKey[3]) === n
23
24
  }), a.invalidateQueries({ queryKey: ["child-summary", t, n] }), a.invalidateQueries({ queryKey: ["last-touch", t, n] }), a.invalidateQueries({ queryKey: ["sla-breach", t, n] }), a.invalidateQueries({
24
25
  predicate: (r) => (r.queryKey[0] === "item-actions" || r.queryKey[0] === "ext-item-actions") && r.queryKey[1] === t && String(r.queryKey[2]) === n
25
- }), _(a, t, n);
26
+ }), $(a, t, n);
26
27
  }
27
- const k = 4e3;
28
- function _(a, t, n) {
28
+ const _ = 4e3;
29
+ function $(a, t, n) {
29
30
  var e;
30
31
  const r = () => {
31
32
  a.invalidateQueries({ queryKey: ["comments", t, n] }), a.invalidateQueries({ queryKey: ["comments-related", t, n] });
32
33
  };
33
34
  r();
34
- const l = setTimeout(r, k);
35
+ const l = setTimeout(r, _);
35
36
  (e = l.unref) == null || e.call(l);
36
37
  }
37
- function B({
38
+ function U({
38
39
  collection: a,
39
40
  itemId: t,
40
41
  compact: n
41
42
  }) {
42
- const [r, l] = f(!1), [e, i] = f("audience"), c = v(null);
43
- return N(() => {
43
+ const [r, l] = f(!1), [e, i] = f("audience"), c = N(null);
44
+ return k(() => {
44
45
  if (!r) return;
45
46
  const o = (x) => {
46
- var m;
47
- (m = c.current) != null && m.contains(x.target) || l(!1);
47
+ var h;
48
+ (h = c.current) != null && h.contains(x.target) || l(!1);
48
49
  };
49
50
  return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
50
51
  }, [r]), /* @__PURE__ */ d("div", { ref: c, className: "relative", children: [
@@ -57,7 +58,7 @@ function B({
57
58
  title: "Record insights",
58
59
  "aria-label": "Record insights",
59
60
  className: n ? "inline-flex h-8 w-8 items-center justify-center transition-colors hover:bg-accent hover:text-accent-foreground" : "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",
60
- children: /* @__PURE__ */ s(w, { className: n ? "h-4 w-4" : "h-3.5 w-3.5" })
61
+ children: /* @__PURE__ */ s(v, { className: n ? "h-4 w-4" : "h-3.5 w-3.5" })
61
62
  }
62
63
  ),
63
64
  r && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-[60] mt-1 w-[480px] max-w-[92vw] rounded-lg border border-slate-200 bg-white p-3 shadow-xl dark:border-border dark:bg-card", children: [
@@ -77,23 +78,23 @@ function B({
77
78
  },
78
79
  o
79
80
  )) }),
80
- e === "audience" && /* @__PURE__ */ s($, { collection: a, itemId: t }),
81
- e === "integrations" && /* @__PURE__ */ s(q, { collection: a, itemId: t }),
82
- e === "owners" && /* @__PURE__ */ s(T, { collection: a, itemId: t }),
83
- e === "mail" && /* @__PURE__ */ s(D, { collection: a, itemId: t }),
84
- e === "chat" && /* @__PURE__ */ s(R, { collection: a, itemId: t })
81
+ e === "audience" && /* @__PURE__ */ s(L, { collection: a, itemId: t }),
82
+ e === "integrations" && /* @__PURE__ */ s(T, { collection: a, itemId: t }),
83
+ e === "owners" && /* @__PURE__ */ s(K, { collection: a, itemId: t }),
84
+ e === "mail" && /* @__PURE__ */ s(R, { collection: a, itemId: t }),
85
+ e === "chat" && /* @__PURE__ */ s(j, { collection: a, itemId: t })
85
86
  ] })
86
87
  ] });
87
88
  }
88
- const L = {
89
+ const q = {
89
90
  all: "all changes",
90
91
  create: "new records",
91
92
  update: "updates",
92
93
  delete: "deletions",
93
94
  workflow_transition: "state changes"
94
95
  };
95
- function $({ collection: a, itemId: t }) {
96
- const n = h(), { data: r, isLoading: l } = p({
96
+ function L({ collection: a, itemId: t }) {
97
+ const n = m(), { data: r, isLoading: l } = p({
97
98
  queryKey: ["record-audience", a, t],
98
99
  queryFn: () => n.request(u(`/audience/${a}/${t}`)).then((i) => i.data),
99
100
  staleTime: 3e4
@@ -133,7 +134,7 @@ function $({ collection: a, itemId: t }) {
133
134
  {
134
135
  className: "rounded-full bg-slate-100 px-1.5 py-px text-[10.5px] text-slate-600 dark:bg-muted dark:text-slate-300",
135
136
  children: [
136
- c.reason ?? `Subscribed to ${L[c.event_type] ?? c.event_type}`,
137
+ c.reason ?? `Subscribed to ${q[c.event_type] ?? c.event_type}`,
137
138
  " ·",
138
139
  " ",
139
140
  c.cadence
@@ -148,8 +149,8 @@ function $({ collection: a, itemId: t }) {
148
149
  ))
149
150
  ] });
150
151
  }
151
- function q({ collection: a, itemId: t }) {
152
- const n = h(), { data: r = [], isLoading: l } = p({
152
+ function T({ collection: a, itemId: t }) {
153
+ const n = m(), { data: r = [], isLoading: l } = p({
153
154
  queryKey: ["erp-submissions", a, String(t)],
154
155
  queryFn: () => n.request(
155
156
  u(`/erp-submissions/${a}/${encodeURIComponent(t)}`)
@@ -162,12 +163,12 @@ function q({ collection: a, itemId: t }) {
162
163
  }), { data: c = [] } = p({
163
164
  queryKey: ["record-external-ids", a, t],
164
165
  queryFn: () => n.request(u(`/items/${a}/${t}`)).then((o) => {
165
- const x = o.data ?? {}, m = /(external|nuvolo|mwf|oracle|sap|erp|legacy|fusion|mdsi).*(id|number|ref)|^(order_number|requisition_id|sales_order_id)$/i;
166
- return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" && m.test(b)).map(([b, g]) => ({ field: b, value: String(g).slice(0, 60) })).slice(0, 12);
166
+ const x = o.data ?? {}, h = /(external|nuvolo|mwf|oracle|sap|erp|legacy|fusion|mdsi).*(id|number|ref)|^(order_number|requisition_id|sales_order_id)$/i;
167
+ return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" && h.test(b)).map(([b, g]) => ({ field: b, value: String(g).slice(0, 60) })).slice(0, 12);
167
168
  }).catch(() => []),
168
169
  staleTime: 6e4
169
170
  });
170
- return i || l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length + ((e == null ? void 0 : e.webhooks.length) ?? 0) === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No integration activity for this record." }) : /* @__PURE__ */ d(y, { children: [
171
+ return i || l ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "Loading…" }) : r.length + ((e == null ? void 0 : e.webhooks.length) ?? 0) === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] text-slate-400", children: "No integration activity for this record." }) : /* @__PURE__ */ d(w, { children: [
171
172
  c.length > 0 && /* @__PURE__ */ d("div", { className: "border-b border-slate-100 px-3 py-2 dark:border-border/50", children: [
172
173
  /* @__PURE__ */ s("p", { className: "text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: "External identifiers" }),
173
174
  /* @__PURE__ */ s("div", { className: "mt-1 flex flex-wrap gap-1.5", children: c.map((o) => /* @__PURE__ */ d(
@@ -214,8 +215,8 @@ function q({ collection: a, itemId: t }) {
214
215
  ] })
215
216
  ] });
216
217
  }
217
- function T({ collection: a, itemId: t }) {
218
- const n = h(), { data: r = [], isLoading: l } = p({
218
+ function K({ collection: a, itemId: t }) {
219
+ const n = m(), { data: r = [], isLoading: l } = p({
219
220
  queryKey: ["record-owner-history", a, t],
220
221
  queryFn: () => n.request(u(`/owner-history/${a}/${t}`)).then((e) => e.data),
221
222
  staleTime: 3e4
@@ -250,12 +251,12 @@ const S = {
250
251
  cls: "bg-slate-500/10 text-slate-500 dark:text-slate-400"
251
252
  }
252
253
  };
253
- function K(a) {
254
+ function D(a) {
254
255
  const t = a.split(/[,;]/).map((r) => r.trim()).filter(Boolean);
255
256
  return t.slice(0, 2).map((r) => r.split("@")[0]).join(", ") + (t.length > 2 ? ` +${t.length - 2}` : "");
256
257
  }
257
- function D({ collection: a, itemId: t }) {
258
- const n = h(), { data: r = [], isLoading: l } = p({
258
+ function R({ collection: a, itemId: t }) {
259
+ const n = m(), { data: r = [], isLoading: l } = p({
259
260
  queryKey: ["record-mail-log", a, t],
260
261
  queryFn: () => n.request(u(`/mail-log/record/${a}/${t}`)).then((e) => e.data ?? []).catch(() => []),
261
262
  staleTime: 3e4
@@ -290,10 +291,10 @@ function D({ collection: a, itemId: t }) {
290
291
  /* @__PURE__ */ d("p", { className: "mt-0.5 text-[10.5px] text-slate-400", children: [
291
292
  /* @__PURE__ */ d("span", { "data-tip": e.to, children: [
292
293
  "to ",
293
- K(e.to)
294
+ D(e.to)
294
295
  ] }),
295
296
  " · ",
296
- /* @__PURE__ */ s("span", { "data-tip": new Date(e.created_at).toLocaleString(), children: new Date(e.created_at).toLocaleDateString(void 0, {
297
+ /* @__PURE__ */ s("span", { "data-tip": y(e.created_at), children: new Date(e.created_at).toLocaleDateString(void 0, {
297
298
  month: "short",
298
299
  day: "numeric"
299
300
  }) })
@@ -312,8 +313,8 @@ function D({ collection: a, itemId: t }) {
312
313
  );
313
314
  }) });
314
315
  }
315
- function R({ collection: a, itemId: t }) {
316
- const n = h(), { data: r = [], isLoading: l } = p({
316
+ function j({ collection: a, itemId: t }) {
317
+ const n = m(), { data: r = [], isLoading: l } = p({
317
318
  queryKey: ["record-chat-mentions", a, t],
318
319
  queryFn: () => n.request(u(`/chat/record-mentions/${a}/${t}`)).then((i) => i.data ?? []).catch(() => []),
319
320
  staleTime: 6e4
@@ -336,16 +337,16 @@ function R({ collection: a, itemId: t }) {
336
337
  ] })
337
338
  ] }),
338
339
  /* @__PURE__ */ s("p", { className: "truncate text-[11.5px] text-slate-500", children: i.message.slice(0, 160) }),
339
- /* @__PURE__ */ s("p", { className: "text-[10px] text-slate-400", children: new Date(i.date_created).toLocaleString() })
340
+ /* @__PURE__ */ s("p", { className: "text-[10px] text-slate-400", children: y(i.date_created) })
340
341
  ]
341
342
  },
342
343
  i.id
343
344
  )) });
344
345
  }
345
346
  export {
346
- k as NOTES_SETTLE_MS,
347
- B as RecordInsightsButton,
348
- M as invalidateRecordData,
349
- C as invalidateRecordInsights,
350
- _ as invalidateRecordNotes
347
+ _ as NOTES_SETTLE_MS,
348
+ U as RecordInsightsButton,
349
+ P as invalidateRecordData,
350
+ B as invalidateRecordInsights,
351
+ $ as invalidateRecordNotes
351
352
  };