@nivaro/react 0.3.100 → 0.3.102
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 +46 -3
- package/dist/index.js +623 -620
- package/dist/shared/components/ActivityEntry.js +5 -5
- package/dist/shared/components/CollectionBrowserView.js +183 -175
- package/dist/shared/components/ItemEditForm.js +2708 -2704
- package/dist/shared/components/JobsTray.js +74 -63
- package/dist/shared/components/NotificationBell.js +80 -73
- package/dist/shared/components/TipLayer.js +56 -41
- package/dist/shared/components/cbv-file-label.js +46 -0
- package/dist/shared/components/integrations/console/SignalCard.js +40 -40
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
- package/dist/shared/components/integrations/console/drill/status.js +23 -18
- package/dist/shared/components/item-edit/RecordInsights.js +86 -86
- package/dist/shared/components/item-edit/header-path-preview.js +46 -34
- package/dist/shared/components/notifications/DeliveryChips.js +1 -2
- package/dist/shared/components/panels/BackgroundMove.js +152 -85
- package/dist/shared/components/panels/PipelinePanel.js +602 -594
- package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
- package/dist/shared/components/profile/DayTimeline.js +145 -140
- package/dist/shared/components/profile/PersonAccess.js +679 -383
- package/dist/shared/components/profile/PersonActivity.js +404 -427
- package/dist/shared/components/profile/PersonDidPanel.js +248 -134
- package/dist/shared/components/profile/PersonProfile.js +33 -32
- package/dist/shared/components/profile/journey-view.js +166 -0
- package/dist/shared/lib/activity-sentence.js +319 -236
- package/dist/shared/lib/jobs-tray.js +60 -41
- package/dist/shared/lib/move-failure.js +16 -6
- package/dist/shared/lib/obligation-banner.js +16 -16
- package/dist/shared/lib/partner-failure.js +44 -32
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useSyncExternalStore as
|
|
2
|
-
const
|
|
3
|
-
let s = [],
|
|
4
|
-
const
|
|
5
|
-
function
|
|
1
|
+
import { useSyncExternalStore as J } from "react";
|
|
2
|
+
const c = "nvr:jobs-tray:v1", d = "nvr:jobs-tray:dismissed:v1", D = 20, $ = 1440 * 60 * 1e3;
|
|
3
|
+
let s = [], r = /* @__PURE__ */ new Set(), m = !1, b = 0;
|
|
4
|
+
const y = /* @__PURE__ */ new Set();
|
|
5
|
+
function a(t, n) {
|
|
6
6
|
try {
|
|
7
7
|
const e = localStorage.getItem(t);
|
|
8
8
|
return e ? JSON.parse(e) : n;
|
|
@@ -10,32 +10,32 @@ function r(t, n) {
|
|
|
10
10
|
return n;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function g() {
|
|
14
14
|
try {
|
|
15
|
-
localStorage.setItem(
|
|
15
|
+
localStorage.setItem(c, JSON.stringify(s)), localStorage.setItem(d, JSON.stringify([...r].slice(-200)));
|
|
16
16
|
} catch {
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
for (const t of
|
|
19
|
+
function f() {
|
|
20
|
+
b++;
|
|
21
|
+
for (const t of y) t();
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const t = Date.now() -
|
|
25
|
-
s = s.filter((n) => n.status === "queued" || n.status === "running" || n.at >= t).sort((n, e) => e.at - n.at).slice(0,
|
|
23
|
+
function _() {
|
|
24
|
+
const t = Date.now() - $;
|
|
25
|
+
s = s.filter((n) => n.status === "queued" || n.status === "running" || n.at >= t).sort((n, e) => e.at - n.at).slice(0, D);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
t.key !==
|
|
27
|
+
function l() {
|
|
28
|
+
m || typeof window > "u" || (m = !0, s = a(c, []), r = new Set(a(d, [])), _(), window.addEventListener("storage", (t) => {
|
|
29
|
+
t.key !== c && t.key !== d || (s = a(c, []), r = new Set(a(d, [])), f());
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function j(t, n) {
|
|
33
|
+
return r.has(t) && (n === "completed" || n === "error" || n === "canceled");
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
if (
|
|
37
|
-
const e = s.find((
|
|
38
|
-
if (e && (e.status === "completed" || e.status === "error" || e.status === "canceled") && t.status === "running" || (t.status === "queued" &&
|
|
35
|
+
function E(t, n = Date.now()) {
|
|
36
|
+
if (l(), !(t != null && t.key) || !t.status) return;
|
|
37
|
+
const e = s.find((i) => i.key === t.key);
|
|
38
|
+
if (e && (e.status === "completed" || e.status === "error" || e.status === "canceled") && t.status === "running" || (t.status === "queued" && r.delete(t.key), j(t.key, t.status))) return;
|
|
39
39
|
s = [{
|
|
40
40
|
key: t.key,
|
|
41
41
|
kind: t.kind ?? (e == null ? void 0 : e.kind) ?? "job",
|
|
@@ -51,32 +51,51 @@ function b(t, n = Date.now()) {
|
|
|
51
51
|
position: t.position ?? null,
|
|
52
52
|
eta_seconds: t.eta_seconds ?? null,
|
|
53
53
|
at: n
|
|
54
|
-
}, ...s.filter((
|
|
54
|
+
}, ...s.filter((i) => i.key !== t.key)], _(), g(), f();
|
|
55
|
+
}
|
|
56
|
+
const k = (t) => `${t} job${t === 1 ? "" : "s"}`;
|
|
57
|
+
function O(t) {
|
|
58
|
+
let n = 0, e = 0, u = 0, i = 0;
|
|
59
|
+
for (const o of t)
|
|
60
|
+
o.status === "running" || o.status === "queued" ? n++ : o.status === "error" ? e++ : o.status === "canceled" ? i++ : u++;
|
|
61
|
+
if (n > 0)
|
|
62
|
+
return {
|
|
63
|
+
tone: "running",
|
|
64
|
+
text: `${k(n)} running`,
|
|
65
|
+
note: e > 0 ? `${e} failed` : null
|
|
66
|
+
};
|
|
67
|
+
const w = [
|
|
68
|
+
[e, "failed"],
|
|
69
|
+
[u, u && (e || i) ? "done" : "finished"],
|
|
70
|
+
[i, "cancelled"]
|
|
71
|
+
].filter(([o]) => o > 0).map(([o, S], h) => h === 0 ? `${k(o)} ${S}` : `${o} ${S}`).join(", ");
|
|
72
|
+
return { tone: e > 0 ? "failed" : u > 0 ? "done" : "cancelled", text: w, note: null };
|
|
55
73
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
for (const n of t)
|
|
74
|
+
function T(t) {
|
|
75
|
+
l();
|
|
76
|
+
for (const n of t) E(n, n.at ? new Date(n.at).getTime() : Date.now());
|
|
59
77
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
78
|
+
function N(t) {
|
|
79
|
+
l(), r.add(t), s = s.filter((n) => n.key !== t), g(), f();
|
|
62
80
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
81
|
+
function M() {
|
|
82
|
+
l();
|
|
65
83
|
for (const t of s)
|
|
66
|
-
t.status !== "queued" && t.status !== "running" &&
|
|
67
|
-
s = s.filter((t) => t.status === "queued" || t.status === "running"),
|
|
84
|
+
t.status !== "queued" && t.status !== "running" && r.add(t.key);
|
|
85
|
+
s = s.filter((t) => t.status === "queued" || t.status === "running"), g(), f();
|
|
68
86
|
}
|
|
69
|
-
function
|
|
70
|
-
return
|
|
71
|
-
(t) => (
|
|
72
|
-
() =>
|
|
87
|
+
function A() {
|
|
88
|
+
return l(), J(
|
|
89
|
+
(t) => (y.add(t), () => y.delete(t)),
|
|
90
|
+
() => b,
|
|
73
91
|
() => 0
|
|
74
92
|
), s;
|
|
75
93
|
}
|
|
76
94
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
E as applyJobUpdate,
|
|
96
|
+
M as dismissFinishedJobs,
|
|
97
|
+
N as dismissJob,
|
|
98
|
+
T as seedJobs,
|
|
99
|
+
O as trayHeadline,
|
|
100
|
+
A as useTrayJobs
|
|
82
101
|
};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { describeError as c } from "./error-message.js";
|
|
2
|
+
import { partnerCallText as p } from "./partner-failure.js";
|
|
3
|
+
import { serverErrorText as o } from "./safe-error.js";
|
|
4
|
+
function u(i, t) {
|
|
5
|
+
const r = o(i), n = r ? p(r) : null;
|
|
6
|
+
return n ? { title: `${(t == null ? void 0 : t.trim()) || "The move"} did not go through`, description: n } : null;
|
|
7
|
+
}
|
|
8
|
+
function h(i, t) {
|
|
9
|
+
const r = c(i), { hint: n, ...e } = r;
|
|
10
|
+
return {
|
|
11
|
+
...e,
|
|
12
|
+
title: `${t.title} — ${t.description}`,
|
|
13
|
+
technical: r.technical ?? o(i) ?? void 0
|
|
14
|
+
};
|
|
6
15
|
}
|
|
7
16
|
export {
|
|
8
|
-
|
|
17
|
+
u as partnerMoveFailure,
|
|
18
|
+
h as partnerMoveReading
|
|
9
19
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { toneForOutcome as
|
|
2
|
-
import { plainObligationReason as
|
|
3
|
-
import { partnerFailureText as
|
|
4
|
-
import { formatDate as
|
|
5
|
-
const
|
|
6
|
-
const t =
|
|
1
|
+
import { toneForOutcome as f } from "./obligation-filters.js";
|
|
2
|
+
import { plainObligationReason as p } from "./obligation-reason-text.js";
|
|
3
|
+
import { partnerFailureText as $ } from "./partner-failure.js";
|
|
4
|
+
import { formatDate as g, getDisplayTimezone as _ } from "./utils.js";
|
|
5
|
+
const h = (o) => {
|
|
6
|
+
const t = _();
|
|
7
7
|
return new Intl.DateTimeFormat("en-US", {
|
|
8
8
|
hour: "numeric",
|
|
9
9
|
minute: "2-digit",
|
|
10
10
|
...t ? { timeZone: t } : {}
|
|
11
11
|
}).format(new Date(o));
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function w(o, t) {
|
|
14
14
|
const r = t.getTime() - new Date(o).getTime(), e = Math.floor(r / 6e4);
|
|
15
15
|
if (e < 1) return "just now";
|
|
16
16
|
if (e < 60) return `${e}m ago`;
|
|
17
17
|
const n = Math.floor(e / 60);
|
|
18
18
|
if (n < 24) return `${n}h ago`;
|
|
19
19
|
const i = Math.floor(n / 24);
|
|
20
|
-
return i < 7 ? `${i}d ago` :
|
|
20
|
+
return i < 7 ? `${i}d ago` : g(o);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function b(o) {
|
|
23
23
|
return o.split(/[._-]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join(" ");
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function k(o, t = /* @__PURE__ */ new Date()) {
|
|
26
26
|
const r = /* @__PURE__ */ new Map();
|
|
27
27
|
for (const e of o) {
|
|
28
28
|
if (e.outcome === "superseded") continue;
|
|
@@ -30,17 +30,17 @@ function M(o, t = /* @__PURE__ */ new Date()) {
|
|
|
30
30
|
(!n || e.id > n.id) && r.set(e.api, e);
|
|
31
31
|
}
|
|
32
32
|
return [...r.values()].map((e) => {
|
|
33
|
-
var
|
|
34
|
-
const n = e.resolved_at ?? e.due_at, i = `${
|
|
33
|
+
var m;
|
|
34
|
+
const n = e.resolved_at ?? e.due_at, i = `${w(n, t)} (${h(n)})`, u = e.reason ? p(e.reason) : "", l = e.reason ? ` — ${u !== e.reason.trim() ? u : $(e.reason) ?? u}` : "", c = ((m = e.label) == null ? void 0 : m.trim()) || (e.trigger === "transition" ? b(e.kind) : ""), a = c ? ` · ${c}` : "";
|
|
35
35
|
let s;
|
|
36
36
|
if (e.outcome === "sent") s = `told ${i}${a}`;
|
|
37
37
|
else if (e.outcome === "pending") {
|
|
38
|
-
const
|
|
39
|
-
s = `sent ${i}${a}, awaiting acknowledgement (${
|
|
38
|
+
const d = Math.round((t.getTime() - new Date(e.due_at).getTime()) / 6e4);
|
|
39
|
+
s = `sent ${i}${a}, awaiting acknowledgement (${d} min)`;
|
|
40
40
|
} else e.outcome === "skipped" ? s = `should have been told ${i}${a}${l}` : e.outcome === "failed" ? s = `send failed ${i}${a}${l}` : e.outcome === "missing" ? s = `never told${a}${l}` : s = `still not told${a}${l}`;
|
|
41
41
|
return {
|
|
42
42
|
api: e.api,
|
|
43
|
-
tone:
|
|
43
|
+
tone: f(e.outcome),
|
|
44
44
|
text: s,
|
|
45
45
|
obligation_id: e.id,
|
|
46
46
|
outcome: e.outcome,
|
|
@@ -54,5 +54,5 @@ function M(o, t = /* @__PURE__ */ new Date()) {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
export {
|
|
57
|
-
|
|
57
|
+
k as bannerLines
|
|
58
58
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { isRawErrorText as
|
|
2
|
-
function
|
|
3
|
-
const r = (t ?? "").trim(),
|
|
4
|
-
return
|
|
1
|
+
import { isRawErrorText as u } from "./safe-error.js";
|
|
2
|
+
function $(t, e) {
|
|
3
|
+
const r = (t ?? "").trim(), n = (e ?? "").trim(), s = n && r.toLowerCase().startsWith(`${n.toLowerCase()}:`) ? r.slice(n.length + 1).trim() : r;
|
|
4
|
+
return s ? s.charAt(0).toUpperCase() + s.slice(1) : "";
|
|
5
5
|
}
|
|
6
|
-
const
|
|
6
|
+
const d = /\bHTTP \d{3}: /, h = [
|
|
7
7
|
"message",
|
|
8
8
|
"error_description",
|
|
9
9
|
"detail",
|
|
@@ -12,7 +12,7 @@ const m = /\bHTTP \d{3}: /, u = [
|
|
|
12
12
|
"reason",
|
|
13
13
|
"description",
|
|
14
14
|
"msg"
|
|
15
|
-
],
|
|
15
|
+
], m = new RegExp(`"(?:${h.join("|")})"\\s*:\\s*"((?:[^"\\\\]|\\\\.)*)`);
|
|
16
16
|
function a(t) {
|
|
17
17
|
try {
|
|
18
18
|
return JSON.parse(`"${t.replace(/\\$/, "")}"`);
|
|
@@ -20,52 +20,64 @@ function a(t) {
|
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function f(t, e = 0) {
|
|
24
24
|
if (typeof t == "string") return t;
|
|
25
25
|
if (!t || typeof t != "object" || Array.isArray(t) || e > 1) return null;
|
|
26
26
|
const r = t;
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
27
|
+
for (const n of h) {
|
|
28
|
+
const s = f(r[n], e + 1);
|
|
29
|
+
if (s != null && s.trim()) return s;
|
|
30
30
|
}
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const e =
|
|
33
|
+
function p(t) {
|
|
34
|
+
const e = d.exec(t);
|
|
35
35
|
if (!e) return null;
|
|
36
36
|
const r = t.slice(e.index + e[0].length).trim();
|
|
37
|
-
let
|
|
37
|
+
let n = null, s = !1;
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
n = f(JSON.parse(r));
|
|
40
40
|
} catch {
|
|
41
|
-
const i =
|
|
42
|
-
i ? (
|
|
41
|
+
const i = m.exec(r);
|
|
42
|
+
i ? (n = a(i[1]), s = r[i.index + i[0].length] !== '"') : r.startsWith('"') && (n = a(r.slice(1).replace(/"$/, "")), s = r.length < 2 || !r.endsWith('"'));
|
|
43
43
|
}
|
|
44
|
-
const o = (
|
|
45
|
-
if (o.length < 3 || /<[a-z!/]/i.test(o) ||
|
|
44
|
+
const o = (n ?? "").replace(/\s+/g, " ").trim(), c = s || o.length > 300 ? `${o.slice(0, 299).trimEnd()}…` : o;
|
|
45
|
+
if (o.length < 3 || /<[a-z!/]/i.test(o) || u(o)) return null;
|
|
46
46
|
const l = t.slice(0, e.index).replace(/[\s:·—–-]+$/, "").trim();
|
|
47
47
|
return l ? `${l}: ${c}` : c;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
function
|
|
49
|
+
const T = /\bHTTP (\d{3})\b/, g = /\b(?:fetch failed|Timed out after \d+ms|socket hang up|E(?:CONN[A-Z]+|NOTFOUND|AI_AGAIN|TIMEDOUT|HOSTUNREACH))\b/;
|
|
50
|
+
function A(t) {
|
|
51
51
|
var r;
|
|
52
|
-
const e = Number(((r =
|
|
52
|
+
const e = Number(((r = T.exec(t)) == null ? void 0 : r[1]) ?? 0);
|
|
53
53
|
return e ? e === 401 || e === 403 ? "The other system did not accept this app’s sign-in. An administrator needs to check the connection." : e === 408 || e === 504 ? "The other system took too long to answer." : e === 502 || e === 503 ? "The other system is not answering right now." : e >= 500 ? "The other system ran into a problem of its own." : "The other system refused the request." : g.test(t) ? /Timed out after|ETIMEDOUT/.test(t) ? "The other system took too long to answer." : "The other system could not be reached." : null;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return
|
|
55
|
+
function E(t) {
|
|
56
|
+
return p(t) ?? A(t);
|
|
57
|
+
}
|
|
58
|
+
const y = /^(submission failed)\s+[—–-]\s+([\s\S]+)$/i;
|
|
59
|
+
function N(t) {
|
|
60
|
+
const e = E(t);
|
|
61
|
+
if (e) return e;
|
|
62
|
+
const r = y.exec(t.trim());
|
|
63
|
+
if (!r) return null;
|
|
64
|
+
const n = r[2].replace(/\s+/g, " ").trim();
|
|
65
|
+
if (n.length < 3 || /<[a-z!/]/i.test(n) || u(n)) return null;
|
|
66
|
+
const s = n.length > 300 ? `${n.slice(0, 299).trimEnd()}…` : n, o = r[1];
|
|
67
|
+
return `${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()}: ${s}`;
|
|
57
68
|
}
|
|
58
|
-
const
|
|
59
|
-
function
|
|
60
|
-
const e =
|
|
69
|
+
const b = /(?:^|: )submission failed\s+[—–-]\s/i;
|
|
70
|
+
function S(t) {
|
|
71
|
+
const e = b.exec(t);
|
|
61
72
|
if (!e) return null;
|
|
62
73
|
const r = t.slice(e.index + (e[0].startsWith(": ") ? 2 : 0));
|
|
63
|
-
return
|
|
74
|
+
return N(r.charAt(0).toUpperCase() + r.slice(1));
|
|
64
75
|
}
|
|
65
76
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
S as partnerCallText,
|
|
78
|
+
E as partnerFailureText,
|
|
79
|
+
A as partnerOutcome,
|
|
80
|
+
N as partnerSaid,
|
|
81
|
+
p as partnerWords,
|
|
82
|
+
$ as withoutMoveLabel
|
|
71
83
|
};
|