@nivaro/react 0.3.36 → 0.3.37
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/components/slots/CommentsSlot.js +44 -36
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/shared/components/AgentBadge.js +26 -0
- package/dist/shared/components/AgentQuestionsCard.js +198 -0
- package/dist/shared/components/ItemEditForm.js +3329 -3263
- package/dist/shared/components/McpConnectionScope.js +480 -0
- package/dist/shared/components/MyWorkView.js +223 -208
- package/dist/shared/components/RecordReadView.js +620 -575
- package/dist/shared/components/chat/ChatPanel.js +683 -671
- package/dist/shared/components/imports/DownloadSampleButton.js +69 -0
- package/dist/shared/components/imports/ImportConsole.js +106 -104
- package/dist/shared/components/imports/RunDetailSheet.js +11 -10
- package/dist/shared/components/item-edit/FieldAffordances.js +32 -32
- package/dist/shared/components/item-edit/FormTour.js +279 -0
- package/dist/shared/components/item-edit/GroupSection.js +377 -360
- package/dist/shared/components/item-edit/PersonalDefaultControl.js +28 -28
- package/dist/shared/components/item-edit/entry/EntryStrip.js +30 -26
- package/dist/shared/components/item-edit/form-density.js +36 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -46
- package/dist/shared/components/item-edit/usePersonalDefaults.js +312 -296
- package/dist/shared/components/layout-editor/AddPanel.js +349 -192
- package/dist/shared/components/layout-editor/DesignNode.js +126 -112
- package/dist/shared/components/layout-editor/EditorTopBar.js +123 -103
- package/dist/shared/components/layout-editor/LayoutEditor.js +829 -751
- package/dist/shared/components/layout-editor/PlaceTools.js +334 -0
- package/dist/shared/components/layout-editor/SlashInsert.js +252 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +285 -242
- package/dist/shared/components/layout-editor/add-target.js +54 -43
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +238 -155
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +1 -1
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +15 -12
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +347 -189
- package/dist/shared/components/layout-editor/dnd/TrashZone.js +60 -32
- package/dist/shared/components/layout-editor/dnd/UndoChip.js +76 -0
- package/dist/shared/components/layout-editor/dnd/merge-drop.js +33 -0
- package/dist/shared/components/layout-editor/dnd/multi-drop.js +87 -0
- package/dist/shared/components/layout-editor/dnd/node.js +115 -105
- package/dist/shared/components/layout-editor/dnd/sensors.js +23 -0
- package/dist/shared/components/layout-editor/dnd/trash-drop.js +34 -28
- package/dist/shared/components/layout-editor/dnd/trash-links.js +97 -0
- package/dist/shared/components/layout-editor/even-row.js +86 -0
- package/dist/shared/components/layout-editor/field-list.js +99 -0
- package/dist/shared/components/layout-editor/format-painter.js +102 -0
- package/dist/shared/components/layout-editor/grid-guides.js +15 -13
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +150 -132
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +57 -53
- package/dist/shared/components/layout-editor/inspector/EvenRowAction.js +31 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +154 -141
- package/dist/shared/components/layout-editor/inspector/Inspector.js +209 -178
- package/dist/shared/components/layout-editor/inspector/LookTab.js +106 -98
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +38 -37
- package/dist/shared/components/layout-editor/inspector/kit.js +280 -223
- package/dist/shared/components/layout-editor/keyboard-move.js +15 -15
- package/dist/shared/components/layout-editor/lint/LabelStyle.js +201 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +132 -84
- package/dist/shared/components/layout-editor/lint/lint-api.js +65 -28
- package/dist/shared/components/layout-editor/nav/NavTools.js +14 -12
- package/dist/shared/components/layout-editor/nav/ZoomControls.js +145 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +34 -32
- package/dist/shared/components/layout-editor/nav/view-prefs.js +100 -15
- package/dist/shared/components/layout-editor/outputs/LayoutFile.js +89 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +272 -195
- package/dist/shared/components/layout-editor/outputs/layout-file-plan.js +176 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +71 -37
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +16 -11
- package/dist/shared/components/layout-editor/overview/purpose.js +5 -5
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/pin.js +37 -19
- package/dist/shared/components/layout-editor/place-clip.js +257 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +27 -26
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +148 -117
- package/dist/shared/components/layout-editor/preview/SampleRecord.js +113 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +79 -60
- package/dist/shared/components/layout-editor/preview/sample-record.js +105 -0
- package/dist/shared/components/layout-editor/removed-log.js +151 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +109 -78
- package/dist/shared/components/layout-editor/reuse/linked-sections.js +373 -0
- package/dist/shared/components/layout-editor/revert-element.js +140 -0
- package/dist/shared/components/layout-editor/section-structure.js +193 -170
- package/dist/shared/components/layout-editor/settings/EntrySection.js +63 -45
- package/dist/shared/components/layout-editor/settings/LayoutSection.js +63 -32
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +179 -137
- package/dist/shared/components/layout-editor/settings/WhoSection.js +18 -17
- package/dist/shared/components/layout-editor/settings/settings-registry.js +24 -0
- package/dist/shared/components/layout-editor/shortcuts.js +21 -16
- package/dist/shared/components/layout-editor/structure-ops.js +221 -195
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +133 -85
- package/dist/shared/components/layout-editor/usage/refusal-lens.js +130 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +12 -11
- package/dist/shared/components/panels/CommentPanel.js +47 -45
- package/dist/shared/components/panels/RevisionsPanel.js +66 -64
- package/dist/shared/components/panels/TaskPanel.js +395 -332
- package/dist/shared/components/profile/AgentsPanel.js +196 -147
- package/dist/shared/components/profile/ConnectionRollback.js +329 -0
- package/dist/shared/components/profile/MyDefaultsCard.js +526 -520
- package/dist/shared/lib/entry-config.js +22 -22
- package/dist/shared/lib/form-usage-beacon.js +91 -55
- package/dist/shared/lib/layout-lint.js +530 -284
- package/dist/shared/lib/layout-resolve.js +58 -44
- package/package.json +1 -1
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useQueryClient as se, useQuery as oe, useMutation as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as se, useQuery as oe, useMutation as I } from "@tanstack/react-query";
|
|
3
|
+
import { Bot as ie } from "lucide-react";
|
|
4
|
+
import { useState as N, useRef as L, useEffect as E, useMemo as le } from "react";
|
|
5
|
+
import { useApiFetchConfig as ce, useItemNavigation as me, useNavigation as ue } from "../context.js";
|
|
6
|
+
import { useLiveEvent as pe } from "../lib/live.js";
|
|
7
|
+
import { useLiveOps as be, useFreshIds as xe } from "../lib/live-ops.js";
|
|
8
|
+
import { resolveNotificationTarget as Z, runNotificationTarget as he } from "../lib/notification-target.js";
|
|
9
|
+
import { useOptionalRealtime as ge } from "../lib/realtime.js";
|
|
10
|
+
import { userErrorMessage as fe } from "../lib/safe-error.js";
|
|
11
|
+
import { withinDay as G, slaChip as ke } from "../lib/sla-chip.js";
|
|
11
12
|
import { cn as A } from "../lib/utils.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
13
|
+
import { AgentQuestionsCard as ye } from "./AgentQuestionsCard.js";
|
|
14
|
+
import { FirstWeekCard as Ne } from "./ai/FirstWeekCard.js";
|
|
15
|
+
import { TaskDoButton as we } from "./ai/TaskDo.js";
|
|
16
|
+
import { openChatRoom as ve, canOpenChatRoom as _e } from "./chat/chat-core.js";
|
|
17
|
+
import { useMyRecordRooms as Ce } from "./chat/chat-hooks.js";
|
|
18
|
+
import { LearningPathCard as $e } from "./help-videos/viewer/LearningPathCard.js";
|
|
19
|
+
import { RequiredVideosCard as Se } from "./help-videos/viewer/RequiredVideosCard.js";
|
|
20
|
+
import { TickerNumber as Te } from "./TickerNumber.js";
|
|
21
|
+
import { UserAvatar as je } from "./UserAvatar.js";
|
|
22
|
+
const Ae = 8e3, X = ["records", "tasks", "team", "waiting", "notifications"], Me = {
|
|
21
23
|
records: "Waiting on you",
|
|
22
24
|
tasks: "My tasks",
|
|
23
25
|
team: "Team tasks",
|
|
24
26
|
waiting: "Waiting on others",
|
|
25
27
|
notifications: "Notifications"
|
|
26
|
-
},
|
|
28
|
+
}, qe = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), M = (l) => !!l && String(l).slice(0, 10) < qe(), Oe = {
|
|
27
29
|
alert: "bg-red-500/10 text-red-600 dark:text-red-400",
|
|
28
30
|
warn: "bg-amber-400/15 text-amber-700 dark:text-amber-400",
|
|
29
31
|
neutral: "bg-slate-500/10 text-slate-600 dark:text-slate-400",
|
|
30
32
|
ok: "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"
|
|
31
33
|
};
|
|
32
|
-
function
|
|
33
|
-
const c =
|
|
34
|
+
function De({ sla: l }) {
|
|
35
|
+
const c = ke(l);
|
|
34
36
|
return c ? /* @__PURE__ */ e(
|
|
35
37
|
"span",
|
|
36
38
|
{
|
|
37
39
|
"data-sla-chip": c.tone,
|
|
38
|
-
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${
|
|
40
|
+
className: `rounded px-1.5 py-0.5 text-[10px] font-semibold tabular-nums ${Oe[c.tone]}`,
|
|
39
41
|
children: c.label
|
|
40
42
|
}
|
|
41
43
|
) : null;
|
|
42
44
|
}
|
|
43
|
-
function
|
|
45
|
+
function Fe({ state: l, color: c }) {
|
|
44
46
|
return l ? /* @__PURE__ */ e(
|
|
45
47
|
"span",
|
|
46
48
|
{
|
|
@@ -53,162 +55,162 @@ function De({ state: l, color: c }) {
|
|
|
53
55
|
}
|
|
54
56
|
) : null;
|
|
55
57
|
}
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
+
function q({ label: l, value: c, tone: u }) {
|
|
59
|
+
return /* @__PURE__ */ d("div", { className: "rounded-lg border border-slate-200 bg-white p-3 dark:border-border dark:bg-card", children: [
|
|
58
60
|
/* @__PURE__ */ e("p", { className: "text-[10.5px] uppercase tracking-wide text-muted-foreground", children: l }),
|
|
59
|
-
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(
|
|
61
|
+
/* @__PURE__ */ e("p", { className: `mt-0.5 text-[18px] font-semibold tabular-nums ${u ?? ""}`, children: /* @__PURE__ */ e(Te, { value: c }) })
|
|
60
62
|
] });
|
|
61
63
|
}
|
|
62
|
-
function
|
|
64
|
+
function nt({
|
|
63
65
|
notificationRoutes: l,
|
|
64
66
|
onOpenPath: c
|
|
65
67
|
} = {}) {
|
|
66
|
-
const { apiBase: u, authHeaders: w, credentials: v } =
|
|
68
|
+
const { apiBase: u, authHeaders: w, credentials: v } = ce(), { open: W } = me(), _ = ue(), h = se(), U = (r) => {
|
|
67
69
|
var b, i;
|
|
68
|
-
const
|
|
69
|
-
c ? c(
|
|
70
|
-
},
|
|
70
|
+
const n = ((b = l == null ? void 0 : l.support) == null ? void 0 : b.call(l, String(r))) ?? ((i = _.consoleUrl) == null ? void 0 : i.call(_, `/support?ticket=${r}`)) ?? `/support?ticket=${r}`;
|
|
71
|
+
c ? c(n) : _.navigate(n);
|
|
72
|
+
}, O = ge(), [R, C] = N(!1), [x, ee] = N(() => {
|
|
71
73
|
try {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
const
|
|
75
|
-
if (Array.isArray(
|
|
74
|
+
const r = localStorage.getItem("nvr_mywork_sections");
|
|
75
|
+
if (r) {
|
|
76
|
+
const n = JSON.parse(r);
|
|
77
|
+
if (Array.isArray(n == null ? void 0 : n.order) && Array.isArray(n == null ? void 0 : n.hidden)) {
|
|
76
78
|
const b = X.map((i, m) => ({
|
|
77
79
|
k: i,
|
|
78
|
-
at:
|
|
80
|
+
at: n.order.indexOf(i) >= 0 ? n.order.indexOf(i) : m - 0.5
|
|
79
81
|
})).sort((i, m) => i.at - m.at).map((i) => i.k);
|
|
80
|
-
return { order: b, hidden:
|
|
82
|
+
return { order: b, hidden: n.hidden.filter((i) => b.includes(i)) };
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
} catch {
|
|
84
86
|
}
|
|
85
87
|
return { order: [...X], hidden: [] };
|
|
86
|
-
}), K = (
|
|
87
|
-
ee(
|
|
88
|
+
}), K = (r) => {
|
|
89
|
+
ee(r);
|
|
88
90
|
try {
|
|
89
|
-
localStorage.setItem("nvr_mywork_sections", JSON.stringify(
|
|
91
|
+
localStorage.setItem("nvr_mywork_sections", JSON.stringify(r));
|
|
90
92
|
} catch {
|
|
91
93
|
}
|
|
92
|
-
}, [te, re] = N(!1),
|
|
94
|
+
}, [te, re] = N(!1), Q = L(0), [$, ae] = N("all"), { data: a, isLoading: ne, refetch: P, isFetching: B } = oe({
|
|
93
95
|
queryKey: ["my-work"],
|
|
94
96
|
queryFn: async () => {
|
|
95
|
-
const
|
|
96
|
-
if (!
|
|
97
|
-
return (await
|
|
97
|
+
const r = await fetch(`${u}/my-work`, { headers: w, credentials: v });
|
|
98
|
+
if (!r.ok) throw new Error("my-work failed");
|
|
99
|
+
return (await r.json()).data;
|
|
98
100
|
},
|
|
99
101
|
staleTime: 6e4
|
|
100
|
-
}), z =
|
|
101
|
-
const
|
|
102
|
+
}), z = L(0), g = L(null), H = () => {
|
|
103
|
+
const r = () => {
|
|
102
104
|
g.current = null, z.current = Date.now(), C(!1), h.invalidateQueries({ queryKey: ["my-work"] });
|
|
103
|
-
},
|
|
104
|
-
g.current || (
|
|
105
|
+
}, n = z.current + Ae - Date.now();
|
|
106
|
+
g.current || (n <= 0 ? r() : g.current = setTimeout(r, n));
|
|
105
107
|
};
|
|
106
|
-
|
|
108
|
+
be("my-work", H, { debounceMs: 1500 }), pe("notification:new", H, { debounceMs: 1500 }), E(
|
|
107
109
|
() => () => {
|
|
108
110
|
g.current && clearTimeout(g.current);
|
|
109
111
|
},
|
|
110
112
|
[]
|
|
111
113
|
);
|
|
112
|
-
const
|
|
113
|
-
...((a == null ? void 0 : a.owned) ?? []).map((
|
|
114
|
-
...((a == null ? void 0 : a.tasks) ?? []).map((
|
|
115
|
-
...((a == null ? void 0 : a.team_tasks) ?? []).map((
|
|
116
|
-
...((a == null ? void 0 : a.requested) ?? []).map((
|
|
117
|
-
...((a == null ? void 0 : a.notifications) ?? []).map((
|
|
118
|
-
]), f = (
|
|
119
|
-
const
|
|
120
|
-
for (const
|
|
121
|
-
return [...
|
|
114
|
+
const J = xe([
|
|
115
|
+
...((a == null ? void 0 : a.owned) ?? []).map((r) => `o:${r.collection}:${r.item}`),
|
|
116
|
+
...((a == null ? void 0 : a.tasks) ?? []).map((r) => `t:${r.id}`),
|
|
117
|
+
...((a == null ? void 0 : a.team_tasks) ?? []).map((r) => `tt:${r.id}`),
|
|
118
|
+
...((a == null ? void 0 : a.requested) ?? []).map((r) => `r:${r.id}`),
|
|
119
|
+
...((a == null ? void 0 : a.notifications) ?? []).map((r) => `n:${r.id}`)
|
|
120
|
+
]), f = (r) => J.has(r) ? "bg-nvr-cyan/10 transition-colors duration-700" : "transition-colors duration-700", D = le(() => {
|
|
121
|
+
const r = /* @__PURE__ */ new Set();
|
|
122
|
+
for (const n of (a == null ? void 0 : a.owned) ?? []) n.collection && r.add(n.collection);
|
|
123
|
+
return [...r];
|
|
122
124
|
}, [a]);
|
|
123
125
|
E(() => {
|
|
124
|
-
if (!(!
|
|
125
|
-
return
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
if (!(!O || D.length === 0))
|
|
127
|
+
return O.subscribeCollections(D, () => {
|
|
128
|
+
const r = Date.now();
|
|
129
|
+
r - Q.current < 3e4 || (Q.current = r, C(!0));
|
|
128
130
|
});
|
|
129
|
-
}, [
|
|
130
|
-
const V =
|
|
131
|
+
}, [O, D]);
|
|
132
|
+
const V = I({
|
|
131
133
|
// A ticket closes through /support so its requester hears about it.
|
|
132
|
-
mutationFn: (
|
|
134
|
+
mutationFn: (r) => fetch(`${u}/${r.kind === "support" ? "support/tickets" : "tasks"}/${r.id}`, {
|
|
133
135
|
method: "PATCH",
|
|
134
136
|
headers: { ...w, "content-type": "application/json" },
|
|
135
137
|
credentials: v,
|
|
136
138
|
body: JSON.stringify({ status: "done" })
|
|
137
139
|
}),
|
|
138
140
|
onSuccess: () => h.invalidateQueries({ queryKey: ["my-work"] })
|
|
139
|
-
}), S =
|
|
140
|
-
mutationFn: async ({ id:
|
|
141
|
-
const b = await fetch(`${u}/tasks/${
|
|
141
|
+
}), S = I({
|
|
142
|
+
mutationFn: async ({ id: r, action: n }) => {
|
|
143
|
+
const b = await fetch(`${u}/tasks/${r}/${n}`, {
|
|
142
144
|
method: "POST",
|
|
143
145
|
headers: { ...w, "content-type": "application/json" },
|
|
144
146
|
credentials: v,
|
|
145
147
|
body: "{}"
|
|
146
148
|
}), i = await b.json().catch(() => ({}));
|
|
147
149
|
if (!b.ok) throw new Error(i.error ?? "Failed");
|
|
148
|
-
return
|
|
150
|
+
return n;
|
|
149
151
|
},
|
|
150
|
-
onSuccess: (
|
|
151
|
-
|
|
152
|
+
onSuccess: (r) => {
|
|
153
|
+
F(r === "claim" ? "It’s yours — it moved to My tasks." : "Reminder sent."), h.invalidateQueries({ queryKey: ["my-work"] });
|
|
152
154
|
},
|
|
153
|
-
onError: (
|
|
154
|
-
}), [T,
|
|
155
|
+
onError: (r) => F(fe(r, "Failed"))
|
|
156
|
+
}), [T, F] = N(null);
|
|
155
157
|
E(() => {
|
|
156
158
|
if (!T) return;
|
|
157
|
-
const
|
|
158
|
-
return () => clearTimeout(
|
|
159
|
+
const r = setTimeout(() => F(null), 4e3);
|
|
160
|
+
return () => clearTimeout(r);
|
|
159
161
|
}, [T]);
|
|
160
|
-
const Y =
|
|
161
|
-
mutationFn: (
|
|
162
|
+
const Y = I({
|
|
163
|
+
mutationFn: (r) => fetch(`${u}/notifications/mark-read`, {
|
|
162
164
|
method: "POST",
|
|
163
165
|
headers: { ...w, "content-type": "application/json" },
|
|
164
166
|
credentials: v,
|
|
165
|
-
body: JSON.stringify({ ids:
|
|
167
|
+
body: JSON.stringify({ ids: r })
|
|
166
168
|
}),
|
|
167
169
|
onSuccess: () => {
|
|
168
170
|
h.invalidateQueries({ queryKey: ["my-work"] }), h.invalidateQueries({ queryKey: ["notifications"] });
|
|
169
171
|
}
|
|
170
|
-
}), k = (
|
|
172
|
+
}), k = (r, n) => {
|
|
171
173
|
const b = {
|
|
172
|
-
record: (m,
|
|
174
|
+
record: (m, t) => (W({ collection: m, itemId: t }), null),
|
|
173
175
|
...l
|
|
174
|
-
}, i = Z(
|
|
176
|
+
}, i = Z(r, n, {
|
|
175
177
|
...b,
|
|
176
|
-
record: (m,
|
|
178
|
+
record: (m, t) => {
|
|
177
179
|
var p;
|
|
178
|
-
return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m,
|
|
180
|
+
return ((p = l == null ? void 0 : l.record) == null ? void 0 : p.call(l, m, t)) ?? null;
|
|
179
181
|
}
|
|
180
182
|
});
|
|
181
183
|
if (i) {
|
|
182
|
-
|
|
184
|
+
he(i, (m) => c == null ? void 0 : c(m));
|
|
183
185
|
return;
|
|
184
186
|
}
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
+
r && n && !/^nivaro_/i.test(r) && r !== "__chat__" && W({ collection: r, itemId: n });
|
|
188
|
+
}, de = (r, n) => r && n && !/^nivaro_/i.test(r) && r !== "__chat__" ? !0 : !!Z(r, n, {
|
|
187
189
|
record: () => null,
|
|
188
190
|
...l
|
|
189
191
|
});
|
|
190
|
-
return
|
|
191
|
-
/* @__PURE__ */ e(
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
/* @__PURE__ */ e(
|
|
192
|
+
return ne || !a ? /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-3 p-6", children: [1, 2, 3, 4].map((r) => /* @__PURE__ */ e("div", { className: "h-16 animate-pulse rounded-lg bg-[hsl(var(--nvr-skeleton))]" }, r)) }) : /* @__PURE__ */ d("div", { className: "space-y-5 p-6", "data-my-work": !0, children: [
|
|
193
|
+
/* @__PURE__ */ e(Ne, { onOpenPath: c }),
|
|
194
|
+
/* @__PURE__ */ d("div", { className: "flex items-start justify-between", children: [
|
|
195
|
+
/* @__PURE__ */ d("div", { className: "grid flex-1 grid-cols-2 gap-3 lg:grid-cols-4", children: [
|
|
196
|
+
/* @__PURE__ */ e(q, { label: "Waiting on you", value: a.counts.owned }),
|
|
195
197
|
/* @__PURE__ */ e(
|
|
196
|
-
|
|
198
|
+
q,
|
|
197
199
|
{
|
|
198
200
|
label: "SLA breached",
|
|
199
201
|
value: a.counts.owned_breached,
|
|
200
202
|
tone: a.counts.owned_breached > 0 ? "text-red-600 dark:text-red-400" : ""
|
|
201
203
|
}
|
|
202
204
|
),
|
|
203
|
-
/* @__PURE__ */ e(
|
|
204
|
-
/* @__PURE__ */ e(
|
|
205
|
+
/* @__PURE__ */ e(q, { label: "Open tasks", value: a.counts.tasks }),
|
|
206
|
+
/* @__PURE__ */ e(q, { label: "Unread notifications", value: a.counts.notifications })
|
|
205
207
|
] }),
|
|
206
|
-
R && /* @__PURE__ */
|
|
208
|
+
R && /* @__PURE__ */ d(
|
|
207
209
|
"button",
|
|
208
210
|
{
|
|
209
211
|
type: "button",
|
|
210
212
|
onClick: () => {
|
|
211
|
-
C(!1),
|
|
213
|
+
C(!1), P();
|
|
212
214
|
},
|
|
213
215
|
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]",
|
|
214
216
|
children: [
|
|
@@ -222,38 +224,38 @@ function et({
|
|
|
222
224
|
{
|
|
223
225
|
type: "button",
|
|
224
226
|
onClick: () => {
|
|
225
|
-
C(!1),
|
|
227
|
+
C(!1), P();
|
|
226
228
|
},
|
|
227
229
|
disabled: B,
|
|
228
230
|
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",
|
|
229
231
|
children: B ? "Refreshing…" : "Refresh"
|
|
230
232
|
}
|
|
231
233
|
),
|
|
232
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ d("div", { className: "relative ml-2", children: [
|
|
233
235
|
/* @__PURE__ */ e(
|
|
234
236
|
"button",
|
|
235
237
|
{
|
|
236
238
|
type: "button",
|
|
237
|
-
onClick: () => re((
|
|
239
|
+
onClick: () => re((r) => !r),
|
|
238
240
|
className: "rounded-md border border-slate-200 px-2.5 py-1.5 text-[12px] hover:bg-muted dark:border-border",
|
|
239
241
|
children: "Customize"
|
|
240
242
|
}
|
|
241
243
|
),
|
|
242
|
-
te && /* @__PURE__ */
|
|
244
|
+
te && /* @__PURE__ */ d("div", { className: "absolute right-0 top-full z-20 mt-1 w-56 rounded-lg border border-slate-200 bg-white p-2 shadow-lg dark:border-border dark:bg-card", children: [
|
|
243
245
|
/* @__PURE__ */ e("p", { className: "px-1 pb-1.5 text-[11px] font-semibold text-slate-500", children: "Sections" }),
|
|
244
|
-
x.order.map((
|
|
245
|
-
const b =
|
|
246
|
-
const p = [...x.order],
|
|
247
|
-
|
|
246
|
+
x.order.map((r, n) => {
|
|
247
|
+
const b = Me[r] ?? r, i = x.hidden.includes(r), m = (t) => {
|
|
248
|
+
const p = [...x.order], s = n + t;
|
|
249
|
+
s < 0 || s >= p.length || ([p[n], p[s]] = [p[s], p[n]], K({ ...x, order: p }));
|
|
248
250
|
};
|
|
249
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center gap-1 rounded px-1 py-1 hover:bg-muted", children: [
|
|
250
252
|
/* @__PURE__ */ e(
|
|
251
253
|
"button",
|
|
252
254
|
{
|
|
253
255
|
type: "button",
|
|
254
256
|
onClick: () => K({
|
|
255
257
|
...x,
|
|
256
|
-
hidden: i ? x.hidden.filter((
|
|
258
|
+
hidden: i ? x.hidden.filter((t) => t !== r) : [...x.hidden, r]
|
|
257
259
|
}),
|
|
258
260
|
className: "flex h-4 w-4 items-center justify-center rounded border border-slate-300 text-[10px] dark:border-border",
|
|
259
261
|
title: i ? "Show section" : "Hide section",
|
|
@@ -272,7 +274,7 @@ function et({
|
|
|
272
274
|
{
|
|
273
275
|
type: "button",
|
|
274
276
|
onClick: () => m(-1),
|
|
275
|
-
disabled:
|
|
277
|
+
disabled: n === 0,
|
|
276
278
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
277
279
|
children: "↑"
|
|
278
280
|
}
|
|
@@ -282,12 +284,12 @@ function et({
|
|
|
282
284
|
{
|
|
283
285
|
type: "button",
|
|
284
286
|
onClick: () => m(1),
|
|
285
|
-
disabled:
|
|
287
|
+
disabled: n === x.order.length - 1,
|
|
286
288
|
className: "px-1 text-[11px] text-slate-400 hover:text-foreground disabled:opacity-30",
|
|
287
289
|
children: "↓"
|
|
288
290
|
}
|
|
289
291
|
)
|
|
290
|
-
] },
|
|
292
|
+
] }, r);
|
|
291
293
|
})
|
|
292
294
|
] })
|
|
293
295
|
] })
|
|
@@ -301,24 +303,25 @@ function et({
|
|
|
301
303
|
children: T
|
|
302
304
|
}
|
|
303
305
|
),
|
|
304
|
-
/* @__PURE__ */ e(
|
|
305
|
-
/* @__PURE__ */ e(
|
|
306
|
+
/* @__PURE__ */ e(ye, { questions: a.questions ?? [] }),
|
|
307
|
+
/* @__PURE__ */ e(Se, { className: "mb-4" }),
|
|
308
|
+
/* @__PURE__ */ e($e, { className: "mb-4" }),
|
|
306
309
|
(() => {
|
|
307
|
-
const
|
|
310
|
+
const r = {
|
|
308
311
|
records: () => {
|
|
309
|
-
const
|
|
312
|
+
const t = a.owned.filter((o) => G(o.sla)).length, p = a.owned.filter((o) => {
|
|
310
313
|
var y;
|
|
311
314
|
return ((y = o.sla) == null ? void 0 : y.status) === "breached";
|
|
312
|
-
}).length,
|
|
315
|
+
}).length, s = $ === "soon" ? a.owned.filter((o) => G(o.sla)) : $ === "breached" ? a.owned.filter((o) => {
|
|
313
316
|
var y;
|
|
314
317
|
return ((y = o.sla) == null ? void 0 : y.status) === "breached";
|
|
315
318
|
}) : a.owned, j = [
|
|
316
319
|
{ key: "all", label: `All (${a.owned.length})` },
|
|
317
|
-
{ key: "soon", label: `Warning within 24h (${
|
|
320
|
+
{ key: "soon", label: `Warning within 24h (${t})` },
|
|
318
321
|
{ key: "breached", label: `Breached (${p})` }
|
|
319
322
|
];
|
|
320
|
-
return /* @__PURE__ */
|
|
321
|
-
/* @__PURE__ */
|
|
323
|
+
return /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
324
|
+
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
322
325
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Waiting on you" }),
|
|
323
326
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Records whose current step resolves you as an owner — most urgent first." })
|
|
324
327
|
] }),
|
|
@@ -337,12 +340,12 @@ function et({
|
|
|
337
340
|
},
|
|
338
341
|
o.key
|
|
339
342
|
)) }) }),
|
|
340
|
-
|
|
343
|
+
s.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: s.map((o) => /* @__PURE__ */ e(
|
|
341
344
|
"li",
|
|
342
345
|
{
|
|
343
346
|
className: f(`o:${o.collection}:${o.item}`),
|
|
344
|
-
"data-my-work-fresh":
|
|
345
|
-
children: /* @__PURE__ */
|
|
347
|
+
"data-my-work-fresh": J.has(`o:${o.collection}:${o.item}`) || void 0,
|
|
348
|
+
children: /* @__PURE__ */ d(
|
|
346
349
|
"button",
|
|
347
350
|
{
|
|
348
351
|
type: "button",
|
|
@@ -351,8 +354,8 @@ function et({
|
|
|
351
354
|
children: [
|
|
352
355
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate text-[12.5px] font-medium", children: o.label }),
|
|
353
356
|
/* @__PURE__ */ e("span", { className: "hidden text-[11px] text-muted-foreground sm:inline", children: o.collection.replace(/_/g, " ") }),
|
|
354
|
-
/* @__PURE__ */ e(
|
|
355
|
-
/* @__PURE__ */ e(
|
|
357
|
+
/* @__PURE__ */ e(Fe, { state: o.state, color: o.state_color }),
|
|
358
|
+
/* @__PURE__ */ e(De, { sla: o.sla })
|
|
356
359
|
]
|
|
357
360
|
}
|
|
358
361
|
)
|
|
@@ -361,93 +364,105 @@ function et({
|
|
|
361
364
|
)) })
|
|
362
365
|
] });
|
|
363
366
|
},
|
|
364
|
-
tasks: () => /* @__PURE__ */
|
|
367
|
+
tasks: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
365
368
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "My tasks" }) }),
|
|
366
|
-
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((
|
|
369
|
+
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(
|
|
367
370
|
"li",
|
|
368
371
|
{
|
|
369
|
-
className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${
|
|
372
|
+
className: A("flex items-center gap-2.5 px-4 py-2", f(`t:${t.id}`)),
|
|
370
373
|
children: [
|
|
371
374
|
/* @__PURE__ */ e(
|
|
372
375
|
"button",
|
|
373
376
|
{
|
|
374
377
|
type: "button",
|
|
375
378
|
title: "Mark done",
|
|
376
|
-
onClick: () => V.mutate(
|
|
379
|
+
onClick: () => V.mutate(t),
|
|
377
380
|
disabled: V.isPending,
|
|
378
381
|
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded border border-slate-300 text-transparent hover:border-emerald-500 hover:text-emerald-500 dark:border-border",
|
|
379
382
|
children: "✓"
|
|
380
383
|
}
|
|
381
384
|
),
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
+
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" }),
|
|
386
|
+
t.kind === "support" && /* @__PURE__ */ e("span", { className: "shrink-0 rounded bg-slate-100 px-1 py-px text-[9.5px] font-semibold uppercase tracking-wide text-slate-600 dark:bg-white/10 dark:text-slate-300", children: "support" }),
|
|
387
|
+
t.agent_assignee && /* @__PURE__ */ d(
|
|
388
|
+
"span",
|
|
389
|
+
{
|
|
390
|
+
className: "inline-flex shrink-0 items-center gap-1 rounded bg-nvr-cyan/10 px-1 py-px text-[10px] font-medium text-[#0e7490] dark:text-[#67e8f9]",
|
|
391
|
+
"data-tip": `Handed to ${t.agent_name ?? "your agent"} — it picks this up through My Work`,
|
|
392
|
+
"data-my-work-agent-task": t.id,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ e(ie, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
395
|
+
t.agent_name ?? "Agent"
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
),
|
|
399
|
+
/* @__PURE__ */ d(
|
|
385
400
|
"button",
|
|
386
401
|
{
|
|
387
402
|
type: "button",
|
|
388
|
-
onClick: () =>
|
|
403
|
+
onClick: () => t.kind === "support" ? U(t.id) : k(t.collection, t.item),
|
|
389
404
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
390
405
|
children: [
|
|
391
|
-
|
|
392
|
-
|
|
406
|
+
t.title,
|
|
407
|
+
t.item_label && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: t.item_label })
|
|
393
408
|
]
|
|
394
409
|
}
|
|
395
410
|
),
|
|
396
411
|
/* @__PURE__ */ e(
|
|
397
|
-
|
|
412
|
+
we,
|
|
398
413
|
{
|
|
399
|
-
task:
|
|
414
|
+
task: t,
|
|
400
415
|
isAssignee: !0,
|
|
401
416
|
compact: !0,
|
|
402
417
|
onTaskChanged: () => void h.invalidateQueries({ queryKey: ["my-work"] })
|
|
403
418
|
}
|
|
404
419
|
),
|
|
405
|
-
|
|
420
|
+
t.due_date && /* @__PURE__ */ e(
|
|
406
421
|
"span",
|
|
407
422
|
{
|
|
408
|
-
className: `text-[11px] tabular-nums ${M(
|
|
409
|
-
children: new Date(
|
|
423
|
+
className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
424
|
+
children: new Date(t.due_date).toLocaleDateString(void 0, { timeZone: "UTC" })
|
|
410
425
|
}
|
|
411
426
|
)
|
|
412
427
|
]
|
|
413
428
|
},
|
|
414
|
-
|
|
429
|
+
t.id
|
|
415
430
|
)) })
|
|
416
431
|
] }),
|
|
417
|
-
team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */
|
|
432
|
+
team: () => !a.on_a_team && !(a.team_tasks ?? []).length ? null : /* @__PURE__ */ d(
|
|
418
433
|
"section",
|
|
419
434
|
{
|
|
420
435
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
421
436
|
"data-my-work-team": !0,
|
|
422
437
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
438
|
+
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
424
439
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Team tasks" }),
|
|
425
440
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Waiting with a team you are on — pick one up to make it yours." })
|
|
426
441
|
] }),
|
|
427
|
-
(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((
|
|
442
|
+
(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(
|
|
428
443
|
"li",
|
|
429
444
|
{
|
|
430
|
-
className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${
|
|
431
|
-
"data-my-work-team-task":
|
|
445
|
+
className: A("flex items-center gap-2.5 px-4 py-2", f(`tt:${t.id}`)),
|
|
446
|
+
"data-my-work-team-task": t.id,
|
|
432
447
|
children: [
|
|
433
|
-
|
|
434
|
-
/* @__PURE__ */
|
|
448
|
+
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" }),
|
|
449
|
+
/* @__PURE__ */ d(
|
|
435
450
|
"button",
|
|
436
451
|
{
|
|
437
452
|
type: "button",
|
|
438
|
-
onClick: () => k(
|
|
453
|
+
onClick: () => k(t.collection, t.item),
|
|
439
454
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
440
455
|
children: [
|
|
441
|
-
|
|
442
|
-
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
|
|
456
|
+
t.title,
|
|
457
|
+
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [t.team_name, t.item_label].filter(Boolean).join(" · ") })
|
|
443
458
|
]
|
|
444
459
|
}
|
|
445
460
|
),
|
|
446
|
-
|
|
461
|
+
t.due_date && /* @__PURE__ */ e(
|
|
447
462
|
"span",
|
|
448
463
|
{
|
|
449
|
-
className: `text-[11px] tabular-nums ${M(
|
|
450
|
-
children: new Date(
|
|
464
|
+
className: `text-[11px] tabular-nums ${M(t.due_date) ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
465
|
+
children: new Date(t.due_date).toLocaleDateString(void 0, {
|
|
451
466
|
timeZone: "UTC"
|
|
452
467
|
})
|
|
453
468
|
}
|
|
@@ -456,129 +471,129 @@ function et({
|
|
|
456
471
|
"button",
|
|
457
472
|
{
|
|
458
473
|
type: "button",
|
|
459
|
-
onClick: () => S.mutate({ id:
|
|
474
|
+
onClick: () => S.mutate({ id: t.id, action: "claim" }),
|
|
460
475
|
disabled: S.isPending,
|
|
461
476
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted dark:border-border",
|
|
462
|
-
"data-my-work-claim":
|
|
477
|
+
"data-my-work-claim": t.id,
|
|
463
478
|
children: "Pick it up"
|
|
464
479
|
}
|
|
465
480
|
)
|
|
466
481
|
]
|
|
467
482
|
},
|
|
468
|
-
|
|
483
|
+
t.id
|
|
469
484
|
)) })
|
|
470
485
|
]
|
|
471
486
|
}
|
|
472
487
|
),
|
|
473
488
|
waiting: () => {
|
|
474
|
-
const
|
|
475
|
-
return /* @__PURE__ */
|
|
489
|
+
const t = a.requested ?? [], p = t.filter((s) => M(s.due_date)).length;
|
|
490
|
+
return /* @__PURE__ */ d(
|
|
476
491
|
"section",
|
|
477
492
|
{
|
|
478
493
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
479
494
|
"data-my-work-waiting": !0,
|
|
480
495
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ d("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
497
|
+
/* @__PURE__ */ d("h2", { className: "text-[13px] font-medium", children: [
|
|
483
498
|
"Waiting on others",
|
|
484
|
-
p > 0 && /* @__PURE__ */
|
|
499
|
+
p > 0 && /* @__PURE__ */ d("span", { className: "ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10.5px] font-semibold text-red-600 dark:text-red-400", children: [
|
|
485
500
|
p,
|
|
486
501
|
" overdue"
|
|
487
502
|
] })
|
|
488
503
|
] }),
|
|
489
504
|
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: "Tasks you asked someone else to do." })
|
|
490
505
|
] }),
|
|
491
|
-
|
|
492
|
-
const j = M(
|
|
493
|
-
return /* @__PURE__ */
|
|
506
|
+
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((s) => {
|
|
507
|
+
const j = M(s.due_date), o = !!s.nudged_at && Date.now() - new Date(s.nudged_at).getTime() < 20 * 36e5;
|
|
508
|
+
return /* @__PURE__ */ d(
|
|
494
509
|
"li",
|
|
495
510
|
{
|
|
496
|
-
className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${
|
|
497
|
-
"data-my-work-requested":
|
|
511
|
+
className: A("flex items-center gap-2.5 px-4 py-2", f(`r:${s.id}`)),
|
|
512
|
+
"data-my-work-requested": s.id,
|
|
498
513
|
children: [
|
|
499
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ d(
|
|
500
515
|
"button",
|
|
501
516
|
{
|
|
502
517
|
type: "button",
|
|
503
|
-
onClick: () =>
|
|
518
|
+
onClick: () => s.kind === "support" ? U(s.id) : k(s.collection, s.item),
|
|
504
519
|
className: "min-w-0 flex-1 truncate text-left text-[12.5px] hover:underline",
|
|
505
520
|
children: [
|
|
506
|
-
|
|
521
|
+
s.title,
|
|
507
522
|
/* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-muted-foreground", children: [
|
|
508
|
-
|
|
509
|
-
|
|
523
|
+
s.assignee_name ?? (s.team_name ? `${s.team_name} team` : "Unassigned"),
|
|
524
|
+
s.item_label
|
|
510
525
|
].filter(Boolean).join(" · ") })
|
|
511
526
|
]
|
|
512
527
|
}
|
|
513
528
|
),
|
|
514
|
-
|
|
529
|
+
s.due_date && /* @__PURE__ */ d(
|
|
515
530
|
"span",
|
|
516
531
|
{
|
|
517
532
|
className: `text-[11px] tabular-nums ${j ? "font-medium text-red-600 dark:text-red-400" : "text-muted-foreground"}`,
|
|
518
533
|
children: [
|
|
519
534
|
j ? "Overdue · " : "",
|
|
520
|
-
new Date(
|
|
535
|
+
new Date(s.due_date).toLocaleDateString(void 0, {
|
|
521
536
|
timeZone: "UTC"
|
|
522
537
|
})
|
|
523
538
|
]
|
|
524
539
|
}
|
|
525
540
|
),
|
|
526
|
-
|
|
541
|
+
s.kind !== "support" && /* @__PURE__ */ e(
|
|
527
542
|
"button",
|
|
528
543
|
{
|
|
529
544
|
type: "button",
|
|
530
|
-
onClick: () => S.mutate({ id:
|
|
545
|
+
onClick: () => S.mutate({ id: s.id, action: "nudge" }),
|
|
531
546
|
disabled: S.isPending || o,
|
|
532
547
|
title: o ? "Already nudged today" : "Send a reminder",
|
|
533
548
|
className: "shrink-0 rounded-md border border-slate-200 px-2 py-0.5 text-[11px] font-medium hover:bg-muted disabled:opacity-50 dark:border-border",
|
|
534
|
-
"data-my-work-nudge":
|
|
549
|
+
"data-my-work-nudge": s.id,
|
|
535
550
|
children: o ? "Nudged" : "Nudge"
|
|
536
551
|
}
|
|
537
552
|
)
|
|
538
553
|
]
|
|
539
554
|
},
|
|
540
|
-
|
|
555
|
+
s.id
|
|
541
556
|
);
|
|
542
557
|
}) })
|
|
543
558
|
]
|
|
544
559
|
}
|
|
545
560
|
);
|
|
546
561
|
},
|
|
547
|
-
notifications: () => /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
562
|
+
notifications: () => /* @__PURE__ */ d("section", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
|
|
563
|
+
/* @__PURE__ */ d("div", { className: "flex items-center justify-between border-b border-slate-200 px-4 py-2.5 dark:border-border", children: [
|
|
549
564
|
/* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Unread notifications" }),
|
|
550
565
|
a.notifications.length > 0 && /* @__PURE__ */ e(
|
|
551
566
|
"button",
|
|
552
567
|
{
|
|
553
568
|
type: "button",
|
|
554
|
-
onClick: () => Y.mutate(a.notifications.map((
|
|
569
|
+
onClick: () => Y.mutate(a.notifications.map((t) => t.id)),
|
|
555
570
|
className: "text-[11px] text-[#00a5cc] hover:underline",
|
|
556
571
|
children: "Mark all read"
|
|
557
572
|
}
|
|
558
573
|
)
|
|
559
574
|
] }),
|
|
560
|
-
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((
|
|
575
|
+
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(
|
|
561
576
|
"li",
|
|
562
577
|
{
|
|
563
|
-
className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${
|
|
578
|
+
className: A("flex items-start gap-2.5 px-4 py-2", f(`n:${t.id}`)),
|
|
564
579
|
children: [
|
|
565
580
|
/* @__PURE__ */ e(
|
|
566
|
-
|
|
581
|
+
je,
|
|
567
582
|
{
|
|
568
|
-
userId:
|
|
583
|
+
userId: t.sender,
|
|
569
584
|
className: "mt-0.5 h-5 w-5",
|
|
570
585
|
fallback: /* @__PURE__ */ e("span", { className: "mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-slate-100 text-[9px] font-semibold text-slate-500 dark:bg-muted" })
|
|
571
586
|
}
|
|
572
587
|
),
|
|
573
|
-
/* @__PURE__ */
|
|
588
|
+
/* @__PURE__ */ d(
|
|
574
589
|
"button",
|
|
575
590
|
{
|
|
576
591
|
type: "button",
|
|
577
|
-
onClick: () => k(
|
|
578
|
-
className:
|
|
592
|
+
onClick: () => k(t.collection, t.item),
|
|
593
|
+
className: de(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",
|
|
579
594
|
children: [
|
|
580
|
-
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children:
|
|
581
|
-
|
|
595
|
+
/* @__PURE__ */ e("p", { className: "truncate text-[12.5px] font-medium", children: t.subject }),
|
|
596
|
+
t.message && /* @__PURE__ */ e("p", { className: "truncate text-[11.5px] text-muted-foreground", children: t.message })
|
|
582
597
|
]
|
|
583
598
|
}
|
|
584
599
|
),
|
|
@@ -587,56 +602,56 @@ function et({
|
|
|
587
602
|
{
|
|
588
603
|
type: "button",
|
|
589
604
|
title: "Mark read",
|
|
590
|
-
onClick: () => Y.mutate([
|
|
605
|
+
onClick: () => Y.mutate([t.id]),
|
|
591
606
|
className: "text-[11px] text-muted-foreground hover:text-foreground",
|
|
592
607
|
children: "✓"
|
|
593
608
|
}
|
|
594
609
|
)
|
|
595
610
|
]
|
|
596
611
|
},
|
|
597
|
-
|
|
612
|
+
t.id
|
|
598
613
|
)) })
|
|
599
614
|
] })
|
|
600
|
-
},
|
|
601
|
-
x.order.filter((
|
|
602
|
-
), b = [...
|
|
615
|
+
}, n = new Map(
|
|
616
|
+
x.order.filter((t) => !x.hidden.includes(t) && r[t]).map((t) => [t, r[t]()]).filter(([, t]) => t != null)
|
|
617
|
+
), b = [...n.keys()], i = [];
|
|
603
618
|
let m = 0;
|
|
604
619
|
for (; m < b.length; ) {
|
|
605
|
-
const
|
|
606
|
-
if (
|
|
607
|
-
i.push(/* @__PURE__ */ e("div", { children:
|
|
620
|
+
const t = b[m];
|
|
621
|
+
if (t === "records")
|
|
622
|
+
i.push(/* @__PURE__ */ e("div", { children: n.get(t) }, t)), m++;
|
|
608
623
|
else {
|
|
609
|
-
const p = [
|
|
624
|
+
const p = [t];
|
|
610
625
|
m + 1 < b.length && b[m + 1] !== "records" && p.push(b[m + 1]), i.push(
|
|
611
|
-
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: p.map((
|
|
626
|
+
/* @__PURE__ */ e("div", { className: "grid gap-5 lg:grid-cols-2", children: p.map((s) => /* @__PURE__ */ e("div", { children: n.get(s) }, s)) }, p.join("+"))
|
|
612
627
|
), m += p.length;
|
|
613
628
|
}
|
|
614
629
|
}
|
|
615
630
|
return i;
|
|
616
631
|
})(),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(Ie, {})
|
|
618
633
|
] });
|
|
619
634
|
}
|
|
620
|
-
function
|
|
621
|
-
const l =
|
|
622
|
-
return !l || c.length === 0 ? null : /* @__PURE__ */
|
|
635
|
+
function Ie() {
|
|
636
|
+
const l = _e(), { rooms: c } = Ce(l);
|
|
637
|
+
return !l || c.length === 0 ? null : /* @__PURE__ */ d(
|
|
623
638
|
"section",
|
|
624
639
|
{
|
|
625
640
|
className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card",
|
|
626
641
|
"data-my-work-chat": !0,
|
|
627
642
|
children: [
|
|
628
643
|
/* @__PURE__ */ e("div", { className: "border-b border-slate-200 px-4 py-2.5 dark:border-border", children: /* @__PURE__ */ e("h2", { className: "text-[13px] font-medium", children: "Record conversations" }) }),
|
|
629
|
-
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 dark:divide-border/60", children: c.map((u) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ d(
|
|
630
645
|
"button",
|
|
631
646
|
{
|
|
632
647
|
type: "button",
|
|
633
|
-
onClick: () =>
|
|
648
|
+
onClick: () => ve(u.room, u.label),
|
|
634
649
|
className: "flex w-full items-center gap-2.5 px-4 py-2 text-left hover:bg-slate-50 dark:hover:bg-muted/40",
|
|
635
650
|
"data-my-work-chat-room": u.room,
|
|
636
651
|
children: [
|
|
637
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ d("span", { className: "min-w-0 flex-1", children: [
|
|
638
653
|
/* @__PURE__ */ e("span", { className: "block truncate text-[12.5px] font-medium", children: u.label }),
|
|
639
|
-
u.last_message && /* @__PURE__ */
|
|
654
|
+
u.last_message && /* @__PURE__ */ d("span", { className: "block truncate text-[11.5px] text-muted-foreground", children: [
|
|
640
655
|
u.last_message.sender_name ? `${u.last_message.sender_name}: ` : "",
|
|
641
656
|
u.last_message.message.replace(/@\[([^\]]+)\]/g, "@$1")
|
|
642
657
|
] })
|
|
@@ -651,5 +666,5 @@ function Fe() {
|
|
|
651
666
|
);
|
|
652
667
|
}
|
|
653
668
|
export {
|
|
654
|
-
|
|
669
|
+
nt as MyWorkView
|
|
655
670
|
};
|