@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.
Files changed (32) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +46 -3
  4. package/dist/index.js +623 -620
  5. package/dist/shared/components/ActivityEntry.js +5 -5
  6. package/dist/shared/components/CollectionBrowserView.js +183 -175
  7. package/dist/shared/components/ItemEditForm.js +2708 -2704
  8. package/dist/shared/components/JobsTray.js +74 -63
  9. package/dist/shared/components/NotificationBell.js +80 -73
  10. package/dist/shared/components/TipLayer.js +56 -41
  11. package/dist/shared/components/cbv-file-label.js +46 -0
  12. package/dist/shared/components/integrations/console/SignalCard.js +40 -40
  13. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +95 -73
  14. package/dist/shared/components/integrations/console/drill/status.js +23 -18
  15. package/dist/shared/components/item-edit/RecordInsights.js +86 -86
  16. package/dist/shared/components/item-edit/header-path-preview.js +46 -34
  17. package/dist/shared/components/notifications/DeliveryChips.js +1 -2
  18. package/dist/shared/components/panels/BackgroundMove.js +152 -85
  19. package/dist/shared/components/panels/PipelinePanel.js +602 -594
  20. package/dist/shared/components/profile/ActivityFeedCard.js +322 -0
  21. package/dist/shared/components/profile/DayTimeline.js +145 -140
  22. package/dist/shared/components/profile/PersonAccess.js +679 -383
  23. package/dist/shared/components/profile/PersonActivity.js +404 -427
  24. package/dist/shared/components/profile/PersonDidPanel.js +248 -134
  25. package/dist/shared/components/profile/PersonProfile.js +33 -32
  26. package/dist/shared/components/profile/journey-view.js +166 -0
  27. package/dist/shared/lib/activity-sentence.js +319 -236
  28. package/dist/shared/lib/jobs-tray.js +60 -41
  29. package/dist/shared/lib/move-failure.js +16 -6
  30. package/dist/shared/lib/obligation-banner.js +16 -16
  31. package/dist/shared/lib/partner-failure.js +44 -32
  32. package/package.json +1 -1
@@ -1,88 +1,88 @@
1
- import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { Loader2 as y, AlertTriangle as _ } from "lucide-react";
3
- import { useRef as u, useEffect as w, useMemo as p } from "react";
4
- import { useItemEditAuth as f } from "../../context.js";
5
- import { describeError as E } from "../../lib/error-message.js";
6
- import { partnerFailureText as M, withoutMoveLabel as T } from "../../lib/partner-failure.js";
7
- import { partnerOutcome as ee, partnerWords as te } from "../../lib/partner-failure.js";
8
- import { formatRelative as b, cn as x } from "../../lib/utils.js";
9
- import { ErrorDetails as I } from "../ErrorNotice.js";
10
- import { useOverflowTip as R } from "../TipLayer.js";
11
- import { Button as O } from "../ui/button.js";
12
- const L = 4e3;
13
- function W(e) {
14
- return e != null && e.running_move ? L : !1;
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 Y(e, t) {
17
- const r = u(!1), s = u(t);
18
- s.current = t, w(() => {
19
- r.current && !e && s.current(), 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 q(e, t) {
22
+ function de(e, t) {
23
23
  return (e ?? []).some((r) => r.id === t && r.background === !0) ? { accept_pending: !0 } : {};
24
24
  }
25
- function H(e) {
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 S(e, t) {
29
+ function $(e, t) {
30
30
  return !!e && !!t && e.toUpperCase() === t.toUpperCase();
31
31
  }
32
- function k(e, t) {
33
- return e.mode === "auto" ? "Started automatically" : S(e.started_by, t) ? "You started it" : e.started_by_name ? `Started by ${e.started_by_name}` : "Started";
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 B(e) {
36
- return T(e.reason, e.transition_label);
35
+ function Y(e) {
36
+ return D(e.reason, e.transition_label);
37
37
  }
38
- const h = "flex items-start gap-2.5", g = "is running. Other moves wait until it finishes.", N = (e) => {
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 J(e) {
43
- return `${N(e)} ${g}`;
42
+ function ce(e) {
43
+ return `${O(e)} ${I}`;
44
44
  }
45
- const C = {
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 K({
50
+ function me({
51
51
  run: e,
52
52
  floating: t,
53
53
  className: r,
54
- style: s
54
+ style: n
55
55
  }) {
56
- const { userId: m } = f(), d = N(e);
57
- return /* @__PURE__ */ n(
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: x(
63
- h,
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: s,
67
+ style: n,
68
68
  children: [
69
- /* @__PURE__ */ a(
70
- y,
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__ */ n("div", { className: "min-w-0 flex-1", children: [
77
- /* @__PURE__ */ n("p", { className: "break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: [
78
- /* @__PURE__ */ a("span", { className: "font-medium", children: d }),
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
- g
80
+ I
81
81
  ] }),
82
- /* @__PURE__ */ n("p", { className: "mt-0.5 text-[11.5px] text-sky-800/80 dark:text-sky-300/80", children: [
83
- k(e, m),
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
- b(e.started_at),
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
- function Q({
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: s
118
+ className: n
98
119
  }) {
99
- var c;
100
- const { userId: m } = f(), d = ((c = e.transition_label) == null ? void 0 : c.trim()) || "The move", o = B(e), i = p(() => o ? E({ message: o }, "") : null, [o]), l = p(
101
- () => (o ? M(o) : null) ?? (i == null ? void 0 : i.title.trim()) ?? "",
102
- [o, i]
103
- ), v = R(l);
104
- return /* @__PURE__ */ n(
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: x(
110
- h,
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
- s
145
+ n
113
146
  ),
114
147
  children: [
115
- /* @__PURE__ */ a(
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__ */ n("div", { className: "min-w-0 flex-1", children: [
123
- /* @__PURE__ */ n("p", { className: "break-words text-[13px] leading-snug text-slate-800 dark:text-slate-100", children: [
124
- /* @__PURE__ */ a("span", { className: "font-medium", children: d }),
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
- C[e.result]
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
- l && /* @__PURE__ */ a(
161
+ p && !(h && e.result === "interrupted") && /* @__PURE__ */ s(
129
162
  "p",
130
163
  {
131
- ref: v,
164
+ ref: S,
132
165
  "data-move-problem-reason": !0,
133
- className: "mt-0.5 line-clamp-3 break-words text-[12px] leading-snug text-slate-700 dark:text-slate-300",
134
- children: l
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__ */ n("p", { className: "mt-0.5 text-[11.5px] text-amber-800/80 dark:text-amber-300/80", children: [
138
- k(e, m),
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
- b(e.finished_at ?? e.started_at)
190
+ g(e.finished_at ?? e.started_at)
141
191
  ] }),
142
- i && /* @__PURE__ */ a(I, { description: i, action: d, className: "mt-1" })
192
+ l && /* @__PURE__ */ s(G, { description: l, action: m, className: "mt-1" })
143
193
  ] }),
144
- t && /* @__PURE__ */ a(
145
- O,
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
- Q as MoveProblemNotice,
163
- L as RUNNING_MOVE_POLL_MS,
164
- K as RunningMoveNotice,
165
- ee as partnerOutcome,
166
- te as partnerWords,
167
- q as pendingOptIn,
168
- B as problemReason,
169
- W as runningMovePoll,
170
- J as runningMoveTip,
171
- S as sameMoveId,
172
- k as startedBy,
173
- H as startedInBackground,
174
- Y as useRunEnded
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
  };