@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,188 +1,302 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Download as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNivaroClient as
|
|
6
|
-
import { get as
|
|
7
|
-
import { formatNumber as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as N, useMutation as O } from "@tanstack/react-query";
|
|
3
|
+
import { Download as R, ListChecks as $, ChevronRight as q } from "lucide-react";
|
|
4
|
+
import { useState as k } from "react";
|
|
5
|
+
import { useNivaroClient as w, useItemNavigation as F } from "../../context.js";
|
|
6
|
+
import { get as L, post as U } from "../../lib/commands.js";
|
|
7
|
+
import { formatNumber as C, formatDate as P, cn as W, titleCase as D } from "../../lib/utils.js";
|
|
8
|
+
import { ErrorNotice as S } from "../ErrorNotice.js";
|
|
9
|
+
import { QueryErrorState as j } from "../QueryErrorState.js";
|
|
10
|
+
import { SimpleSelect as K } from "../ui/SimpleSelect.js";
|
|
11
|
+
import { SectionCard as I, EmptyLine as _ } from "./primitives.js";
|
|
12
|
+
const T = "__none__", g = [
|
|
11
13
|
{ value: "7", label: "Last 7 days" },
|
|
12
14
|
{ value: "30", label: "Last 30 days" },
|
|
13
15
|
{ value: "90", label: "Last 90 days" }
|
|
14
16
|
];
|
|
15
|
-
function
|
|
17
|
+
function Z() {
|
|
16
18
|
try {
|
|
17
19
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
18
20
|
} catch {
|
|
19
21
|
return "UTC";
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
24
|
+
function Q(e) {
|
|
25
|
+
return e ? D(e.replace(/^(nivaro|directus)_/, "").replace(/_/g, " ")) : "Sign-ins and other";
|
|
24
26
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
+
function B(e) {
|
|
28
|
+
var a;
|
|
29
|
+
return (a = e.parts) != null && a.length ? e.parts : Object.entries(e.actions).sort((r, s) => s[1] - r[1]).map(([r, s]) => ({ verb: D(r.replace(/[-_]/g, " ")), count: s }));
|
|
27
30
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
function f(e, a) {
|
|
32
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
33
|
+
hour: "numeric",
|
|
34
|
+
minute: "2-digit",
|
|
35
|
+
timeZone: a
|
|
36
|
+
}).format(new Date(e));
|
|
37
|
+
}
|
|
38
|
+
function oe({ userId: e, name: a }) {
|
|
39
|
+
var p;
|
|
40
|
+
const r = w(), [s, c] = k("30"), m = Z(), { data: o, isLoading: u, isError: b, error: d, refetch: h } = N({
|
|
41
|
+
queryKey: ["nvr-person-did", e, s, m],
|
|
42
|
+
queryFn: () => r.request(L(`/activity/people/${e}/summary`, { days: s, tz: m })).then((i) => i.data),
|
|
32
43
|
staleTime: 6e4
|
|
33
|
-
}),
|
|
34
|
-
mutationFn: () =>
|
|
35
|
-
|
|
36
|
-
).then((
|
|
37
|
-
onSuccess: ({ csv:
|
|
38
|
-
const
|
|
39
|
-
|
|
44
|
+
}), l = O({
|
|
45
|
+
mutationFn: () => r.request(
|
|
46
|
+
U(`/activity/people/${e}/export`, { days: Number(s), tz: m })
|
|
47
|
+
).then((i) => i.data),
|
|
48
|
+
onSuccess: ({ csv: i, filename: E }) => {
|
|
49
|
+
const y = URL.createObjectURL(new Blob([i], { type: "text/csv;charset=utf-8" })), v = document.createElement("a");
|
|
50
|
+
v.href = y, v.download = E, v.click(), setTimeout(() => URL.revokeObjectURL(y), 1e3);
|
|
40
51
|
}
|
|
41
|
-
});
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
|
|
52
|
+
}), x = ((p = g.find((i) => i.value === s)) == null ? void 0 : p.label.toLowerCase()) ?? "this window";
|
|
53
|
+
return /* @__PURE__ */ n(
|
|
54
|
+
I,
|
|
44
55
|
{
|
|
45
|
-
icon: /* @__PURE__ */
|
|
46
|
-
title:
|
|
47
|
-
hint: "
|
|
56
|
+
icon: /* @__PURE__ */ t($, { className: "h-4 w-4" }),
|
|
57
|
+
title: a ? `What ${a} did` : "What they did",
|
|
58
|
+
hint: "What they opened and changed, day by day",
|
|
48
59
|
testId: "what-they-did",
|
|
49
|
-
actions: /* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
|
|
60
|
+
actions: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
61
|
+
/* @__PURE__ */ t(
|
|
62
|
+
K,
|
|
52
63
|
{
|
|
53
|
-
value:
|
|
54
|
-
onChange:
|
|
55
|
-
options:
|
|
64
|
+
value: s,
|
|
65
|
+
onChange: c,
|
|
66
|
+
options: g,
|
|
56
67
|
className: "h-7 w-[130px] text-[12px]",
|
|
57
|
-
ariaLabel: "
|
|
68
|
+
ariaLabel: "Period"
|
|
58
69
|
}
|
|
59
70
|
),
|
|
60
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ n(
|
|
61
72
|
"button",
|
|
62
73
|
{
|
|
63
74
|
type: "button",
|
|
64
|
-
onClick: () =>
|
|
65
|
-
disabled:
|
|
66
|
-
|
|
75
|
+
onClick: () => l.mutate(),
|
|
76
|
+
disabled: l.isPending || !(o != null && o.total),
|
|
77
|
+
"data-tip": "Download every entry in this period as a spreadsheet",
|
|
78
|
+
className: "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 px-2 text-[12px] text-slate-700 hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 disabled:opacity-50 dark:border-border dark:text-slate-200",
|
|
67
79
|
"data-person-did-export": !0,
|
|
68
80
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
|
|
81
|
+
/* @__PURE__ */ t(R, { className: "h-3.5 w-3.5" }),
|
|
82
|
+
l.isPending ? "Exporting…" : "CSV"
|
|
71
83
|
]
|
|
72
84
|
}
|
|
73
85
|
)
|
|
74
86
|
] }),
|
|
75
|
-
children:
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
children: [
|
|
88
|
+
l.isError && /* @__PURE__ */ t(
|
|
89
|
+
S,
|
|
90
|
+
{
|
|
91
|
+
variant: "banner",
|
|
92
|
+
error: l.error,
|
|
93
|
+
fallback: "Could not export",
|
|
94
|
+
onRetry: () => l.mutate(),
|
|
95
|
+
actionLabel: "Export activity",
|
|
96
|
+
className: "mb-3"
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
u ? /* @__PURE__ */ t("div", { className: "space-y-4", "aria-busy": "true", "data-person-did-loading": !0, children: [0, 1].map((i) => /* @__PURE__ */ n("div", { className: "space-y-1.5", children: [
|
|
100
|
+
/* @__PURE__ */ t("div", { className: "h-3.5 w-28 animate-pulse rounded bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
101
|
+
/* @__PURE__ */ t("div", { className: "h-10 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
102
|
+
/* @__PURE__ */ t("div", { className: "h-10 animate-pulse rounded-md bg-slate-100 dark:bg-[hsl(var(--nvr-skeleton))]" })
|
|
103
|
+
] }, i)) }) : b || !o ? /* @__PURE__ */ t(j, { error: d, what: "this activity", onRetry: () => void h() }) : o.days.length === 0 ? /* @__PURE__ */ n(_, { children: [
|
|
104
|
+
"Nothing recorded in the ",
|
|
105
|
+
x,
|
|
106
|
+
"."
|
|
107
|
+
] }) : /* @__PURE__ */ n("div", { className: "space-y-5", "data-person-did": !0, children: [
|
|
108
|
+
/* @__PURE__ */ n("p", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: [
|
|
109
|
+
C(o.total),
|
|
110
|
+
o.truncated ? "+" : "",
|
|
111
|
+
" recorded action",
|
|
112
|
+
o.total === 1 ? "" : "s",
|
|
113
|
+
" over",
|
|
114
|
+
" ",
|
|
115
|
+
o.days.length,
|
|
116
|
+
" day",
|
|
117
|
+
o.days.length === 1 ? "" : "s",
|
|
118
|
+
o.truncated ? " — the newest are shown; export for the rest." : ""
|
|
119
|
+
] }),
|
|
120
|
+
o.days.map((i) => /* @__PURE__ */ t(M, { userId: e, group: i, tz: o.tz }, i.day))
|
|
121
|
+
] })
|
|
122
|
+
]
|
|
87
123
|
}
|
|
88
124
|
);
|
|
89
125
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
126
|
+
function M({ userId: e, group: a, tz: r }) {
|
|
127
|
+
return /* @__PURE__ */ n("section", { "data-person-did-day": a.day, children: [
|
|
128
|
+
/* @__PURE__ */ t("h4", { className: "mb-1.5 text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: P(a.day, {
|
|
129
|
+
weekday: "long",
|
|
130
|
+
month: "long",
|
|
131
|
+
day: "numeric",
|
|
132
|
+
year: a.day.startsWith(String((/* @__PURE__ */ new Date()).getFullYear())) ? void 0 : "numeric"
|
|
133
|
+
}) }),
|
|
134
|
+
/* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 overflow-hidden rounded-md border border-slate-200 dark:divide-border/60 dark:border-border", children: a.collections.map((s) => /* @__PURE__ */ t(
|
|
135
|
+
Y,
|
|
98
136
|
{
|
|
99
|
-
userId:
|
|
100
|
-
day:
|
|
101
|
-
tz:
|
|
102
|
-
group:
|
|
137
|
+
userId: e,
|
|
138
|
+
day: a.day,
|
|
139
|
+
tz: r,
|
|
140
|
+
group: s
|
|
103
141
|
},
|
|
104
|
-
|
|
142
|
+
s.collection ?? T
|
|
105
143
|
)) })
|
|
106
144
|
] });
|
|
107
145
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
146
|
+
function V({ parts: e }) {
|
|
147
|
+
return /* @__PURE__ */ t(
|
|
148
|
+
"span",
|
|
149
|
+
{
|
|
150
|
+
className: "text-[12px] leading-5 text-slate-600 dark:text-slate-400",
|
|
151
|
+
"data-person-did-parts": !0,
|
|
152
|
+
children: e.map((a, r) => /* @__PURE__ */ n("span", { children: [
|
|
153
|
+
/* @__PURE__ */ n("span", { className: "whitespace-nowrap", children: [
|
|
154
|
+
a.verb,
|
|
155
|
+
a.count > 1 && /* @__PURE__ */ t("span", { className: "ml-1 tabular-nums text-slate-500 dark:text-slate-400", children: C(a.count) }),
|
|
156
|
+
r < e.length - 1 && /* @__PURE__ */ t("span", { "aria-hidden": !0, className: "pl-1 text-slate-300 dark:text-slate-600", children: "·" })
|
|
157
|
+
] }),
|
|
158
|
+
r < e.length - 1 && " "
|
|
159
|
+
] }, a.verb))
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
function Y({
|
|
164
|
+
userId: e,
|
|
165
|
+
day: a,
|
|
166
|
+
tz: r,
|
|
167
|
+
group: s
|
|
113
168
|
}) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
169
|
+
var l, x, p;
|
|
170
|
+
const c = w(), [m, o] = k(!1), u = s.collection ?? T, b = s.label ?? Q(s.collection), d = N({
|
|
171
|
+
queryKey: ["nvr-person-did-lines", e, a, u, r],
|
|
172
|
+
enabled: m,
|
|
173
|
+
queryFn: () => c.request(
|
|
174
|
+
L(`/activity/people/${e}/entries`, { day: a, collection: u, tz: r })
|
|
175
|
+
),
|
|
120
176
|
staleTime: 6e4
|
|
121
|
-
})
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
177
|
+
}), h = `person-did-${a}-${u}`;
|
|
178
|
+
return /* @__PURE__ */ n("li", { "data-person-did-group": u, children: [
|
|
179
|
+
/* @__PURE__ */ n(
|
|
124
180
|
"button",
|
|
125
181
|
{
|
|
126
182
|
type: "button",
|
|
127
|
-
onClick: () =>
|
|
128
|
-
"aria-expanded":
|
|
129
|
-
|
|
183
|
+
onClick: () => o((i) => !i),
|
|
184
|
+
"aria-expanded": m,
|
|
185
|
+
"aria-controls": h,
|
|
186
|
+
className: "flex w-full items-start gap-2 px-3 py-2.5 text-left hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted/50",
|
|
130
187
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
188
|
+
/* @__PURE__ */ t(
|
|
189
|
+
q,
|
|
133
190
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
191
|
+
"aria-hidden": !0,
|
|
192
|
+
className: W(
|
|
193
|
+
"mt-[3px] h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150 motion-reduce:transition-none",
|
|
194
|
+
m && "rotate-90"
|
|
137
195
|
)
|
|
138
196
|
}
|
|
139
197
|
),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
198
|
+
/* @__PURE__ */ n("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 sm:flex-row sm:items-baseline sm:gap-3", children: [
|
|
199
|
+
/* @__PURE__ */ t("span", { className: "shrink-0 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: b }),
|
|
200
|
+
/* @__PURE__ */ t(V, { parts: B(s) })
|
|
201
|
+
] })
|
|
143
202
|
]
|
|
144
203
|
}
|
|
145
204
|
),
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
className: "min-w-0 truncate text-slate-500 dark:text-slate-400",
|
|
175
|
-
title: t.comment,
|
|
176
|
-
children: t.comment
|
|
177
|
-
}
|
|
178
|
-
)
|
|
179
|
-
] }, t.id);
|
|
180
|
-
}),
|
|
181
|
-
(d == null ? void 0 : d.length) === 500 && /* @__PURE__ */ e("li", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "The first 500 are shown — export for all." })
|
|
182
|
-
] }) })
|
|
205
|
+
m && /* @__PURE__ */ t(
|
|
206
|
+
"div",
|
|
207
|
+
{
|
|
208
|
+
id: h,
|
|
209
|
+
className: "border-t border-slate-100 bg-slate-50/70 px-3 py-2 dark:border-border/60 dark:bg-muted/20",
|
|
210
|
+
children: d.isLoading ? /* @__PURE__ */ t("div", { className: "space-y-2 py-1", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ n("div", { className: "flex gap-3", children: [
|
|
211
|
+
/* @__PURE__ */ t("div", { className: "h-3 w-14 animate-pulse rounded bg-slate-200/70 dark:bg-muted" }),
|
|
212
|
+
/* @__PURE__ */ t("div", { className: "h-3 flex-1 animate-pulse rounded bg-slate-200/70 dark:bg-muted" })
|
|
213
|
+
] }, i)) }) : d.isError ? /* @__PURE__ */ t(
|
|
214
|
+
S,
|
|
215
|
+
{
|
|
216
|
+
error: d.error,
|
|
217
|
+
what: "these entries",
|
|
218
|
+
onRetry: () => void d.refetch()
|
|
219
|
+
}
|
|
220
|
+
) : (((l = d.data) == null ? void 0 : l.data) ?? []).length === 0 ? /* @__PURE__ */ t(_, { children: "Nothing to show for this day." }) : /* @__PURE__ */ n(
|
|
221
|
+
"ol",
|
|
222
|
+
{
|
|
223
|
+
className: "divide-y divide-slate-200/60 dark:divide-border/40",
|
|
224
|
+
"data-person-did-lines": !0,
|
|
225
|
+
children: [
|
|
226
|
+
(((x = d.data) == null ? void 0 : x.data) ?? []).map((i) => /* @__PURE__ */ t(G, { line: i, tz: r }, i.key)),
|
|
227
|
+
((p = d.data) == null ? void 0 : p.truncated) && /* @__PURE__ */ t("li", { className: "pt-2 text-[11.5px] text-slate-500 dark:text-slate-400", children: "The newest 300 are shown — export for the rest." })
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
)
|
|
183
233
|
] });
|
|
184
234
|
}
|
|
235
|
+
function A({ line: e, generic: a }) {
|
|
236
|
+
const r = F();
|
|
237
|
+
if (!e.record)
|
|
238
|
+
return /* @__PURE__ */ t("span", { className: a ? "text-slate-500 dark:text-slate-400" : void 0, children: e.target });
|
|
239
|
+
const s = { collection: e.record.collection, itemId: e.record.id };
|
|
240
|
+
return /* @__PURE__ */ t(
|
|
241
|
+
"a",
|
|
242
|
+
{
|
|
243
|
+
href: r.urlFor(s),
|
|
244
|
+
onClick: (c) => {
|
|
245
|
+
c.metaKey || c.ctrlKey || c.shiftKey || (c.preventDefault(), r.open(s));
|
|
246
|
+
},
|
|
247
|
+
className: "rounded-sm text-sky-800 underline-offset-2 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
|
|
248
|
+
children: e.target
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
function G({ line: e, tz: a }) {
|
|
253
|
+
const r = e.first_at && e.count > 1 ? `${e.count} times, ${f(e.first_at, a)} – ${f(e.at, a)}` : void 0, s = !e.record && /^a .+ record$/.test(e.target);
|
|
254
|
+
return /* @__PURE__ */ n(
|
|
255
|
+
"li",
|
|
256
|
+
{
|
|
257
|
+
className: "relative grid grid-cols-[4.25rem_minmax(0,1fr)] gap-x-2 py-1.5 sm:grid-cols-[4.75rem_minmax(0,1fr)]",
|
|
258
|
+
"data-person-did-line": e.kind,
|
|
259
|
+
children: [
|
|
260
|
+
/* @__PURE__ */ t(
|
|
261
|
+
"time",
|
|
262
|
+
{
|
|
263
|
+
dateTime: e.at,
|
|
264
|
+
className: "pt-px text-[12px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
265
|
+
children: f(e.at, a)
|
|
266
|
+
}
|
|
267
|
+
),
|
|
268
|
+
/* @__PURE__ */ n("div", { className: "min-w-0", children: [
|
|
269
|
+
/* @__PURE__ */ n("p", { className: "text-[12.5px] leading-5 text-slate-700 dark:text-slate-300", children: [
|
|
270
|
+
/* @__PURE__ */ t("span", { className: "font-medium text-slate-900 dark:text-slate-100", children: e.verb }),
|
|
271
|
+
e.target && " ",
|
|
272
|
+
e.target && /* @__PURE__ */ t(A, { line: e, generic: s }),
|
|
273
|
+
e.count > 1 && /* @__PURE__ */ n(
|
|
274
|
+
"span",
|
|
275
|
+
{
|
|
276
|
+
className: "ml-1.5 whitespace-nowrap rounded bg-slate-200/70 px-1 py-px text-[11px] font-medium tabular-nums text-slate-600 dark:bg-muted dark:text-slate-300",
|
|
277
|
+
"data-tip": r,
|
|
278
|
+
children: [
|
|
279
|
+
/* @__PURE__ */ n("span", { "aria-hidden": !0, children: [
|
|
280
|
+
e.count,
|
|
281
|
+
"×"
|
|
282
|
+
] }),
|
|
283
|
+
r && /* @__PURE__ */ t("span", { className: "sr-only", children: r })
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
] }),
|
|
288
|
+
e.detail && /* @__PURE__ */ t("p", { className: "text-[12px] leading-5 text-slate-500 dark:text-slate-400", children: e.detail }),
|
|
289
|
+
e.note && /* @__PURE__ */ n("p", { className: "text-[12px] leading-5 text-slate-600 dark:text-slate-400", children: [
|
|
290
|
+
"“",
|
|
291
|
+
e.note,
|
|
292
|
+
"”"
|
|
293
|
+
] })
|
|
294
|
+
] })
|
|
295
|
+
]
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}
|
|
185
299
|
export {
|
|
186
|
-
|
|
187
|
-
|
|
300
|
+
oe as PersonDidPanel,
|
|
301
|
+
Q as collectionName
|
|
188
302
|
};
|
|
@@ -9,24 +9,25 @@ import { DelegationCard as D } from "./DelegationCard.js";
|
|
|
9
9
|
import { MyDefaultsCard as U } from "./MyDefaultsCard.js";
|
|
10
10
|
import { SuspensionBanner as F, AccessCard as M, UserScopesCard as O, UserDirectoryCard as W, SessionsCard as j, ApiTokenCard as E } from "./PersonAccess.js";
|
|
11
11
|
import { AccessSummaryCard as L } from "./PersonAccessSummary.js";
|
|
12
|
-
import { StatsCard as R,
|
|
13
|
-
import { ForceReloadCard as
|
|
14
|
-
import { PersonAiMemoryCard as
|
|
15
|
-
import { CompareAccessCard as
|
|
16
|
-
import { PersonDidPanel as
|
|
17
|
-
import { WorkingOnCard as
|
|
18
|
-
import { PersonHeader as
|
|
19
|
-
import { AboutCard as
|
|
20
|
-
import { PersonWeekCard as
|
|
21
|
-
import { SignedInDevices as
|
|
22
|
-
import { usePersonProfile as
|
|
23
|
-
|
|
12
|
+
import { StatsCard as R, SignInsCard as V, JourneyCard as B } from "./PersonActivity.js";
|
|
13
|
+
import { ForceReloadCard as H, SignOutEverywhereCard as J, MergeCard as q, OffboardingCard as z } from "./PersonAdminTools.js";
|
|
14
|
+
import { PersonAiMemoryCard as G } from "./PersonAiMemory.js";
|
|
15
|
+
import { CompareAccessCard as K } from "./PersonCompare.js";
|
|
16
|
+
import { PersonDidPanel as Q } from "./PersonDidPanel.js";
|
|
17
|
+
import { WorkingOnCard as X, TeamLoadCard as Y, WhyCard as Z } from "./PersonExtras.js";
|
|
18
|
+
import { PersonHeader as $ } from "./PersonHeader.js";
|
|
19
|
+
import { AboutCard as ee, PeopleCard as re, AvailabilityCard as ae, ResponsibilitiesCard as de } from "./PersonOverview.js";
|
|
20
|
+
import { PersonWeekCard as se } from "./PersonWeek.js";
|
|
21
|
+
import { SignedInDevices as te } from "./SignedInDevices.js";
|
|
22
|
+
import { usePersonProfile as ie, useInvalidatePerson as oe } from "./types.js";
|
|
23
|
+
import { ActivityFeedCard as ne } from "./ActivityFeedCard.js";
|
|
24
|
+
function Fe({
|
|
24
25
|
userId: o,
|
|
25
26
|
className: l,
|
|
26
27
|
initialTab: h = "overview"
|
|
27
28
|
}) {
|
|
28
29
|
var v, g, f;
|
|
29
|
-
const t = w(), s = !!(t != null && t.isAdmin), { data: e, isLoading: y, isError: x } =
|
|
30
|
+
const t = w(), s = !!(t != null && t.isAdmin), { data: e, isLoading: y, isError: x } = ie(o), N = oe(o), [u, C] = b(h), [c, k] = b("feed");
|
|
30
31
|
if (y || !e && !x) return /* @__PURE__ */ r(le, { className: l });
|
|
31
32
|
if (!e)
|
|
32
33
|
return /* @__PURE__ */ a(
|
|
@@ -45,17 +46,17 @@ function Ue({
|
|
|
45
46
|
);
|
|
46
47
|
const _ = !!(t != null && t.userId) && !!((v = e.manager) != null && v.id) && String(e.manager.id).toUpperCase() === String(t.userId).toUpperCase(), p = /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
47
48
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
48
|
-
/* @__PURE__ */ r(
|
|
49
|
-
/* @__PURE__ */ r(
|
|
49
|
+
/* @__PURE__ */ r(ee, { profile: e, isAdmin: s }),
|
|
50
|
+
/* @__PURE__ */ r(X, { profile: e }),
|
|
50
51
|
e.direct_reports.length > 0 && /* @__PURE__ */ r(
|
|
51
|
-
|
|
52
|
+
Y,
|
|
52
53
|
{
|
|
53
54
|
userId: e.id,
|
|
54
55
|
firstName: e.first_name ?? e.name,
|
|
55
56
|
expectedRows: e.direct_reports.length
|
|
56
57
|
}
|
|
57
58
|
),
|
|
58
|
-
/* @__PURE__ */ r(
|
|
59
|
+
/* @__PURE__ */ r(re, { profile: e })
|
|
59
60
|
] }),
|
|
60
61
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
61
62
|
s ? /* @__PURE__ */ r(
|
|
@@ -78,13 +79,13 @@ function Ue({
|
|
|
78
79
|
coversFor: e.covers_for,
|
|
79
80
|
onSaved: N
|
|
80
81
|
}
|
|
81
|
-
) : /* @__PURE__ */ r(
|
|
82
|
-
/* @__PURE__ */ r(
|
|
83
|
-
(s || _) && /* @__PURE__ */ r(
|
|
82
|
+
) : /* @__PURE__ */ r(ae, { profile: e }),
|
|
83
|
+
/* @__PURE__ */ r(de, { profile: e, isAdmin: s }),
|
|
84
|
+
(s || _) && /* @__PURE__ */ r(se, { profile: e })
|
|
84
85
|
] })
|
|
85
86
|
] });
|
|
86
87
|
return /* @__PURE__ */ a("div", { className: n("flex flex-col gap-4", l), "data-nvr-person": e.id, children: [
|
|
87
|
-
/* @__PURE__ */ r(
|
|
88
|
+
/* @__PURE__ */ r($, { profile: e, isAdmin: s }),
|
|
88
89
|
s && /* @__PURE__ */ r(F, { profile: e }),
|
|
89
90
|
s ? /* @__PURE__ */ a(A, { value: u, onValueChange: (d) => C(d), children: [
|
|
90
91
|
/* @__PURE__ */ r(
|
|
@@ -117,13 +118,13 @@ function Ue({
|
|
|
117
118
|
/* @__PURE__ */ r(L, { userId: e.id }),
|
|
118
119
|
/* @__PURE__ */ r(I, { userId: e.id }),
|
|
119
120
|
/* @__PURE__ */ r(O, { userId: e.id }),
|
|
120
|
-
/* @__PURE__ */ r(
|
|
121
|
-
/* @__PURE__ */ r(
|
|
121
|
+
/* @__PURE__ */ r(Z, { profile: e }),
|
|
122
|
+
/* @__PURE__ */ r(K, { profile: e })
|
|
122
123
|
] }),
|
|
123
124
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
124
125
|
/* @__PURE__ */ r(W, { profile: e }),
|
|
125
126
|
/* @__PURE__ */ r(j, { userId: e.id }),
|
|
126
|
-
/* @__PURE__ */ r(
|
|
127
|
+
/* @__PURE__ */ r(te, { userId: e.id, name: e.first_name ?? e.name }),
|
|
127
128
|
/* @__PURE__ */ r(E, { profile: e })
|
|
128
129
|
] })
|
|
129
130
|
] }) }),
|
|
@@ -159,24 +160,24 @@ function Ue({
|
|
|
159
160
|
c === "day" && s ? /* @__PURE__ */ r(T, { userId: e.id }) : /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
160
161
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
161
162
|
/* @__PURE__ */ r(R, { userId: e.id }),
|
|
162
|
-
/* @__PURE__ */ r(
|
|
163
|
+
/* @__PURE__ */ r(ne, { userId: e.id })
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
165
|
-
/* @__PURE__ */ r(
|
|
166
|
-
/* @__PURE__ */ r(
|
|
166
|
+
/* @__PURE__ */ r(V, { profile: e }),
|
|
167
|
+
/* @__PURE__ */ r(B, { userId: e.id })
|
|
167
168
|
] })
|
|
168
169
|
] })
|
|
169
170
|
] }),
|
|
170
|
-
/* @__PURE__ */ r(i, { value: "did", className: "mt-4 focus-visible:outline-none", children: u === "did" && /* @__PURE__ */ r(
|
|
171
|
+
/* @__PURE__ */ r(i, { value: "did", className: "mt-4 focus-visible:outline-none", children: u === "did" && /* @__PURE__ */ r(Q, { userId: e.id, name: e.first_name ?? e.name }) }),
|
|
171
172
|
/* @__PURE__ */ r(i, { value: "tools", className: "mt-4 focus-visible:outline-none", children: /* @__PURE__ */ a("div", { className: "grid gap-4 lg:grid-cols-2", children: [
|
|
172
173
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
174
|
+
/* @__PURE__ */ r(H, { profile: e }),
|
|
173
175
|
/* @__PURE__ */ r(J, { profile: e }),
|
|
174
|
-
/* @__PURE__ */ r(q, { profile: e })
|
|
175
|
-
/* @__PURE__ */ r(z, { profile: e })
|
|
176
|
+
/* @__PURE__ */ r(q, { profile: e })
|
|
176
177
|
] }),
|
|
177
178
|
/* @__PURE__ */ a("div", { className: "space-y-4", children: [
|
|
179
|
+
/* @__PURE__ */ r(z, { profile: e }),
|
|
178
180
|
/* @__PURE__ */ r(G, { profile: e }),
|
|
179
|
-
/* @__PURE__ */ r(K, { profile: e }),
|
|
180
181
|
/* @__PURE__ */ r(U, { userId: e.id, name: e.first_name ?? e.name })
|
|
181
182
|
] })
|
|
182
183
|
] }) })
|
|
@@ -200,5 +201,5 @@ function le({ className: o }) {
|
|
|
200
201
|
] });
|
|
201
202
|
}
|
|
202
203
|
export {
|
|
203
|
-
|
|
204
|
+
Fe as PersonProfile
|
|
204
205
|
};
|