@nivaro/react 0.3.64 → 0.3.66
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 +62 -8
- package/dist/shared/components/CollectionBrowserView.js +3127 -3204
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4842 -4500
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +84 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +27 -16
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { Bot as
|
|
4
|
-
import { useState as C, useRef as W, useEffect as E, useMemo as
|
|
5
|
-
import { useApiFetchConfig as
|
|
6
|
-
import { useLiveEvent as
|
|
7
|
-
import { useLiveOps as
|
|
8
|
-
import { resolveNotificationTarget as Z, runNotificationTarget as
|
|
9
|
-
import { usePrefetchIntent as
|
|
10
|
-
import { useOptionalRealtime as
|
|
11
|
-
import { userErrorMessage as
|
|
12
|
-
import { withinDay as G, slaChip as
|
|
2
|
+
import { useQueryClient as le, useQuery as ce, useMutation as F } from "@tanstack/react-query";
|
|
3
|
+
import { Bot as me } from "lucide-react";
|
|
4
|
+
import { useState as C, useRef as W, useEffect as E, useMemo as ue } from "react";
|
|
5
|
+
import { useApiFetchConfig as pe, useItemNavigation as be, useNavigation as he } from "../context.js";
|
|
6
|
+
import { useLiveEvent as xe } from "../lib/live.js";
|
|
7
|
+
import { useLiveOps as ge, useFreshIds as fe } from "../lib/live-ops.js";
|
|
8
|
+
import { resolveNotificationTarget as Z, runNotificationTarget as ke } from "../lib/notification-target.js";
|
|
9
|
+
import { usePrefetchIntent as ye } from "../lib/prefetch.js";
|
|
10
|
+
import { useOptionalRealtime as we } from "../lib/realtime.js";
|
|
11
|
+
import { userErrorMessage as Ne } from "../lib/safe-error.js";
|
|
12
|
+
import { withinDay as G, slaChip as ve } from "../lib/sla-chip.js";
|
|
13
13
|
import { cn as M } from "../lib/utils.js";
|
|
14
|
-
import { AgentQuestionsCard as
|
|
15
|
-
import { FirstWeekCard as
|
|
16
|
-
import { TaskDoButton as
|
|
17
|
-
import { openChatRoom as Se, canOpenChatRoom as
|
|
18
|
-
import { useMyRecordRooms as
|
|
19
|
-
import { LearningPathCard as
|
|
20
|
-
import { RequiredVideosCard as
|
|
21
|
-
import { SkeletonBar as
|
|
22
|
-
import { TickerNumber as
|
|
23
|
-
import { UserAvatar as
|
|
24
|
-
const
|
|
14
|
+
import { AgentQuestionsCard as _e } from "./AgentQuestionsCard.js";
|
|
15
|
+
import { FirstWeekCard as Ce } from "./ai/FirstWeekCard.js";
|
|
16
|
+
import { TaskDoButton as $e } from "./ai/TaskDo.js";
|
|
17
|
+
import { openChatRoom as Se, canOpenChatRoom as Te } from "./chat/chat-core.js";
|
|
18
|
+
import { useMyRecordRooms as je } from "./chat/chat-hooks.js";
|
|
19
|
+
import { LearningPathCard as Ae } from "./help-videos/viewer/LearningPathCard.js";
|
|
20
|
+
import { RequiredVideosCard as Me } from "./help-videos/viewer/RequiredVideosCard.js";
|
|
21
|
+
import { SkeletonBar as Oe, ListSkeleton as Le } from "./Skeletons.js";
|
|
22
|
+
import { TickerNumber as qe } from "./TickerNumber.js";
|
|
23
|
+
import { UserAvatar as Ie } from "./UserAvatar.js";
|
|
24
|
+
const De = 8e3, R = ["records", "tasks", "team", "waiting", "notifications"], X = {
|
|
25
25
|
records: "Waiting on you",
|
|
26
26
|
tasks: "My tasks",
|
|
27
27
|
team: "Team tasks",
|
|
28
28
|
waiting: "Waiting on others",
|
|
29
29
|
notifications: "Notifications"
|
|
30
|
-
},
|
|
30
|
+
}, Fe = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), O = (i) => !!i && String(i).slice(0, 10) < Fe(), We = {
|
|
31
31
|
alert: "bg-red-500/10 text-red-600 dark:text-red-400",
|
|
32
32
|
warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
|
|
33
33
|
neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
|
|
34
34
|
ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
35
35
|
};
|
|
36
|
-
function
|
|
37
|
-
const u =
|
|
36
|
+
function Ee({ sla: i }) {
|
|
37
|
+
const u = ve(i);
|
|
38
38
|
return u ? /* @__PURE__ */ e(
|
|
39
39
|
"span",
|
|
40
40
|
{
|
|
41
41
|
"data-sla-chip": u.tone,
|
|
42
|
-
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${
|
|
42
|
+
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${We[u.tone]}`,
|
|
43
43
|
children: u.label
|
|
44
44
|
}
|
|
45
45
|
) : null;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Ue({ state: i, color: u }) {
|
|
48
48
|
return i ? /* @__PURE__ */ e(
|
|
49
49
|
"span",
|
|
50
50
|
{
|
|
@@ -57,10 +57,10 @@ function Ee({ state: i, color: u }) {
|
|
|
57
57
|
}
|
|
58
58
|
) : null;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Ke({ order: i, hidden: u }) {
|
|
61
61
|
const c = i.filter(
|
|
62
62
|
(m) => !u.includes(m) && (m === "records" || m === "tasks" || m === "notifications")
|
|
63
|
-
),
|
|
63
|
+
), w = (m, g) => /* @__PURE__ */ d(
|
|
64
64
|
"section",
|
|
65
65
|
{
|
|
66
66
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
@@ -92,12 +92,12 @@ function Ue({ order: i, hidden: u }) {
|
|
|
92
92
|
), k = [];
|
|
93
93
|
for (let m = 0; m < c.length; ) {
|
|
94
94
|
if (c[m] === "records") {
|
|
95
|
-
k.push(
|
|
95
|
+
k.push(w("records", 5)), m++;
|
|
96
96
|
continue;
|
|
97
97
|
}
|
|
98
98
|
const g = c.slice(m, m + 2).filter((f) => f !== "records");
|
|
99
99
|
k.push(
|
|
100
|
-
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) =>
|
|
100
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: g.map((f) => w(f, 4)) }, g.join("+"))
|
|
101
101
|
), m += g.length;
|
|
102
102
|
}
|
|
103
103
|
return /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work-loading": !0, "aria-busy": "true", children: [
|
|
@@ -108,7 +108,7 @@ function Ue({ order: i, hidden: u }) {
|
|
|
108
108
|
className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card",
|
|
109
109
|
children: [
|
|
110
110
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: m }),
|
|
111
|
-
/* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(
|
|
111
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 flex h-[27px] items-center", children: /* @__PURE__ */ e(Oe, { width: 34, className: "h-[18px] rounded-md" }) })
|
|
112
112
|
]
|
|
113
113
|
},
|
|
114
114
|
m
|
|
@@ -119,21 +119,21 @@ function Ue({ order: i, hidden: u }) {
|
|
|
119
119
|
k
|
|
120
120
|
] });
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function L({ label: i, value: u, tone: c }) {
|
|
123
123
|
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
|
|
124
124
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: i }),
|
|
125
|
-
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(
|
|
125
|
+
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${c ?? ""}`, children: /* @__PURE__ */ e(qe, { value: u }) })
|
|
126
126
|
] });
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function ut({
|
|
129
129
|
notificationRoutes: i,
|
|
130
130
|
onOpenPath: u
|
|
131
131
|
} = {}) {
|
|
132
|
-
const { apiBase: c, authHeaders:
|
|
132
|
+
const { apiBase: c, authHeaders: w, credentials: k } = pe(), { open: m } = be(), g = he(), f = le(), ee = ye(), U = (r) => {
|
|
133
133
|
var h, l;
|
|
134
134
|
const n = ((h = i == null ? void 0 : i.support) == null ? void 0 : h.call(i, String(r))) ?? ((l = g.consoleUrl) == null ? void 0 : l.call(g, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
|
|
135
135
|
u ? u(n) : g.navigate(n);
|
|
136
|
-
}, q =
|
|
136
|
+
}, q = we(), [te, $] = C(!1), [x, re] = C(() => {
|
|
137
137
|
try {
|
|
138
138
|
const r = localStorage.getItem("nvr_mywork_sections");
|
|
139
139
|
if (r) {
|
|
@@ -155,33 +155,33 @@ function mt({
|
|
|
155
155
|
localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
|
|
156
156
|
} catch {
|
|
157
157
|
}
|
|
158
|
-
}, [ae, de] = C(!1), P = W(0), [
|
|
158
|
+
}, [ae, de] = C(!1), P = W(0), [S, ne] = C("all"), { data: a, isLoading: se, refetch: Q, isFetching: B } = ce({
|
|
159
159
|
queryKey: ["my-work"],
|
|
160
160
|
queryFn: async () => {
|
|
161
|
-
const r = await fetch(`${c}/my-work`, { headers:
|
|
161
|
+
const r = await fetch(`${c}/my-work`, { headers: w, credentials: k });
|
|
162
162
|
if (!r.ok) throw new Error("my-work failed");
|
|
163
163
|
return (await r.json()).data;
|
|
164
164
|
},
|
|
165
165
|
staleTime: 6e4
|
|
166
|
-
}), z = W(0),
|
|
166
|
+
}), z = W(0), N = W(null), H = () => {
|
|
167
167
|
const r = () => {
|
|
168
|
-
|
|
169
|
-
}, n = z.current +
|
|
170
|
-
|
|
168
|
+
N.current = null, z.current = Date.now(), $(!1), f.invalidateQueries({ queryKey: ["my-work"] });
|
|
169
|
+
}, n = z.current + De - Date.now();
|
|
170
|
+
N.current || (n <= 0 ? r() : N.current = setTimeout(r, n));
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
ge("my-work", H, { debounceMs: 1500 }), xe("notification:new", H, { debounceMs: 1500 }), E(
|
|
173
173
|
() => () => {
|
|
174
|
-
|
|
174
|
+
N.current && clearTimeout(N.current);
|
|
175
175
|
},
|
|
176
176
|
[]
|
|
177
177
|
);
|
|
178
|
-
const J =
|
|
178
|
+
const J = fe([
|
|
179
179
|
...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
|
|
180
180
|
...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
|
|
181
181
|
...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
|
|
182
182
|
...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
|
|
183
183
|
...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
|
|
184
|
-
]),
|
|
184
|
+
]), v = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", I = ue(() => {
|
|
185
185
|
const r = /* @__PURE__ */ new Set();
|
|
186
186
|
for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
|
|
187
187
|
return [...r];
|
|
@@ -190,14 +190,14 @@ function mt({
|
|
|
190
190
|
if (!(!q || I.length === 0))
|
|
191
191
|
return q.subscribeCollections(I, () => {
|
|
192
192
|
const r = Date.now();
|
|
193
|
-
r - P.current < 3e4 || (P.current = r,
|
|
193
|
+
r - P.current < 3e4 || (P.current = r, $(!0));
|
|
194
194
|
});
|
|
195
195
|
}, [q, I]);
|
|
196
196
|
const V = F({
|
|
197
197
|
// A ticket closes through /support so its requester hears about it.
|
|
198
198
|
mutationFn: (r) => fetch(`${c}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
|
|
199
199
|
method: "PATCH",
|
|
200
|
-
headers: { ...
|
|
200
|
+
headers: { ...w, "content-type": "application/json" },
|
|
201
201
|
credentials: k,
|
|
202
202
|
body: JSON.stringify({ status: "done" })
|
|
203
203
|
}),
|
|
@@ -206,7 +206,7 @@ function mt({
|
|
|
206
206
|
mutationFn: async ({ id: r, action: n }) => {
|
|
207
207
|
const h = await fetch(`${c}/tasks/${r}/${n}`, {
|
|
208
208
|
method: "POST",
|
|
209
|
-
headers: { ...
|
|
209
|
+
headers: { ...w, "content-type": "application/json" },
|
|
210
210
|
credentials: k,
|
|
211
211
|
body: "{}"
|
|
212
212
|
}), l = await h.json().catch(() => ({}));
|
|
@@ -216,7 +216,7 @@ function mt({
|
|
|
216
216
|
onSuccess: (r) => {
|
|
217
217
|
D(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), f.invalidateQueries({ queryKey: ["my-work"] });
|
|
218
218
|
},
|
|
219
|
-
onError: (r) => D(
|
|
219
|
+
onError: (r) => D(Ne(r, "Failed"))
|
|
220
220
|
}), [j, D] = C(null);
|
|
221
221
|
E(() => {
|
|
222
222
|
if (!j) return;
|
|
@@ -226,14 +226,14 @@ function mt({
|
|
|
226
226
|
const Y = F({
|
|
227
227
|
mutationFn: (r) => fetch(`${c}/notifications/mark-read`, {
|
|
228
228
|
method: "POST",
|
|
229
|
-
headers: { ...
|
|
229
|
+
headers: { ...w, "content-type": "application/json" },
|
|
230
230
|
credentials: k,
|
|
231
231
|
body: JSON.stringify({ ids: r })
|
|
232
232
|
}),
|
|
233
233
|
onSuccess: () => {
|
|
234
234
|
f.invalidateQueries({ queryKey: ["my-work"] }), f.invalidateQueries({ queryKey: ["notifications"] });
|
|
235
235
|
}
|
|
236
|
-
}),
|
|
236
|
+
}), _ = (r, n) => {
|
|
237
237
|
const h = {
|
|
238
238
|
record: (p, t) => (m({ collection: p, itemId: t }), null),
|
|
239
239
|
...i
|
|
@@ -245,7 +245,7 @@ function mt({
|
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
247
|
if (l) {
|
|
248
|
-
|
|
248
|
+
ke(l, (p) => u == null ? void 0 : u(p));
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && m({ collection: r, itemId: n });
|
|
@@ -253,28 +253,28 @@ function mt({
|
|
|
253
253
|
record: () => null,
|
|
254
254
|
...i
|
|
255
255
|
});
|
|
256
|
-
return se || !a ? /* @__PURE__ */ e(
|
|
257
|
-
/* @__PURE__ */ e(
|
|
256
|
+
return se || !a ? /* @__PURE__ */ e(Ke, { order: x.order, hidden: x.hidden }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
|
|
257
|
+
/* @__PURE__ */ e(Ce, { onOpenPath: u }),
|
|
258
258
|
/* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
|
|
259
259
|
/* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
|
|
260
|
-
/* @__PURE__ */ e(
|
|
260
|
+
/* @__PURE__ */ e(L, { label: "Waiting on you", value: a.counts.owned }),
|
|
261
261
|
/* @__PURE__ */ e(
|
|
262
|
-
|
|
262
|
+
L,
|
|
263
263
|
{
|
|
264
264
|
label: "SLA breached",
|
|
265
265
|
value: a.counts.owned_breached,
|
|
266
266
|
tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
|
|
267
267
|
}
|
|
268
268
|
),
|
|
269
|
-
/* @__PURE__ */ e(
|
|
270
|
-
/* @__PURE__ */ e(
|
|
269
|
+
/* @__PURE__ */ e(L, { label: "Open tasks", value: a.counts.tasks }),
|
|
270
|
+
/* @__PURE__ */ e(L, { label: "Unread notifications", value: a.counts.notifications })
|
|
271
271
|
] }),
|
|
272
272
|
te && /* @__PURE__ */ d(
|
|
273
273
|
"button",
|
|
274
274
|
{
|
|
275
275
|
type: "button",
|
|
276
276
|
onClick: () => {
|
|
277
|
-
|
|
277
|
+
$(!1), Q();
|
|
278
278
|
},
|
|
279
279
|
className: "ml-3 inline-flex items-center gap-1.5 rounded-full border border-nvr-cyan/40 bg-nvr-cyan/10 px-3 py-1.5 text-[12px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
|
|
280
280
|
children: [
|
|
@@ -288,7 +288,7 @@ function mt({
|
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
290
|
onClick: () => {
|
|
291
|
-
|
|
291
|
+
$(!1), Q();
|
|
292
292
|
},
|
|
293
293
|
disabled: B,
|
|
294
294
|
className: "ml-3 rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
@@ -367,18 +367,18 @@ function mt({
|
|
|
367
367
|
children: j
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
/* @__PURE__ */ e(
|
|
370
|
+
/* @__PURE__ */ e(_e, { questions: a.questions ?? [] }),
|
|
371
|
+
/* @__PURE__ */ e(Me, { className: "mb-4" }),
|
|
371
372
|
/* @__PURE__ */ e(Ae, { className: "mb-4" }),
|
|
372
|
-
/* @__PURE__ */ e(je, { className: "mb-4" }),
|
|
373
373
|
(() => {
|
|
374
374
|
const r = {
|
|
375
375
|
records: () => {
|
|
376
376
|
const t = a.owned.filter((s) => G(s.sla)).length, b = a.owned.filter((s) => {
|
|
377
|
-
var
|
|
378
|
-
return ((
|
|
379
|
-
}).length, o =
|
|
380
|
-
var
|
|
381
|
-
return ((
|
|
377
|
+
var y;
|
|
378
|
+
return ((y = s.sla) == null ? void 0 : y.status) === "breached";
|
|
379
|
+
}).length, o = S === "soon" ? a.owned.filter((s) => G(s.sla)) : S === "breached" ? a.owned.filter((s) => {
|
|
380
|
+
var y;
|
|
381
|
+
return ((y = s.sla) == null ? void 0 : y.status) === "breached";
|
|
382
382
|
}) : a.owned, A = [
|
|
383
383
|
{ key: "all", label: `All (${a.owned.length})` },
|
|
384
384
|
{ key: "soon", label: `Warning within 24h (${t})` },
|
|
@@ -394,39 +394,50 @@ function mt({
|
|
|
394
394
|
{
|
|
395
395
|
type: "button",
|
|
396
396
|
"data-my-work-sla-filter": s.key,
|
|
397
|
-
"aria-pressed":
|
|
397
|
+
"aria-pressed": S === s.key,
|
|
398
398
|
onClick: () => ne(s.key),
|
|
399
399
|
className: [
|
|
400
400
|
"rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors duration-150",
|
|
401
|
-
|
|
401
|
+
S === s.key ? "bg-white text-slate-900 shadow-sm dark:bg-card dark:text-foreground" : "text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200"
|
|
402
402
|
].join(" "),
|
|
403
403
|
children: s.label
|
|
404
404
|
},
|
|
405
405
|
s.key
|
|
406
406
|
)) }) }),
|
|
407
|
-
o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((s) =>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
"
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
407
|
+
o.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-6 text-center text-[12.5px] text-muted-foreground", children: a.owned.length === 0 ? "Nothing is waiting on you. Enjoy it." : "Nothing matches this filter." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: o.map((s) => {
|
|
408
|
+
var y;
|
|
409
|
+
return /* @__PURE__ */ e(
|
|
410
|
+
"li",
|
|
411
|
+
{
|
|
412
|
+
className: v(`o:${s.collection}:${s.item}`),
|
|
413
|
+
"data-my-work-fresh": J.has(`o:${s.collection}:${s.item}`) || void 0,
|
|
414
|
+
children: /* @__PURE__ */ d(
|
|
415
|
+
"button",
|
|
416
|
+
{
|
|
417
|
+
type: "button",
|
|
418
|
+
onClick: () => _(s.collection, s.item),
|
|
419
|
+
...ee.record(s.collection, s.item),
|
|
420
|
+
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-muted",
|
|
421
|
+
children: [
|
|
422
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: s.label }),
|
|
423
|
+
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: s.collection.replace(/_/g, " ") }),
|
|
424
|
+
((y = s.flags) == null ? void 0 : y.some((ie) => /^on hold$/i.test(ie.name.trim()))) && /* @__PURE__ */ e(
|
|
425
|
+
"span",
|
|
426
|
+
{
|
|
427
|
+
"data-my-work-hold": !0,
|
|
428
|
+
className: "shrink-0 rounded-full bg-amber-500/15 px-1.5 py-px text-[10.5px] font-semibold text-amber-800 dark:text-amber-300",
|
|
429
|
+
children: "On hold"
|
|
430
|
+
}
|
|
431
|
+
),
|
|
432
|
+
/* @__PURE__ */ e(Ue, { state: s.state, color: s.state_color }),
|
|
433
|
+
/* @__PURE__ */ e(Ee, { sla: s.sla })
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
},
|
|
438
|
+
`${s.collection}:${s.item}`
|
|
439
|
+
);
|
|
440
|
+
}) })
|
|
430
441
|
] });
|
|
431
442
|
},
|
|
432
443
|
tasks: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
@@ -434,7 +445,7 @@ function mt({
|
|
|
434
445
|
a.tasks.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "No open tasks." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.tasks.map((t) => /* @__PURE__ */ d(
|
|
435
446
|
"li",
|
|
436
447
|
{
|
|
437
|
-
className: M("flex items-center gap-2.5 px-4 py-2",
|
|
448
|
+
className: M("flex items-center gap-2.5 px-4 py-2", v(`t:${t.id}`)),
|
|
438
449
|
children: [
|
|
439
450
|
/* @__PURE__ */ e(
|
|
440
451
|
"button",
|
|
@@ -456,7 +467,7 @@ function mt({
|
|
|
456
467
|
"data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
|
|
457
468
|
"data-my-work-agent-task": t.id,
|
|
458
469
|
children: [
|
|
459
|
-
/* @__PURE__ */ e(
|
|
470
|
+
/* @__PURE__ */ e(me, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
460
471
|
t.agent_name ?? "Agent"
|
|
461
472
|
]
|
|
462
473
|
}
|
|
@@ -465,7 +476,7 @@ function mt({
|
|
|
465
476
|
"button",
|
|
466
477
|
{
|
|
467
478
|
type: "button",
|
|
468
|
-
onClick: () => t.kind === "support" ? U(t.id) :
|
|
479
|
+
onClick: () => t.kind === "support" ? U(t.id) : _(t.collection, t.item),
|
|
469
480
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
470
481
|
children: [
|
|
471
482
|
t.title,
|
|
@@ -474,7 +485,7 @@ function mt({
|
|
|
474
485
|
}
|
|
475
486
|
),
|
|
476
487
|
/* @__PURE__ */ e(
|
|
477
|
-
|
|
488
|
+
$e,
|
|
478
489
|
{
|
|
479
490
|
task: t,
|
|
480
491
|
isAssignee: !0,
|
|
@@ -485,7 +496,7 @@ function mt({
|
|
|
485
496
|
t.due_date && /* @__PURE__ */ e(
|
|
486
497
|
"span",
|
|
487
498
|
{
|
|
488
|
-
className: `text-[11px] tabular-nums ${
|
|
499
|
+
className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
489
500
|
children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
|
|
490
501
|
}
|
|
491
502
|
)
|
|
@@ -507,7 +518,7 @@ function mt({
|
|
|
507
518
|
(a.team_tasks ?? []).length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "Nothing waiting with your teams." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: (a.team_tasks ?? []).map((t) => /* @__PURE__ */ d(
|
|
508
519
|
"li",
|
|
509
520
|
{
|
|
510
|
-
className: M("flex items-center gap-2.5 px-4 py-2",
|
|
521
|
+
className: M("flex items-center gap-2.5 px-4 py-2", v(`tt:${t.id}`)),
|
|
511
522
|
"data-my-work-team-task": t.id,
|
|
512
523
|
children: [
|
|
513
524
|
t.priority === "urgent" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-red-500/10 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-red-600 dark:text-red-400", children: "urgent" }),
|
|
@@ -515,7 +526,7 @@ function mt({
|
|
|
515
526
|
"button",
|
|
516
527
|
{
|
|
517
528
|
type: "button",
|
|
518
|
-
onClick: () =>
|
|
529
|
+
onClick: () => _(t.collection, t.item),
|
|
519
530
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
520
531
|
children: [
|
|
521
532
|
t.title,
|
|
@@ -526,7 +537,7 @@ function mt({
|
|
|
526
537
|
t.due_date && /* @__PURE__ */ e(
|
|
527
538
|
"span",
|
|
528
539
|
{
|
|
529
|
-
className: `text-[11px] tabular-nums ${
|
|
540
|
+
className: `text-[11px] tabular-nums ${O(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
530
541
|
children: new Date(t.due_date).toLocaleDateString(void 0, {
|
|
531
542
|
timeZone: "UTC"
|
|
532
543
|
})
|
|
@@ -551,7 +562,7 @@ function mt({
|
|
|
551
562
|
}
|
|
552
563
|
),
|
|
553
564
|
waiting: () => {
|
|
554
|
-
const t = a.requested ?? [], b = t.filter((o) =>
|
|
565
|
+
const t = a.requested ?? [], b = t.filter((o) => O(o.due_date)).length;
|
|
555
566
|
return /* @__PURE__ */ d(
|
|
556
567
|
"section",
|
|
557
568
|
{
|
|
@@ -569,18 +580,18 @@ function mt({
|
|
|
569
580
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
|
|
570
581
|
] }),
|
|
571
582
|
t.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You are not waiting on anyone." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: t.map((o) => {
|
|
572
|
-
const A =
|
|
583
|
+
const A = O(o.due_date), s = !!o.nudged_at && Date.now() - new Date(o.nudged_at).getTime() < 20 * 36e5;
|
|
573
584
|
return /* @__PURE__ */ d(
|
|
574
585
|
"li",
|
|
575
586
|
{
|
|
576
|
-
className: M("flex items-center gap-2.5 px-4 py-2",
|
|
587
|
+
className: M("flex items-center gap-2.5 px-4 py-2", v(`r:${o.id}`)),
|
|
577
588
|
"data-my-work-requested": o.id,
|
|
578
589
|
children: [
|
|
579
590
|
/* @__PURE__ */ d(
|
|
580
591
|
"button",
|
|
581
592
|
{
|
|
582
593
|
type: "button",
|
|
583
|
-
onClick: () => o.kind === "support" ? U(o.id) :
|
|
594
|
+
onClick: () => o.kind === "support" ? U(o.id) : _(o.collection, o.item),
|
|
584
595
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
585
596
|
children: [
|
|
586
597
|
o.title,
|
|
@@ -640,10 +651,10 @@ function mt({
|
|
|
640
651
|
a.notifications.length === 0 ? /* @__PURE__ */ e("p", { className: "px-4 py-5 text-center text-[12.5px] text-muted-foreground", children: "You're all caught up." }) : /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: a.notifications.map((t) => /* @__PURE__ */ d(
|
|
641
652
|
"li",
|
|
642
653
|
{
|
|
643
|
-
className: M("flex items-start gap-2.5 px-4 py-2",
|
|
654
|
+
className: M("flex items-start gap-2.5 px-4 py-2", v(`n:${t.id}`)),
|
|
644
655
|
children: [
|
|
645
656
|
/* @__PURE__ */ e(
|
|
646
|
-
|
|
657
|
+
Ie,
|
|
647
658
|
{
|
|
648
659
|
userId: t.sender,
|
|
649
660
|
className: "mt-0.5 h-5 w-5",
|
|
@@ -654,7 +665,7 @@ function mt({
|
|
|
654
665
|
"button",
|
|
655
666
|
{
|
|
656
667
|
type: "button",
|
|
657
|
-
onClick: () =>
|
|
668
|
+
onClick: () => _(t.collection, t.item),
|
|
658
669
|
className: oe(t.collection, t.item) ? "min-w-0 flex-1 cursor-pointer text-left hover:opacity-80" : "min-w-0 flex-1 cursor-default text-left",
|
|
659
670
|
children: [
|
|
660
671
|
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
|
|
@@ -694,11 +705,11 @@ function mt({
|
|
|
694
705
|
}
|
|
695
706
|
return l;
|
|
696
707
|
})(),
|
|
697
|
-
/* @__PURE__ */ e(
|
|
708
|
+
/* @__PURE__ */ e(Pe, {})
|
|
698
709
|
] });
|
|
699
710
|
}
|
|
700
|
-
function
|
|
701
|
-
const i =
|
|
711
|
+
function Pe() {
|
|
712
|
+
const i = Te(), { rooms: u } = je(i);
|
|
702
713
|
return !i || u.length === 0 ? null : /* @__PURE__ */ d(
|
|
703
714
|
"section",
|
|
704
715
|
{
|
|
@@ -731,5 +742,5 @@ function Ke() {
|
|
|
731
742
|
);
|
|
732
743
|
}
|
|
733
744
|
export {
|
|
734
|
-
|
|
745
|
+
ut as MyWorkView
|
|
735
746
|
};
|