@nivaro/react 0.3.140 → 0.3.142
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/CollectionBrowserView.js +842 -830
- package/dist/shared/components/ItemEditForm.js +825 -819
- package/dist/shared/components/RowPresence.js +83 -76
- package/dist/shared/components/UnseenDot.js +183 -22
- package/dist/shared/components/delivery-analytics/drill.js +32 -32
- package/dist/shared/components/imports/CollectionImportPanel.js +839 -601
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/imports/match-fields.js +41 -0
- package/dist/shared/components/item-edit/InlineTableField.js +338 -338
- package/dist/shared/components/item-edit/RecordRecapChanges.js +116 -74
- package/dist/shared/components/item-edit/RecordRecapStrip.js +148 -160
- package/dist/shared/components/item-edit/summary-layout-request.js +15 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +226 -157
- package/dist/shared/components/layout-editor/settings/WhoSection.js +53 -52
- package/dist/shared/components/layout-editor/settings/controls.js +98 -90
- package/dist/shared/components/layout-editor/settings/settings-registry.js +8 -0
- package/dist/shared/components/queue/QueueWorklist.js +556 -545
- package/dist/shared/components/support/RequestList.js +2 -2
- package/dist/shared/lib/layout-resolve.js +64 -48
- package/package.json +1 -1
|
@@ -1,91 +1,98 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
2
|
-
import { useQueries as
|
|
3
|
-
import { useOptionalNivaroClient as
|
|
4
|
-
import { whoText as
|
|
5
|
-
import { userCardQuery as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as x, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useQueries as $ } from "@tanstack/react-query";
|
|
3
|
+
import { useOptionalNivaroClient as j } from "../context.js";
|
|
4
|
+
import { whoText as k } from "../lib/presence-signals.js";
|
|
5
|
+
import { userCardQuery as C } from "../lib/user-cards.js";
|
|
6
|
+
import { UserChip as _ } from "./item-edit/UserChip.js";
|
|
7
|
+
import { UserAvatar as N } from "./UserAvatar.js";
|
|
8
|
+
function Q({
|
|
9
|
+
viewers: n,
|
|
10
|
+
size: e = 16,
|
|
11
|
+
dataAttr: i = "data-row-presence",
|
|
12
|
+
max: s = 3
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
-
queries:
|
|
15
|
-
...
|
|
14
|
+
const o = j(), a = ((n == null ? void 0 : n.ids) ?? []).slice(0, s), p = $({
|
|
15
|
+
queries: a.map((t) => ({
|
|
16
|
+
...C(o, t),
|
|
16
17
|
staleTime: 5 * 6e4,
|
|
17
|
-
enabled: !!
|
|
18
|
+
enabled: !!o
|
|
18
19
|
}))
|
|
19
20
|
});
|
|
20
|
-
if (!
|
|
21
|
-
const h =
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
if (!n || n.count <= 0) return null;
|
|
22
|
+
const h = p.map((t) => t.data).filter((t) => !!t).map((t) => [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email), c = n.count - h.length, m = k(h), y = m ? `${m}${c > 0 ? ` and ${c} other${c === 1 ? "" : "s"}` : ""} ${n.count === 1 ? "has" : "have"} this open` : `${n.count} ${n.count === 1 ? "person has" : "people have"} this open`, d = n.count - a.length, f = "inline-flex items-center justify-center rounded-full bg-slate-200 font-semibold text-slate-700 ring-2 ring-white dark:bg-slate-700 dark:text-slate-200 dark:ring-card";
|
|
23
|
+
return (
|
|
24
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: an event fence; the face buttons inside are the controls
|
|
25
|
+
/* @__PURE__ */ x(
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
[i]: String(n.count),
|
|
29
|
+
"data-tip": y,
|
|
30
|
+
className: "inline-flex shrink-0 items-center transition-opacity duration-150",
|
|
31
|
+
style: { height: e },
|
|
32
|
+
onClick: (t) => t.stopPropagation(),
|
|
33
|
+
onKeyDown: (t) => t.stopPropagation(),
|
|
34
|
+
onDoubleClick: (t) => t.stopPropagation(),
|
|
35
|
+
children: [
|
|
36
|
+
a.map((t, u) => {
|
|
37
|
+
var b;
|
|
38
|
+
const r = (b = p[u]) == null ? void 0 : b.data, g = r ? [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email : null;
|
|
39
|
+
return /* @__PURE__ */ l(_, { userId: t, children: /* @__PURE__ */ l(
|
|
40
|
+
"button",
|
|
41
|
+
{
|
|
42
|
+
type: "button",
|
|
43
|
+
"aria-label": g ? `${g} — open their card` : "Open their card",
|
|
44
|
+
className: `${f} relative cursor-pointer hover:z-10 focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan`,
|
|
45
|
+
style: {
|
|
46
|
+
width: e,
|
|
47
|
+
height: e,
|
|
48
|
+
fontSize: Math.round(e * 0.42),
|
|
49
|
+
marginLeft: u === 0 ? 0 : -Math.round(e * 0.3),
|
|
50
|
+
zIndex: a.length - u
|
|
51
|
+
},
|
|
52
|
+
children: /* @__PURE__ */ l(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
userId: t,
|
|
56
|
+
fallback: /* @__PURE__ */ l("span", { "aria-hidden": !0, children: M(r) }),
|
|
57
|
+
className: "rounded-full object-cover",
|
|
58
|
+
style: { width: e, height: e },
|
|
59
|
+
alt: ""
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
) }, t);
|
|
64
|
+
}),
|
|
65
|
+
d > 0 && /* @__PURE__ */ x(
|
|
35
66
|
"span",
|
|
36
67
|
{
|
|
37
68
|
className: f,
|
|
38
69
|
style: {
|
|
39
|
-
|
|
40
|
-
height:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
70
|
+
minWidth: e,
|
|
71
|
+
height: e,
|
|
72
|
+
padding: "0 3px",
|
|
73
|
+
fontSize: Math.round(e * 0.42),
|
|
74
|
+
marginLeft: a.length ? -Math.round(e * 0.3) : 0
|
|
44
75
|
},
|
|
45
|
-
children:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
)
|
|
55
|
-
},
|
|
56
|
-
a
|
|
57
|
-
);
|
|
58
|
-
}),
|
|
59
|
-
p > 0 && /* @__PURE__ */ x(
|
|
60
|
-
"span",
|
|
61
|
-
{
|
|
62
|
-
className: f,
|
|
63
|
-
style: {
|
|
64
|
-
minWidth: n,
|
|
65
|
-
height: n,
|
|
66
|
-
padding: "0 3px",
|
|
67
|
-
fontSize: Math.round(n * 0.42),
|
|
68
|
-
marginLeft: o.length ? -Math.round(n * 0.3) : 0
|
|
69
|
-
},
|
|
70
|
-
children: [
|
|
71
|
-
"+",
|
|
72
|
-
p
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
)
|
|
76
|
-
]
|
|
77
|
-
}
|
|
76
|
+
children: [
|
|
77
|
+
"+",
|
|
78
|
+
d
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
)
|
|
78
85
|
);
|
|
79
86
|
}
|
|
80
|
-
function
|
|
81
|
-
var
|
|
82
|
-
if (!
|
|
83
|
-
const
|
|
84
|
-
return
|
|
85
|
-
var
|
|
86
|
-
return ((
|
|
87
|
+
function M(n) {
|
|
88
|
+
var i;
|
|
89
|
+
if (!n) return "·";
|
|
90
|
+
const e = [n.first_name, n.last_name].filter(Boolean);
|
|
91
|
+
return e.length === 0 ? (((i = n.email) == null ? void 0 : i[0]) ?? "·").toUpperCase() : e.slice(0, 2).map((s) => {
|
|
92
|
+
var o;
|
|
93
|
+
return ((o = s[0]) == null ? void 0 : o.toUpperCase()) ?? "";
|
|
87
94
|
}).join("");
|
|
88
95
|
}
|
|
89
96
|
export {
|
|
90
|
-
|
|
97
|
+
Q as RowPresence
|
|
91
98
|
};
|
|
@@ -1,37 +1,198 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { jsx as t, jsxs as d, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as P } from "@tanstack/react-query";
|
|
3
|
+
import { ArrowUpRight as R } from "lucide-react";
|
|
4
|
+
import { useState as y, useRef as j } from "react";
|
|
5
|
+
import { useNivaroClient as D } from "../context.js";
|
|
6
|
+
import { post as K } from "../lib/commands.js";
|
|
7
|
+
import { cn as m, formatRelative as O } from "../lib/utils.js";
|
|
8
|
+
import { RecapChangesPanel as M } from "./item-edit/RecordRecapChanges.js";
|
|
9
|
+
import { Button as T } from "./ui/button.js";
|
|
10
|
+
import { Popover as U, PopoverTrigger as q, PopoverContent as _ } from "./ui/popover.js";
|
|
11
|
+
const A = {
|
|
4
12
|
edit: "edited",
|
|
5
13
|
transition: "moved",
|
|
6
14
|
comment: "commented on"
|
|
7
15
|
};
|
|
8
|
-
function
|
|
9
|
-
return
|
|
16
|
+
function E(e) {
|
|
17
|
+
return e.length <= 1 ? e[0] ?? "changed" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
10
18
|
}
|
|
11
|
-
function
|
|
12
|
-
const
|
|
13
|
-
return `${
|
|
19
|
+
function f(e) {
|
|
20
|
+
const n = E(e.kinds.map((o) => A[o] ?? o));
|
|
21
|
+
return `${e.by ?? "Someone"} ${n} this since you last opened it`;
|
|
14
22
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
function F(e) {
|
|
24
|
+
const n = Number.isNaN(new Date(e.changed_at).getTime()) ? "" : ` · ${O(e.changed_at)}`;
|
|
25
|
+
return `${f(e)}${n}`;
|
|
26
|
+
}
|
|
27
|
+
function Q(e) {
|
|
28
|
+
const n = [];
|
|
29
|
+
return e.includes("transition") && n.push("moved through its pipeline"), e.includes("comment") && n.push("new comments"), n.length ? n.join(" · ") : null;
|
|
30
|
+
}
|
|
31
|
+
function S(e) {
|
|
32
|
+
if (!e.includes("edit"))
|
|
33
|
+
return "No field changed — open the record to see the move or the comments.";
|
|
34
|
+
}
|
|
35
|
+
const k = "h-[7px] w-[7px] rounded-full bg-nvr-cyan ring-[3px] ring-nvr-cyan/15 transition-[box-shadow] duration-150 motion-reduce:transition-none";
|
|
36
|
+
function Z({
|
|
37
|
+
change: e,
|
|
38
|
+
dataAttr: n = "data-unseen",
|
|
39
|
+
hang: o = !1,
|
|
40
|
+
collection: a,
|
|
41
|
+
itemId: l,
|
|
42
|
+
onOpen: s,
|
|
43
|
+
onSeen: u
|
|
19
44
|
}) {
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
45
|
+
if (!e) return o ? null : /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "inline-block h-4 w-4 shrink-0" });
|
|
46
|
+
const r = F(e);
|
|
47
|
+
return !a || !l || !e.since ? /* @__PURE__ */ t(
|
|
23
48
|
"span",
|
|
24
49
|
{
|
|
25
|
-
[
|
|
26
|
-
"data-tip":
|
|
50
|
+
[n]: "",
|
|
51
|
+
"data-tip": r,
|
|
27
52
|
role: "img",
|
|
28
|
-
"aria-label":
|
|
29
|
-
className:
|
|
30
|
-
|
|
53
|
+
"aria-label": r,
|
|
54
|
+
className: m(
|
|
55
|
+
"inline-flex h-4 w-4 shrink-0 cursor-default items-center justify-center",
|
|
56
|
+
o && "-ml-[22px]"
|
|
57
|
+
),
|
|
58
|
+
children: /* @__PURE__ */ t("span", { className: k })
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ t(
|
|
61
|
+
W,
|
|
62
|
+
{
|
|
63
|
+
change: e,
|
|
64
|
+
since: e.since,
|
|
65
|
+
sentence: r,
|
|
66
|
+
dataAttr: n,
|
|
67
|
+
hang: o,
|
|
68
|
+
collection: a,
|
|
69
|
+
itemId: l,
|
|
70
|
+
onOpen: s,
|
|
71
|
+
onSeen: u
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
function W({
|
|
76
|
+
change: e,
|
|
77
|
+
since: n,
|
|
78
|
+
sentence: o,
|
|
79
|
+
dataAttr: a,
|
|
80
|
+
hang: l,
|
|
81
|
+
collection: s,
|
|
82
|
+
itemId: u,
|
|
83
|
+
onOpen: r,
|
|
84
|
+
onSeen: c
|
|
85
|
+
}) {
|
|
86
|
+
const N = D(), w = P(), [h, p] = y(!1), [v, g] = y(!1), x = j(null), C = async () => {
|
|
87
|
+
g(!0);
|
|
88
|
+
try {
|
|
89
|
+
await N.request(
|
|
90
|
+
K(`/record-views/${s}/${encodeURIComponent(u)}/dismiss`, {})
|
|
91
|
+
), p(!1), w.invalidateQueries({
|
|
92
|
+
predicate: (i) => i.queryKey[0] === "cbv-unseen" && i.queryKey[1] === s
|
|
93
|
+
}), c == null || c();
|
|
94
|
+
} catch {
|
|
95
|
+
} finally {
|
|
96
|
+
g(!1);
|
|
31
97
|
}
|
|
98
|
+
};
|
|
99
|
+
return (
|
|
100
|
+
// The row opens on click and on Enter: nothing in here (portaled content included — React
|
|
101
|
+
// events bubble through portals) may reach it.
|
|
102
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: an event fence; the button inside is the control
|
|
103
|
+
/* @__PURE__ */ t(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
className: m("inline-flex shrink-0", l && "-ml-[22px]"),
|
|
107
|
+
onClick: (i) => i.stopPropagation(),
|
|
108
|
+
onKeyDown: (i) => i.stopPropagation(),
|
|
109
|
+
onDoubleClick: (i) => i.stopPropagation(),
|
|
110
|
+
children: /* @__PURE__ */ d(U, { open: h, onOpenChange: p, children: [
|
|
111
|
+
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t(
|
|
112
|
+
"button",
|
|
113
|
+
{
|
|
114
|
+
type: "button",
|
|
115
|
+
[a]: "",
|
|
116
|
+
"aria-label": `${o}. Show what changed`,
|
|
117
|
+
className: "group/unseen inline-flex h-4 w-4 cursor-pointer items-center justify-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60",
|
|
118
|
+
children: /* @__PURE__ */ t(
|
|
119
|
+
"span",
|
|
120
|
+
{
|
|
121
|
+
className: m(
|
|
122
|
+
k,
|
|
123
|
+
"group-hover/unseen:ring-nvr-cyan/30 group-data-[state=open]/unseen:ring-nvr-cyan/40"
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
) }),
|
|
129
|
+
/* @__PURE__ */ t(
|
|
130
|
+
_,
|
|
131
|
+
{
|
|
132
|
+
align: "start",
|
|
133
|
+
side: "bottom",
|
|
134
|
+
sideOffset: 6,
|
|
135
|
+
collisionPadding: 16,
|
|
136
|
+
"aria-label": f(e),
|
|
137
|
+
onOpenAutoFocus: (i) => {
|
|
138
|
+
var b;
|
|
139
|
+
i.preventDefault(), (b = x.current) == null || b.focus();
|
|
140
|
+
},
|
|
141
|
+
className: "w-[min(420px,calc(100vw-32px))] p-0 motion-reduce:animate-none",
|
|
142
|
+
"data-unseen-popover": !0,
|
|
143
|
+
children: h && /* @__PURE__ */ t(
|
|
144
|
+
M,
|
|
145
|
+
{
|
|
146
|
+
bodyRef: x,
|
|
147
|
+
collection: s,
|
|
148
|
+
itemId: u,
|
|
149
|
+
since: n,
|
|
150
|
+
title: f(e),
|
|
151
|
+
sinceLabel: "You last opened it",
|
|
152
|
+
extras: Q(e.kinds),
|
|
153
|
+
emptyText: S(e.kinds),
|
|
154
|
+
footer: /* @__PURE__ */ d($, { children: [
|
|
155
|
+
/* @__PURE__ */ t(
|
|
156
|
+
"button",
|
|
157
|
+
{
|
|
158
|
+
type: "button",
|
|
159
|
+
disabled: v,
|
|
160
|
+
onClick: () => void C(),
|
|
161
|
+
className: "rounded text-[12px] font-medium text-slate-600 underline-offset-2 hover:text-slate-900 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 disabled:opacity-60 dark:text-slate-300 dark:hover:text-slate-100",
|
|
162
|
+
"data-unseen-mark-seen": !0,
|
|
163
|
+
children: v ? "Marking…" : "Mark as seen"
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
r ? /* @__PURE__ */ d(
|
|
167
|
+
T,
|
|
168
|
+
{
|
|
169
|
+
type: "button",
|
|
170
|
+
size: "sm",
|
|
171
|
+
variant: "outline",
|
|
172
|
+
className: "h-7 gap-1 px-2.5 text-[12px]",
|
|
173
|
+
onClick: () => {
|
|
174
|
+
p(!1), r();
|
|
175
|
+
},
|
|
176
|
+
"data-unseen-open": !0,
|
|
177
|
+
children: [
|
|
178
|
+
"Open record",
|
|
179
|
+
/* @__PURE__ */ t(R, { "aria-hidden": !0, className: "h-3.5 w-3.5" })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
) : /* @__PURE__ */ t("span", {})
|
|
183
|
+
] })
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
] })
|
|
189
|
+
}
|
|
190
|
+
)
|
|
32
191
|
);
|
|
33
192
|
}
|
|
34
193
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
194
|
+
Z as UnseenDot,
|
|
195
|
+
Q as unseenExtras,
|
|
196
|
+
f as unseenHeadline,
|
|
197
|
+
F as unseenSentence
|
|
37
198
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as S } from "react/jsx-runtime";
|
|
2
2
|
import { useInfiniteQuery as ce, useQuery as P } from "@tanstack/react-query";
|
|
3
|
-
import { X as me, Download as he, ExternalLink as M, Mail as ue, ListFilter as pe, ChevronRight as G, ArrowLeft as
|
|
4
|
-
import { useState as V, useMemo as
|
|
3
|
+
import { X as me, Download as he, ExternalLink as M, Mail as ue, ListFilter as pe, ChevronRight as G, ArrowLeft as xe } from "lucide-react";
|
|
4
|
+
import { useState as V, useMemo as be } from "react";
|
|
5
5
|
import { useNivaroClient as A, useApiFetchConfig as fe, useNavigation as ge, useItemNavigation as Ne } from "../../context.js";
|
|
6
6
|
import { get as F } from "../../lib/commands.js";
|
|
7
|
-
import { cn as
|
|
7
|
+
import { cn as b } from "../../lib/utils.js";
|
|
8
8
|
import { ErrorDetails as Z } from "../ErrorNotice.js";
|
|
9
9
|
import { QueryErrorState as K } from "../QueryErrorState.js";
|
|
10
10
|
import { Sheet as we, SheetContent as ve, SheetTitle as j, SheetDescription as ee } from "../ui/sheet.js";
|
|
@@ -105,12 +105,12 @@ function De({
|
|
|
105
105
|
labels: s
|
|
106
106
|
}) {
|
|
107
107
|
var Y, H, X;
|
|
108
|
-
const n = A(), d = fe(), t = (Y = Ee().data) == null ? void 0 : Y[a.source], y = { ...o.window, asof: o.asof, acted_hours: o.acted_hours }, f = $e(m, a, y),
|
|
109
|
-
queryKey: ["delivery-analytics", "rows", R,
|
|
108
|
+
const n = A(), d = fe(), t = (Y = Ee().data) == null ? void 0 : Y[a.source], y = { ...o.window, asof: o.asof, acted_hours: o.acted_hours }, f = $e(m, a, y), x = a.sort, R = f.toString(), p = ce({
|
|
109
|
+
queryKey: ["delivery-analytics", "rows", R, x],
|
|
110
110
|
initialPageParam: "0",
|
|
111
111
|
queryFn: ({ pageParam: l }) => {
|
|
112
112
|
const i = new URLSearchParams(f);
|
|
113
|
-
return i.set("cursor", String(l)), i.set("limit", "50"),
|
|
113
|
+
return i.set("cursor", String(l)), i.set("limit", "50"), x === "ttr" && i.set("sort", "ttr"), x === "time-asc" && i.set("dir", "asc"), n.request(F(`/delivery-analytics/rows?${i.toString()}`)).then((g) => g.data);
|
|
114
114
|
},
|
|
115
115
|
getNextPageParam: (l) => l.next_cursor ?? void 0,
|
|
116
116
|
staleTime: 6e4
|
|
@@ -122,7 +122,7 @@ function De({
|
|
|
122
122
|
return l.set("by", String(a.splitBy)), n.request(F(`/delivery-analytics/split?${l.toString()}`)).then((i) => i.data);
|
|
123
123
|
},
|
|
124
124
|
staleTime: 6e4
|
|
125
|
-
}), [h, L] = V(!1), [z, Q] = V(!1), q = (X = (H = p.data) == null ? void 0 : H.pages[0]) == null ? void 0 : X.total, B =
|
|
125
|
+
}), [h, L] = V(!1), [z, Q] = V(!1), q = (X = (H = p.data) == null ? void 0 : H.pages[0]) == null ? void 0 : X.total, B = be(() => {
|
|
126
126
|
var l;
|
|
127
127
|
return ((l = p.data) == null ? void 0 : l.pages.flatMap((i) => i.rows)) ?? [];
|
|
128
128
|
}, [p.data]), O = Le[a.source], oe = a.prev ? `previous period, ${J(o.window.prev_from, o.window.prev_to)}` : a.source === "x" ? "standing mutes" : J(o.window.from, o.window.to), se = (l) => c((i) => {
|
|
@@ -143,7 +143,7 @@ function De({
|
|
|
143
143
|
L(!0), Q(!1);
|
|
144
144
|
try {
|
|
145
145
|
const l = new URLSearchParams(f);
|
|
146
|
-
l.set("format", "csv"),
|
|
146
|
+
l.set("format", "csv"), x === "ttr" && l.set("sort", "ttr"), x === "time-asc" && l.set("dir", "asc");
|
|
147
147
|
const i = await fetch(`${d.apiBase}/delivery-analytics/rows?${l}`, {
|
|
148
148
|
headers: d.authHeaders,
|
|
149
149
|
credentials: d.credentials
|
|
@@ -220,11 +220,11 @@ function De({
|
|
|
220
220
|
"button",
|
|
221
221
|
{
|
|
222
222
|
type: "button",
|
|
223
|
-
"aria-pressed":
|
|
223
|
+
"aria-pressed": x === l,
|
|
224
224
|
onClick: () => ie(l),
|
|
225
|
-
className:
|
|
225
|
+
className: b(
|
|
226
226
|
"rounded px-2 py-0.5 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
|
|
227
|
-
|
|
227
|
+
x === l ? "bg-[#0f172a] text-white dark:bg-nvr-cyan dark:text-[#172940]" : "text-slate-600 hover:bg-slate-100 dark:text-muted-foreground dark:hover:bg-muted"
|
|
228
228
|
),
|
|
229
229
|
children: i
|
|
230
230
|
},
|
|
@@ -379,14 +379,14 @@ function Ie({
|
|
|
379
379
|
return /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ r("table", { className: "w-full text-[12.5px]", children: [
|
|
380
380
|
/* @__PURE__ */ e("thead", { className: "border-b border-slate-200 bg-slate-50 dark:border-border dark:bg-muted/40", children: a === "n" ? /* @__PURE__ */ r("tr", { children: [
|
|
381
381
|
/* @__PURE__ */ e("th", { className: N, children: "Sent" }),
|
|
382
|
-
/* @__PURE__ */ e("th", { className:
|
|
382
|
+
/* @__PURE__ */ e("th", { className: b(N, "max-sm:hidden"), children: "To" }),
|
|
383
383
|
/* @__PURE__ */ e("th", { className: N, children: "Subject" }),
|
|
384
|
-
/* @__PURE__ */ e("th", { className:
|
|
385
|
-
/* @__PURE__ */ e("th", { className:
|
|
384
|
+
/* @__PURE__ */ e("th", { className: b(N, "max-md:hidden"), children: "Channels" }),
|
|
385
|
+
/* @__PURE__ */ e("th", { className: b(N, "text-right"), children: "Read" }),
|
|
386
386
|
/* @__PURE__ */ e("th", { className: "w-6" })
|
|
387
387
|
] }) : a === "m" ? /* @__PURE__ */ r("tr", { children: [
|
|
388
388
|
/* @__PURE__ */ e("th", { className: N, children: "When" }),
|
|
389
|
-
/* @__PURE__ */ e("th", { className:
|
|
389
|
+
/* @__PURE__ */ e("th", { className: b(N, "max-sm:hidden"), children: "To" }),
|
|
390
390
|
/* @__PURE__ */ e("th", { className: N, children: "Subject" }),
|
|
391
391
|
/* @__PURE__ */ e("th", { className: N, children: "Outcome" }),
|
|
392
392
|
/* @__PURE__ */ e("th", { className: "w-6" })
|
|
@@ -400,15 +400,15 @@ function Ie({
|
|
|
400
400
|
/* @__PURE__ */ e(
|
|
401
401
|
"td",
|
|
402
402
|
{
|
|
403
|
-
className:
|
|
403
|
+
className: b(
|
|
404
404
|
w,
|
|
405
405
|
"whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
|
|
406
406
|
),
|
|
407
407
|
children: k(n.timestamp)
|
|
408
408
|
}
|
|
409
409
|
),
|
|
410
|
-
/* @__PURE__ */ e("td", { className:
|
|
411
|
-
/* @__PURE__ */ r("td", { className:
|
|
410
|
+
/* @__PURE__ */ e("td", { className: b(w, "hidden max-w-[150px] truncate sm:table-cell"), children: n.recipient_name ?? "–" }),
|
|
411
|
+
/* @__PURE__ */ r("td", { className: b(w, "min-w-[160px]"), children: [
|
|
412
412
|
/* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: n.subject ?? "(no subject)" }),
|
|
413
413
|
/* @__PURE__ */ r("span", { className: "text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
414
414
|
/* @__PURE__ */ r("span", { className: "sm:hidden", children: [
|
|
@@ -420,12 +420,12 @@ function Ie({
|
|
|
420
420
|
n.reason_label
|
|
421
421
|
] })
|
|
422
422
|
] }),
|
|
423
|
-
/* @__PURE__ */ e("td", { className:
|
|
423
|
+
/* @__PURE__ */ e("td", { className: b(w, "max-md:hidden"), children: /* @__PURE__ */ e("span", { className: "flex flex-wrap gap-1", children: n.channels.length === 0 ? /* @__PURE__ */ e("span", { className: "text-[11px] text-slate-400", children: "not recorded" }) : n.channels.map((d) => /* @__PURE__ */ e(E, { outcome: d.outcome, children: /* @__PURE__ */ r("span", { "data-tip": d.label, children: [
|
|
424
424
|
d.channel === "inapp" ? "in-app" : d.channel === "sms" ? "SMS" : d.channel,
|
|
425
425
|
" ",
|
|
426
426
|
d.status.replace(/_/g, " ")
|
|
427
427
|
] }) }, d.channel)) }) }),
|
|
428
|
-
/* @__PURE__ */ e("td", { className:
|
|
428
|
+
/* @__PURE__ */ e("td", { className: b(w, "whitespace-nowrap text-right tabular-nums"), children: n.status === "inbox" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-[#d4936a]", children: "Unread" }) : n.ttr_min != null ? te(n.ttr_min) : /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-muted-foreground", children: "Read" }) }),
|
|
429
429
|
/* @__PURE__ */ e("td", { className: "w-6 pr-2 pt-2.5 align-top", children: /* @__PURE__ */ e(
|
|
430
430
|
G,
|
|
431
431
|
{
|
|
@@ -438,15 +438,15 @@ function Ie({
|
|
|
438
438
|
/* @__PURE__ */ e(
|
|
439
439
|
"td",
|
|
440
440
|
{
|
|
441
|
-
className:
|
|
441
|
+
className: b(
|
|
442
442
|
w,
|
|
443
443
|
"whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
|
|
444
444
|
),
|
|
445
445
|
children: k(n.created_at)
|
|
446
446
|
}
|
|
447
447
|
),
|
|
448
|
-
/* @__PURE__ */ e("td", { className:
|
|
449
|
-
/* @__PURE__ */ r("td", { className:
|
|
448
|
+
/* @__PURE__ */ e("td", { className: b(w, "hidden max-w-[180px] truncate sm:table-cell"), children: n.to ?? "–" }),
|
|
449
|
+
/* @__PURE__ */ r("td", { className: b(w, "min-w-[160px]"), children: [
|
|
450
450
|
/* @__PURE__ */ e("span", { className: "line-clamp-2 [overflow-wrap:anywhere]", children: n.subject ?? "(no subject)" }),
|
|
451
451
|
/* @__PURE__ */ r("span", { className: "block text-[11px] text-slate-500 dark:text-muted-foreground", children: [
|
|
452
452
|
/* @__PURE__ */ r("span", { className: "sm:hidden", children: [
|
|
@@ -473,7 +473,7 @@ function Ie({
|
|
|
473
473
|
/* @__PURE__ */ e(
|
|
474
474
|
"td",
|
|
475
475
|
{
|
|
476
|
-
className:
|
|
476
|
+
className: b(
|
|
477
477
|
w,
|
|
478
478
|
"whitespace-nowrap tabular-nums text-slate-500 dark:text-muted-foreground"
|
|
479
479
|
),
|
|
@@ -518,7 +518,7 @@ function ae({
|
|
|
518
518
|
onClick: c,
|
|
519
519
|
className: "mb-1.5 inline-flex items-center gap-1 rounded px-1 py-0.5 text-[11.5px] font-medium text-sky-700 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
|
|
520
520
|
children: [
|
|
521
|
-
/* @__PURE__ */ e(
|
|
521
|
+
/* @__PURE__ */ e(xe, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
522
522
|
o
|
|
523
523
|
]
|
|
524
524
|
}
|
|
@@ -596,7 +596,7 @@ function Oe({
|
|
|
596
596
|
}
|
|
597
597
|
)
|
|
598
598
|
] });
|
|
599
|
-
const t = u.data, y = d.record(t.collection, t.item), f = d.person((p = t.recipient) == null ? void 0 : p.id),
|
|
599
|
+
const t = u.data, y = d.record(t.collection, t.item), f = d.person((p = t.recipient) == null ? void 0 : p.id), x = d.person((I = t.sender) == null ? void 0 : I.id), R = t.read_at && t.timestamp ? (new Date(t.read_at).getTime() - new Date(t.timestamp).getTime()) / 6e4 : null;
|
|
600
600
|
return /* @__PURE__ */ r(S, { children: [
|
|
601
601
|
/* @__PURE__ */ e(
|
|
602
602
|
ae,
|
|
@@ -629,7 +629,7 @@ function Oe({
|
|
|
629
629
|
},
|
|
630
630
|
{
|
|
631
631
|
k: "From",
|
|
632
|
-
v: t.sender ? /* @__PURE__ */ e(_, { href:
|
|
632
|
+
v: t.sender ? /* @__PURE__ */ e(_, { href: x, onClick: x ? d.go(x) : void 0, children: t.sender.name }) : "The system"
|
|
633
633
|
},
|
|
634
634
|
{ k: "Category", v: v(t.category ?? "none") },
|
|
635
635
|
{ k: "Lane", v: v(t.lane ?? "fyi") },
|
|
@@ -753,7 +753,7 @@ function Ue({
|
|
|
753
753
|
queryKey: ["delivery-analytics", "leaf", "m", a, n],
|
|
754
754
|
queryFn: () => o.request(
|
|
755
755
|
F(`/delivery-analytics/mail/${a}`, n ? { reveal: 1 } : void 0)
|
|
756
|
-
).then((
|
|
756
|
+
).then((x) => x.data),
|
|
757
757
|
staleTime: Number.POSITIVE_INFINITY,
|
|
758
758
|
gcTime: 0,
|
|
759
759
|
refetchOnWindowFocus: !1,
|
|
@@ -806,12 +806,12 @@ function Ue({
|
|
|
806
806
|
k: "To",
|
|
807
807
|
v: /* @__PURE__ */ r(S, { children: [
|
|
808
808
|
t.to ?? "–",
|
|
809
|
-
t.recipients.length > 0 && /* @__PURE__ */ e("span", { className: "block text-[12px]", children: t.recipients.map((
|
|
810
|
-
const p = s.person(
|
|
809
|
+
t.recipients.length > 0 && /* @__PURE__ */ e("span", { className: "block text-[12px]", children: t.recipients.map((x, R) => {
|
|
810
|
+
const p = s.person(x.id);
|
|
811
811
|
return /* @__PURE__ */ r("span", { children: [
|
|
812
812
|
R > 0 && ", ",
|
|
813
|
-
/* @__PURE__ */ e(_, { href: p, onClick: p ? s.go(p) : void 0, children:
|
|
814
|
-
] },
|
|
813
|
+
/* @__PURE__ */ e(_, { href: p, onClick: p ? s.go(p) : void 0, children: x.name })
|
|
814
|
+
] }, x.id);
|
|
815
815
|
}) })
|
|
816
816
|
] })
|
|
817
817
|
},
|