@nivaro/react 0.3.100 → 0.3.101
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/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/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,88 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Loader2 as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { useItemEditAuth as
|
|
5
|
-
import { describeError as
|
|
6
|
-
import {
|
|
7
|
-
import { partnerOutcome as
|
|
8
|
-
import { formatRelative as
|
|
9
|
-
import { ErrorDetails as
|
|
10
|
-
import { useOverflowTip as
|
|
11
|
-
import { Button as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
14
|
-
return e != null && e.running_move ?
|
|
1
|
+
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2 as L, AlertTriangle as U, ArrowUpRight as A } from "lucide-react";
|
|
3
|
+
import { createContext as B, useRef as _, useEffect as P, useMemo as x, useContext as W } from "react";
|
|
4
|
+
import { useItemEditAuth as E } from "../../context.js";
|
|
5
|
+
import { describeError as j } from "../../lib/error-message.js";
|
|
6
|
+
import { partnerSaid as z, withoutMoveLabel as D } from "../../lib/partner-failure.js";
|
|
7
|
+
import { partnerOutcome as xe, partnerWords as ke } from "../../lib/partner-failure.js";
|
|
8
|
+
import { formatRelative as g, cn as k, formatDateTime as T } from "../../lib/utils.js";
|
|
9
|
+
import { ErrorDetails as G } from "../ErrorNotice.js";
|
|
10
|
+
import { useOverflowTip as H } from "../TipLayer.js";
|
|
11
|
+
import { Button as C } from "../ui/button.js";
|
|
12
|
+
const V = 4e3;
|
|
13
|
+
function ie(e) {
|
|
14
|
+
return e != null && e.running_move ? V : !1;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const r =
|
|
18
|
-
|
|
19
|
-
r.current && !e &&
|
|
16
|
+
function oe(e, t) {
|
|
17
|
+
const r = _(!1), n = _(t);
|
|
18
|
+
n.current = t, P(() => {
|
|
19
|
+
r.current && !e && n.current(), r.current = e;
|
|
20
20
|
}, [e]);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function de(e, t) {
|
|
23
23
|
return (e ?? []).some((r) => r.id === t && r.background === !0) ? { accept_pending: !0 } : {};
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function le(e) {
|
|
26
26
|
const t = e == null ? void 0 : e.data;
|
|
27
27
|
return (t == null ? void 0 : t.background) === !0 && t.run ? t.run : null;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function $(e, t) {
|
|
30
30
|
return !!e && !!t && e.toUpperCase() === t.toUpperCase();
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return e.mode === "auto" ? "Started automatically" :
|
|
32
|
+
function M(e, t) {
|
|
33
|
+
return e.mode === "auto" ? "Started automatically" : $(e.started_by, t) ? "You started it" : e.started_by_name ? `Started by ${e.started_by_name}` : "Started";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
35
|
+
function Y(e) {
|
|
36
|
+
return D(e.reason, e.transition_label);
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const R = "flex items-start gap-2.5", I = "is running. Other moves wait until it finishes.", O = (e) => {
|
|
39
39
|
var t;
|
|
40
40
|
return ((t = e.transition_label) == null ? void 0 : t.trim()) || "A move";
|
|
41
41
|
};
|
|
42
|
-
function
|
|
43
|
-
return `${
|
|
42
|
+
function ce(e) {
|
|
43
|
+
return `${O(e)} ${I}`;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const q = {
|
|
46
46
|
refused: "did not go through. The record was not moved.",
|
|
47
47
|
interrupted: "stopped before it finished.",
|
|
48
48
|
failed: "ran into a problem."
|
|
49
49
|
};
|
|
50
|
-
function
|
|
50
|
+
function me({
|
|
51
51
|
run: e,
|
|
52
52
|
floating: t,
|
|
53
53
|
className: r,
|
|
54
|
-
style:
|
|
54
|
+
style: n
|
|
55
55
|
}) {
|
|
56
|
-
const { userId:
|
|
57
|
-
return /* @__PURE__ */
|
|
56
|
+
const { userId: o } = E(), m = O(e);
|
|
57
|
+
return /* @__PURE__ */ i(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
60
|
role: "status",
|
|
61
61
|
"data-running-move": e.transition_id ?? "",
|
|
62
|
-
className:
|
|
63
|
-
|
|
62
|
+
className: k(
|
|
63
|
+
R,
|
|
64
64
|
t ? "rounded-lg border border-sky-200 bg-sky-50 p-3 shadow-lg dark:border-sky-500/30 dark:bg-sky-950" : "border-t border-sky-200/80 bg-sky-50/70 px-4 py-2.5 dark:border-sky-500/20 dark:bg-sky-500/[0.06]",
|
|
65
65
|
r
|
|
66
66
|
),
|
|
67
|
-
style:
|
|
67
|
+
style: n,
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
69
|
+
/* @__PURE__ */ s(
|
|
70
|
+
L,
|
|
71
71
|
{
|
|
72
72
|
"aria-hidden": !0,
|
|
73
73
|
className: "mt-[3px] h-3.5 w-3.5 shrink-0 animate-spin text-sky-600 motion-reduce:animate-none dark:text-sky-400"
|
|
74
74
|
}
|
|
75
75
|
),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
77
|
+
/* @__PURE__ */ i("p", { className: "break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: [
|
|
78
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: m }),
|
|
79
79
|
" ",
|
|
80
|
-
|
|
80
|
+
I
|
|
81
81
|
] }),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
82
|
+
/* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-sky-800/80 dark:text-sky-300/80", children: [
|
|
83
|
+
M(e, o),
|
|
84
84
|
" · ",
|
|
85
|
-
|
|
85
|
+
g(e.started_at),
|
|
86
86
|
" · this page updates on its own"
|
|
87
87
|
] })
|
|
88
88
|
] })
|
|
@@ -90,59 +90,123 @@ function K({
|
|
|
90
90
|
}
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
const F = B(
|
|
94
|
+
null
|
|
95
|
+
);
|
|
96
|
+
function J(e, t) {
|
|
97
|
+
var o;
|
|
98
|
+
const r = ((o = e.api_name) == null ? void 0 : o.trim()) || "the other system", n = `The order may already be at ${r}.`;
|
|
99
|
+
return e.stale ? {
|
|
100
|
+
lead: n,
|
|
101
|
+
next: t ? `The send on ${T(e.started_at)} got no answer. Check first: look in ${r}, then mark that send received or not received.` : `The send on ${T(e.started_at)} got no answer. Check first: an administrator looks in ${r} and marks that send before it can go again.`
|
|
102
|
+
} : {
|
|
103
|
+
lead: n,
|
|
104
|
+
next: `The send started ${g(e.started_at)} and has not been answered yet. Wait for it to finish before you do anything else.`
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function ue(e, t) {
|
|
108
|
+
var o;
|
|
109
|
+
const r = e == null ? void 0 : e.unanswered;
|
|
110
|
+
if (!r || !$(e == null ? void 0 : e.transition_id, t)) return null;
|
|
111
|
+
const n = ((o = r.api_name) == null ? void 0 : o.trim()) || "the other system";
|
|
112
|
+
return r.stale ? `Waiting on a check: ${n} may already have this order. An administrator marks the last send received or not received first.` : `Still being sent to ${n}. Wait for it to finish.`;
|
|
113
|
+
}
|
|
114
|
+
function he({
|
|
94
115
|
problem: e,
|
|
95
116
|
onRetry: t,
|
|
96
117
|
retryDisabled: r,
|
|
97
|
-
className:
|
|
118
|
+
className: n
|
|
98
119
|
}) {
|
|
99
|
-
var
|
|
100
|
-
const { userId:
|
|
101
|
-
() =>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
var y, v, w;
|
|
121
|
+
const { userId: o } = E(), m = ((y = e.transition_label) == null ? void 0 : y.trim()) || "The move", d = Y(e), l = x(() => d ? j({ message: d }, "") : null, [d]), u = W(F), f = x(
|
|
122
|
+
() => {
|
|
123
|
+
var N;
|
|
124
|
+
return d && ((N = u == null ? void 0 : u(d)) == null ? void 0 : N.trim()) || null;
|
|
125
|
+
},
|
|
126
|
+
[d, u]
|
|
127
|
+
), p = x(
|
|
128
|
+
() => f ?? (d ? z(d) : null) ?? (l == null ? void 0 : l.title.trim()) ?? "",
|
|
129
|
+
[f, d, l]
|
|
130
|
+
), S = H(p), a = e.unanswered ?? null, c = ((v = a == null ? void 0 : a.review_url) == null ? void 0 : v.trim()) || null, h = a ? J(a, !!c) : null, b = !!c && typeof window < "u" && (() => {
|
|
131
|
+
try {
|
|
132
|
+
return new URL(c, window.location.href).origin !== window.location.origin;
|
|
133
|
+
} catch {
|
|
134
|
+
return !1;
|
|
135
|
+
}
|
|
136
|
+
})();
|
|
137
|
+
return /* @__PURE__ */ i(
|
|
105
138
|
"div",
|
|
106
139
|
{
|
|
107
140
|
role: "note",
|
|
108
141
|
"data-move-problem": e.result,
|
|
109
|
-
className:
|
|
110
|
-
|
|
142
|
+
className: k(
|
|
143
|
+
R,
|
|
111
144
|
"border-t border-amber-200/80 bg-amber-50/70 px-4 py-2.5 dark:border-amber-500/20 dark:bg-amber-500/[0.06]",
|
|
112
|
-
|
|
145
|
+
n
|
|
113
146
|
),
|
|
114
147
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
148
|
+
/* @__PURE__ */ s(
|
|
149
|
+
U,
|
|
117
150
|
{
|
|
118
151
|
"aria-hidden": !0,
|
|
119
152
|
className: "mt-[3px] h-3.5 w-3.5 shrink-0 text-amber-600 dark:text-amber-400"
|
|
120
153
|
}
|
|
121
154
|
),
|
|
122
|
-
/* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
|
|
156
|
+
/* @__PURE__ */ i("p", { className: "break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: [
|
|
157
|
+
/* @__PURE__ */ s("span", { className: "font-medium", children: m }),
|
|
125
158
|
" ",
|
|
126
|
-
|
|
159
|
+
a && !a.stale ? `is still being sent to ${((w = a.api_name) == null ? void 0 : w.trim()) || "the other system"}.` : q[e.result]
|
|
127
160
|
] }),
|
|
128
|
-
|
|
161
|
+
p && !(h && e.result === "interrupted") && /* @__PURE__ */ s(
|
|
129
162
|
"p",
|
|
130
163
|
{
|
|
131
|
-
ref:
|
|
164
|
+
ref: S,
|
|
132
165
|
"data-move-problem-reason": !0,
|
|
133
|
-
className:
|
|
134
|
-
|
|
166
|
+
className: k(
|
|
167
|
+
"mt-0.5 break-words text-[12px] leading-snug text-slate-700 dark:text-slate-300",
|
|
168
|
+
// A host's words are short and curated (one per line): shown whole. The other
|
|
169
|
+
// system's words can run long: three lines, the rest on hover.
|
|
170
|
+
f ? "whitespace-pre-line" : "line-clamp-3"
|
|
171
|
+
),
|
|
172
|
+
children: p
|
|
135
173
|
}
|
|
136
174
|
),
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
|
|
175
|
+
h && /* @__PURE__ */ i(
|
|
176
|
+
"p",
|
|
177
|
+
{
|
|
178
|
+
"data-move-problem-unanswered": !0,
|
|
179
|
+
className: "mt-1 break-words text-[12px] leading-snug text-slate-700 dark:text-slate-300",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ s("span", { className: "font-medium text-amber-900 dark:text-amber-200", children: h.lead }),
|
|
182
|
+
" ",
|
|
183
|
+
h.next
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ i("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
|
|
188
|
+
M(e, o),
|
|
139
189
|
" · ",
|
|
140
|
-
|
|
190
|
+
g(e.finished_at ?? e.started_at)
|
|
141
191
|
] }),
|
|
142
|
-
|
|
192
|
+
l && /* @__PURE__ */ s(G, { description: l, action: m, className: "mt-1" })
|
|
143
193
|
] }),
|
|
144
|
-
|
|
145
|
-
|
|
194
|
+
a ? (
|
|
195
|
+
// While the send may still answer there is nothing to mark yet.
|
|
196
|
+
c && a.stale && /* @__PURE__ */ s(C, { asChild: !0, size: "sm", variant: "outline", className: "h-7 shrink-0 gap-1 text-[12px]", children: /* @__PURE__ */ i(
|
|
197
|
+
"a",
|
|
198
|
+
{
|
|
199
|
+
href: c,
|
|
200
|
+
"data-move-problem-check": !0,
|
|
201
|
+
...b ? { target: "_blank", rel: "noreferrer" } : {},
|
|
202
|
+
children: [
|
|
203
|
+
"Check first",
|
|
204
|
+
b && /* @__PURE__ */ s(A, { "aria-hidden": !0, className: "h-3 w-3" })
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
) })
|
|
208
|
+
) : t && /* @__PURE__ */ s(
|
|
209
|
+
C,
|
|
146
210
|
{
|
|
147
211
|
type: "button",
|
|
148
212
|
size: "sm",
|
|
@@ -159,17 +223,20 @@ function Q({
|
|
|
159
223
|
);
|
|
160
224
|
}
|
|
161
225
|
export {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
he as MoveProblemNotice,
|
|
227
|
+
F as MoveProblemWordsContext,
|
|
228
|
+
V as RUNNING_MOVE_POLL_MS,
|
|
229
|
+
me as RunningMoveNotice,
|
|
230
|
+
xe as partnerOutcome,
|
|
231
|
+
ke as partnerWords,
|
|
232
|
+
de as pendingOptIn,
|
|
233
|
+
Y as problemReason,
|
|
234
|
+
ie as runningMovePoll,
|
|
235
|
+
ce as runningMoveTip,
|
|
236
|
+
$ as sameMoveId,
|
|
237
|
+
M as startedBy,
|
|
238
|
+
le as startedInBackground,
|
|
239
|
+
ue as unansweredHoldTip,
|
|
240
|
+
J as unansweredWords,
|
|
241
|
+
oe as useRunEnded
|
|
175
242
|
};
|