@nivaro/react 0.3.66 → 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.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +499 -498
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsxs as d, jsx as s, Fragment as
|
|
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
|
|
4
|
-
import { useState as f, useRef as
|
|
5
|
-
import { useNivaroClient as
|
|
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
|
-
|
|
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
|
|
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
|
-
}),
|
|
26
|
+
}), $(a, t, n);
|
|
26
27
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
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,
|
|
35
|
+
const l = setTimeout(r, _);
|
|
35
36
|
(e = l.unref) == null || e.call(l);
|
|
36
37
|
}
|
|
37
|
-
function
|
|
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 =
|
|
43
|
-
return
|
|
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
|
|
47
|
-
(
|
|
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(
|
|
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(
|
|
81
|
-
e === "integrations" && /* @__PURE__ */ s(
|
|
82
|
-
e === "owners" && /* @__PURE__ */ s(
|
|
83
|
-
e === "mail" && /* @__PURE__ */ s(
|
|
84
|
-
e === "chat" && /* @__PURE__ */ s(
|
|
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
|
|
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
|
|
96
|
-
const n =
|
|
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 ${
|
|
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
|
|
152
|
-
const n =
|
|
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 ?? {},
|
|
166
|
-
return Object.entries(x).filter(([b, g]) => b !== "id" && g != null && g !== "" &&
|
|
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(
|
|
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
|
|
218
|
-
const n =
|
|
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
|
|
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
|
|
258
|
-
const n =
|
|
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
|
-
|
|
294
|
+
D(e.to)
|
|
294
295
|
] }),
|
|
295
296
|
" · ",
|
|
296
|
-
/* @__PURE__ */ s("span", { "data-tip":
|
|
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
|
|
316
|
-
const n =
|
|
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:
|
|
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
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
347
|
+
_ as NOTES_SETTLE_MS,
|
|
348
|
+
U as RecordInsightsButton,
|
|
349
|
+
P as invalidateRecordData,
|
|
350
|
+
B as invalidateRecordInsights,
|
|
351
|
+
$ as invalidateRecordNotes
|
|
351
352
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { GitBranch as N, Check as _, GitMerge as j } from "lucide-react";
|
|
3
3
|
import { serverNow as $ } from "../../lib/server-clock.js";
|
|
4
|
-
import { formatRelative as w,
|
|
5
|
-
import { OwnerAvatars as
|
|
4
|
+
import { formatRelative as w, formatDateTime as v, humanHours as C } from "../../lib/utils.js";
|
|
5
|
+
import { OwnerAvatars as T } from "../queue/OwnerAvatars.js";
|
|
6
6
|
function k(e, l) {
|
|
7
7
|
if (!e) return null;
|
|
8
8
|
const n = (l ? new Date(l).getTime() : $()) - new Date(e).getTime();
|
|
9
9
|
if (!Number.isFinite(n) || n < 0) return null;
|
|
10
10
|
const i = Math.floor(n / 6e4);
|
|
11
|
-
return i < 60 ? `${Math.max(1, i)}m` :
|
|
11
|
+
return i < 60 ? `${Math.max(1, i)}m` : C(n / 36e5);
|
|
12
12
|
}
|
|
13
13
|
function y({
|
|
14
14
|
color: e,
|
|
@@ -29,7 +29,7 @@ function y({
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function J({ data: e }) {
|
|
33
33
|
var i, d, m, p;
|
|
34
34
|
if (e.lanes.length === 0) return null;
|
|
35
35
|
const l = ((i = e.split_state) == null ? void 0 : i.color) ?? "#94a3b8", o = ((d = e.join_state) == null ? void 0 : d.color) ?? "#94a3b8", n = e.lanes.filter((t) => e.waiting_on.includes(t.instance_id));
|
|
@@ -91,7 +91,7 @@ function B({ data: e }) {
|
|
|
91
91
|
backgroundColor: !g || t.terminal ? s.state.color ?? "#94a3b8" : "transparent",
|
|
92
92
|
border: `1.5px solid ${s.state.color ?? "#94a3b8"}`
|
|
93
93
|
},
|
|
94
|
-
"data-tip": `${s.state.label} · entered ${
|
|
94
|
+
"data-tip": `${s.state.label} · entered ${v(s.entered_at)}${s.by ? ` by ${s.by}` : ""}`,
|
|
95
95
|
children: (!g || t.terminal) && /* @__PURE__ */ r(_, { className: "h-2.5 w-2.5 text-white", strokeWidth: 3 })
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -110,7 +110,7 @@ function B({ data: e }) {
|
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
112
|
c && /* @__PURE__ */ r("span", { className: "text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: t.terminal ? `done in ${c}` : `${c} in this state` }),
|
|
113
|
-
!t.terminal && /* @__PURE__ */ r("span", { className: "ml-auto", children: /* @__PURE__ */ r(
|
|
113
|
+
!t.terminal && /* @__PURE__ */ r("span", { className: "ml-auto", children: /* @__PURE__ */ r(T, { owners: t.owners ?? [], max: 3, emptyLabel: "No owners" }) })
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
t.instance_id
|
|
@@ -137,5 +137,5 @@ function B({ data: e }) {
|
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
export {
|
|
140
|
-
|
|
140
|
+
J as BranchLanes
|
|
141
141
|
};
|