@nivaro/react 0.3.139 → 0.3.140
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/InlineGridField.js +95 -92
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +36 -2
- package/dist/shared/components/AudienceConfirmPanel.js +19 -19
- package/dist/shared/components/BroadcastView.js +213 -211
- package/dist/shared/components/CollectionBrowserView.js +2677 -2658
- package/dist/shared/components/ConfigHistory.js +45 -45
- package/dist/shared/components/ConformanceView.js +110 -110
- package/dist/shared/components/DataTable.js +51 -51
- package/dist/shared/components/FilePreviewLightbox.js +26 -25
- package/dist/shared/components/ItemEditForm.js +3038 -3027
- package/dist/shared/components/LiveCount.js +27 -23
- package/dist/shared/components/LiveTraceView.js +62 -61
- package/dist/shared/components/PageRenderer.js +422 -410
- package/dist/shared/components/ProfileView.js +199 -199
- package/dist/shared/components/QualityRulesView.js +70 -70
- package/dist/shared/components/QueryTable.js +131 -130
- package/dist/shared/components/RecordGraph.js +98 -98
- package/dist/shared/components/RecordReadView.js +287 -288
- package/dist/shared/components/ReportView.js +1279 -1259
- package/dist/shared/components/SlaRulesView.js +73 -74
- package/dist/shared/components/WidgetSlot.js +73 -73
- package/dist/shared/components/ai/AiChart.js +36 -32
- package/dist/shared/components/ai/AiMarkdown.js +136 -129
- package/dist/shared/components/ai/TaskDo.js +87 -87
- package/dist/shared/components/ai/answer-formats.js +37 -30
- package/dist/shared/components/ai/call-log/format.js +17 -16
- package/dist/shared/components/bulk/BulkActionButtons.js +66 -66
- package/dist/shared/components/bulk/BulkFieldUpdate.js +59 -59
- package/dist/shared/components/bulk/BulkSelectionNotices.js +34 -34
- package/dist/shared/components/bulk/MessageStakeholders.js +31 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +83 -82
- package/dist/shared/components/bulk/bulk-field-options.js +10 -10
- package/dist/shared/components/cbv/column-totals.js +53 -51
- package/dist/shared/components/chat/ChatAnalyticsView.js +87 -87
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +18 -18
- package/dist/shared/components/command-center/announce.js +7 -6
- package/dist/shared/components/command-center/panels/AttentionPanel.js +32 -31
- package/dist/shared/components/command-center/panels/FlowPanel.js +29 -28
- package/dist/shared/components/command-center/panels/PeoplePanel.js +39 -39
- package/dist/shared/components/delegation/DelegationConsoleView.js +27 -27
- package/dist/shared/components/imports/RunDetailSheet.js +1 -1
- package/dist/shared/components/integrations/IntegrationObligationsView.js +119 -119
- package/dist/shared/components/integrations/console/EventsView.js +35 -35
- package/dist/shared/components/integrations/console/FirefightView.js +15 -14
- package/dist/shared/components/integrations/console/PartnerDetail.js +78 -78
- package/dist/shared/components/integrations/console/ReadyToSendView.js +103 -103
- package/dist/shared/components/integrations/console/SignalCard.js +67 -67
- package/dist/shared/components/item-edit/CatalogPickerField.js +536 -527
- package/dist/shared/components/item-edit/ChangesTray.js +88 -74
- package/dist/shared/components/item-edit/FilePickerField.js +123 -123
- package/dist/shared/components/item-edit/GroupSection.js +301 -292
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +54 -54
- package/dist/shared/components/item-edit/InlineGridField.js +45 -36
- package/dist/shared/components/item-edit/InlineTableField.js +1167 -1153
- package/dist/shared/components/item-edit/NestedRelationEditor.js +106 -99
- package/dist/shared/components/item-edit/RecordChatMentionsChip.js +11 -11
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +43 -44
- package/dist/shared/components/monitoring/ApiRequestLog.js +35 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +268 -268
- package/dist/shared/components/ops-report/format.js +37 -36
- package/dist/shared/components/panels/ReferencedByPanel.js +21 -20
- package/dist/shared/components/panels/RevisionsPanel.js +306 -305
- package/dist/shared/components/pipeline/OwnerMatrixVersionsCard.js +12 -12
- package/dist/shared/components/pipeline/PipelineEditorView.js +483 -482
- package/dist/shared/components/pipeline/PipelineHealthCards.js +33 -32
- package/dist/shared/components/pipeline/TeamsView.js +189 -130
- package/dist/shared/components/profile/AgentsPanel.js +6 -6
- package/dist/shared/components/profile/DelegationCard.js +13 -12
- package/dist/shared/components/profile/PersonActivity.js +48 -48
- package/dist/shared/components/profile/PersonExtras.js +107 -107
- package/dist/shared/components/profile/PersonWeek.js +9 -9
- package/dist/shared/components/queue/QueueBulkBar.js +19 -18
- package/dist/shared/components/queue/QueueBulkMove.js +21 -20
- package/dist/shared/components/queue/QueueItemSheet.js +136 -131
- package/dist/shared/components/queue/QueueWorklist.js +671 -670
- package/dist/shared/components/queue/worklist-helpers.js +36 -21
- package/dist/shared/components/support/RequestList.js +121 -121
- package/dist/shared/components/support/SupportAnalytics.js +29 -29
- package/dist/shared/lib/activity-sentence.js +251 -229
- package/dist/shared/lib/format-value.js +5 -4
- package/dist/shared/lib/number-format.js +87 -0
- package/dist/shared/lib/number-kind.js +133 -0
- package/dist/shared/lib/utils.js +24 -20
- package/dist/shared/lib/watch-list.js +1 -1
- package/dist/shared/lib/widget-value-format.js +26 -12
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { Search as j, Rows3 as K, LayoutGrid as T } from "lucide-react";
|
|
3
3
|
import { useRef as L, useEffect as $ } from "react";
|
|
4
|
-
import { cn as c } from "../../lib/utils.js";
|
|
5
|
-
import { Input as
|
|
4
|
+
import { formatNumber as z, cn as c } from "../../lib/utils.js";
|
|
5
|
+
import { Input as B } from "../ui/input.js";
|
|
6
6
|
import { Switch as S } from "../ui/switch.js";
|
|
7
|
-
const
|
|
7
|
+
const G = [
|
|
8
8
|
{ key: "folders", label: "Folders" },
|
|
9
9
|
{ key: "az", label: "A–Z" },
|
|
10
10
|
{ key: "recent", label: "Recently changed", adminOnly: !0 },
|
|
11
11
|
{ key: "records", label: "Most records", adminOnly: !0 },
|
|
12
12
|
{ key: "used", label: "Most used by you" }
|
|
13
|
-
],
|
|
13
|
+
], P = [
|
|
14
14
|
{ key: "has_records", label: "Has records", stat: !0 },
|
|
15
15
|
{ key: "empty", label: "Empty", stat: !0 },
|
|
16
16
|
{ key: "hidden", label: "Hidden" },
|
|
@@ -19,8 +19,8 @@ const B = [
|
|
|
19
19
|
{ key: "singleton", label: "Singleton" },
|
|
20
20
|
{ key: "pipeline", label: "Has pipeline", stat: !0 },
|
|
21
21
|
{ key: "form", label: "Has form", stat: !0 }
|
|
22
|
-
], d = "inline-flex h-7 items-center gap-1.5 rounded-md px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan", h = "text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/10",
|
|
23
|
-
function
|
|
22
|
+
], d = "inline-flex h-7 items-center gap-1.5 rounded-md px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan", h = "text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/10", u = "bg-nvr-cyan/10 text-cyan-700 dark:bg-nvr-cyan/15 dark:text-nvr-cyan";
|
|
23
|
+
function ee({
|
|
24
24
|
state: t,
|
|
25
25
|
onChange: i,
|
|
26
26
|
filter: H,
|
|
@@ -34,7 +34,7 @@ function Y({
|
|
|
34
34
|
adminActions: y,
|
|
35
35
|
title: A = "Collections",
|
|
36
36
|
canArrange: f = !0,
|
|
37
|
-
canSelect:
|
|
37
|
+
canSelect: x = !0
|
|
38
38
|
}) {
|
|
39
39
|
const E = L(null), w = L(null);
|
|
40
40
|
$(() => {
|
|
@@ -45,7 +45,7 @@ function Y({
|
|
|
45
45
|
}, [t.view]);
|
|
46
46
|
const I = (e) => {
|
|
47
47
|
E.current = e, typeof m == "function" ? m(e) : m && (m.current = e);
|
|
48
|
-
}, p =
|
|
48
|
+
}, p = G.filter((e) => b || !e.adminOnly), M = P.filter((e) => (b || !e.stat) && (s.chip[e.key] ?? 0) > 0), O = t.chips.length > 0, V = (e) => i({
|
|
49
49
|
...t,
|
|
50
50
|
chips: t.chips.includes(e) ? t.chips.filter((r) => r !== e) : [...t.chips, e]
|
|
51
51
|
}), v = (e) => i({ ...t, view: e }), N = (e) => i({ ...t, density: e }), W = (e, r) => {
|
|
@@ -75,12 +75,12 @@ function Y({
|
|
|
75
75
|
/* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2", children: [
|
|
76
76
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
77
77
|
/* @__PURE__ */ a("h1", { className: "text-[18px] font-semibold text-slate-900 dark:text-slate-100", children: A }),
|
|
78
|
-
/* @__PURE__ */ a("span", { className: "rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-semibold tabular-nums text-slate-500 dark:bg-white/10 dark:text-slate-400", children: s.total })
|
|
78
|
+
/* @__PURE__ */ a("span", { className: "rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-semibold tabular-nums text-slate-500 dark:bg-white/10 dark:text-slate-400", children: z(s.total) })
|
|
79
79
|
] }),
|
|
80
80
|
/* @__PURE__ */ l("div", { "data-cdr": "", className: "relative w-full md:[&[data-cdr]]:w-auto", children: [
|
|
81
81
|
/* @__PURE__ */ a(j, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
|
|
82
82
|
/* @__PURE__ */ a(
|
|
83
|
-
|
|
83
|
+
B,
|
|
84
84
|
{
|
|
85
85
|
ref: I,
|
|
86
86
|
value: H,
|
|
@@ -136,7 +136,7 @@ function Y({
|
|
|
136
136
|
"aria-label": "Compact density",
|
|
137
137
|
"data-tip": "Compact",
|
|
138
138
|
onClick: () => N("compact"),
|
|
139
|
-
className: c(d, "px-2", t.density === "compact" ?
|
|
139
|
+
className: c(d, "px-2", t.density === "compact" ? u : h),
|
|
140
140
|
children: /* @__PURE__ */ a(K, { className: "h-3.5 w-3.5" })
|
|
141
141
|
}
|
|
142
142
|
),
|
|
@@ -148,12 +148,12 @@ function Y({
|
|
|
148
148
|
"aria-label": "Comfortable density",
|
|
149
149
|
"data-tip": "Comfortable",
|
|
150
150
|
onClick: () => N("comfortable"),
|
|
151
|
-
className: c(d, "px-2", t.density === "comfortable" ?
|
|
151
|
+
className: c(d, "px-2", t.density === "comfortable" ? u : h),
|
|
152
152
|
children: /* @__PURE__ */ a(T, { className: "h-3.5 w-3.5" })
|
|
153
153
|
}
|
|
154
154
|
)
|
|
155
155
|
] }),
|
|
156
|
-
b && (y || f ||
|
|
156
|
+
b && (y || f || x) && /* @__PURE__ */ l("div", { className: "ml-auto flex items-center gap-1", children: [
|
|
157
157
|
y,
|
|
158
158
|
f && /* @__PURE__ */ a(
|
|
159
159
|
"button",
|
|
@@ -161,17 +161,17 @@ function Y({
|
|
|
161
161
|
type: "button",
|
|
162
162
|
"aria-pressed": t.arranging,
|
|
163
163
|
onClick: q,
|
|
164
|
-
className: c(d, t.arranging ?
|
|
164
|
+
className: c(d, t.arranging ? u : h),
|
|
165
165
|
children: t.arranging ? "Done arranging" : "Arrange"
|
|
166
166
|
}
|
|
167
167
|
),
|
|
168
|
-
|
|
168
|
+
x && /* @__PURE__ */ a(
|
|
169
169
|
"button",
|
|
170
170
|
{
|
|
171
171
|
type: "button",
|
|
172
172
|
"aria-pressed": t.selecting,
|
|
173
173
|
onClick: _,
|
|
174
|
-
className: c(d, t.selecting ?
|
|
174
|
+
className: c(d, t.selecting ? u : h),
|
|
175
175
|
children: "Select"
|
|
176
176
|
}
|
|
177
177
|
)
|
|
@@ -251,7 +251,7 @@ function Y({
|
|
|
251
251
|
)
|
|
252
252
|
] })
|
|
253
253
|
] }),
|
|
254
|
-
b &&
|
|
254
|
+
b && x && t.selecting && /* @__PURE__ */ l("div", { className: "mt-2 flex items-center gap-3 rounded-md bg-nvr-cyan/10 px-3 py-1.5 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
255
255
|
/* @__PURE__ */ l("span", { className: "font-medium tabular-nums", children: [
|
|
256
256
|
k,
|
|
257
257
|
" selected"
|
|
@@ -281,5 +281,5 @@ function Y({
|
|
|
281
281
|
);
|
|
282
282
|
}
|
|
283
283
|
export {
|
|
284
|
-
|
|
284
|
+
ee as CollectionsToolbar
|
|
285
285
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { formatNumber as e } from "../../lib/utils.js";
|
|
2
|
+
function o(n) {
|
|
2
3
|
return Array.isArray(n) ? n.length : n && typeof n == "object" && Array.isArray(n.items) ? n.items.length : null;
|
|
3
4
|
}
|
|
4
|
-
function
|
|
5
|
+
function u(n, t) {
|
|
5
6
|
if (n === null || t === null || n === t) return "";
|
|
6
7
|
if (t === 0) return "Nothing needs attention now.";
|
|
7
|
-
const
|
|
8
|
-
return t > n ? `${
|
|
8
|
+
const r = t === 1 ? "1 item needs attention" : `${e(t)} items need attention`;
|
|
9
|
+
return t > n ? `${r} — ${t - n} new.` : `${r}.`;
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
u as attentionAnnouncement,
|
|
13
|
+
o as attentionCount
|
|
13
14
|
};
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as o, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { AlertOctagon as N, AlertTriangle as b, Info as I } from "lucide-react";
|
|
3
3
|
import { useState as w } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
4
|
+
import { formatNumber as $ } from "../../../lib/utils.js";
|
|
5
|
+
import { useCcQuery as _ } from "../api.js";
|
|
6
|
+
import { useCc as m } from "../state.js";
|
|
7
|
+
import { PANEL as A, PANEL_HEAD as T, TITLE as E, FAINT as u, FOCUS as h, MUTED as p, BUTTON as C } from "../theme.js";
|
|
8
|
+
import { sinceShort as F, stateListUrl as L } from "../work-links.js";
|
|
9
|
+
import { NudgeForm as D, TransitionForm as S, ApproveForm as P, ReassignForm as O } from "./attention-actions.js";
|
|
10
|
+
const R = {
|
|
10
11
|
critical: { Icon: N, word: "Critical", tone: "text-[var(--cc-bad-text)]" },
|
|
11
12
|
warning: { Icon: b, word: "Warning", tone: "text-[var(--cc-warn-text)]" },
|
|
12
13
|
info: { Icon: I, word: "Info", tone: "text-[var(--cc-muted)]" }
|
|
13
14
|
}, k = 8;
|
|
14
|
-
function
|
|
15
|
-
const r =
|
|
15
|
+
function G() {
|
|
16
|
+
const r = m(), e = _("/attention", void 0, {
|
|
16
17
|
refetchInterval: 6e4,
|
|
17
18
|
live: !0
|
|
18
19
|
}), n = e.data ?? [], [s, i] = w(!1), c = s ? n : n.slice(0, k), d = n.length - c.length;
|
|
19
|
-
return /* @__PURE__ */ o("section", { className:
|
|
20
|
-
/* @__PURE__ */ o("div", { className:
|
|
21
|
-
/* @__PURE__ */ a("h2", { className:
|
|
20
|
+
return /* @__PURE__ */ o("section", { className: A, "data-cc-panel": "attention", "aria-busy": e.isLoading, children: [
|
|
21
|
+
/* @__PURE__ */ o("div", { className: T, children: [
|
|
22
|
+
/* @__PURE__ */ a("h2", { className: E, children: "Needs attention" }),
|
|
22
23
|
/* @__PURE__ */ a("span", { className: `text-[11px] tabular-nums ${u}`, children: r.at ? "Live — not rewound" : n.length > 0 ? n.length : "" })
|
|
23
24
|
] }),
|
|
24
|
-
/* @__PURE__ */ a(
|
|
25
|
-
/* @__PURE__ */ a("ul", { className: "divide-y divide-[var(--cc-border)]", children: c.map((l) => /* @__PURE__ */ a(
|
|
25
|
+
/* @__PURE__ */ a(H, {}),
|
|
26
|
+
/* @__PURE__ */ a("ul", { className: "divide-y divide-[var(--cc-border)]", children: c.map((l) => /* @__PURE__ */ a(U, { item: l }, l.id)) }),
|
|
26
27
|
(d > 0 || s) && n.length > k && /* @__PURE__ */ a("div", { className: "border-t border-[var(--cc-border)] px-3 py-2", children: r.kiosk || r.tv ? /* @__PURE__ */ o("span", { className: `text-[11.5px] ${u}`, children: [
|
|
27
28
|
"+",
|
|
28
29
|
d,
|
|
@@ -40,9 +41,9 @@ function Y() {
|
|
|
40
41
|
!e.isLoading && n.length === 0 && /* @__PURE__ */ a("p", { className: `px-3 py-3 text-[12px] ${u}`, children: e.isError ? "Could not load this list." : "Nothing needs attention right now." })
|
|
41
42
|
] });
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function H() {
|
|
44
45
|
var s;
|
|
45
|
-
const e = (s =
|
|
46
|
+
const e = (s = m().snapshot) == null ? void 0 : s.risk;
|
|
46
47
|
if (!e) return null;
|
|
47
48
|
const n = [];
|
|
48
49
|
return e.sla_breached != null && n.push({
|
|
@@ -63,14 +64,14 @@ function R() {
|
|
|
63
64
|
] }, i.key))
|
|
64
65
|
] });
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
const e =
|
|
67
|
+
function U({ item: r }) {
|
|
68
|
+
const e = m(), [n, s] = w(null), i = R[r.severity], c = F(r.since), d = r.list ? L(r.list.collection, {
|
|
68
69
|
state: r.list.state,
|
|
69
70
|
minAgeHours: r.list.min_age_hours
|
|
70
71
|
}) : null, l = () => {
|
|
71
72
|
r.record && !r.list ? e.setPeek(r.record) : d ? e.navigate(d) : r.href ? e.navigate(r.href) : r.record && e.setPeek(r.record);
|
|
72
|
-
},
|
|
73
|
-
var
|
|
73
|
+
}, g = !e.kiosk, y = (t) => {
|
|
74
|
+
var x, v;
|
|
74
75
|
if (t.kind === "open") {
|
|
75
76
|
t.href ? e.navigate(t.href) : t.target ? e.setPeek({ collection: t.target.collection, id: t.target.id }) : l();
|
|
76
77
|
return;
|
|
@@ -79,12 +80,12 @@ function H({ item: r }) {
|
|
|
79
80
|
if (t.kind === "nudge" && t.target) return s({ kind: "nudge", target: t.target });
|
|
80
81
|
if (t.kind === "transition" && t.target)
|
|
81
82
|
return s({ kind: "transition", target: t.target });
|
|
82
|
-
if (t.kind === "approve" && ((
|
|
83
|
+
if (t.kind === "approve" && ((x = t.target) == null ? void 0 : x.approval_id) != null)
|
|
83
84
|
return s({ kind: "approve", approvalId: t.target.approval_id });
|
|
84
85
|
if (t.kind === "reassign" && ((v = t.targets) != null && v.length))
|
|
85
86
|
return s({ kind: "reassign", targets: t.targets });
|
|
86
|
-
},
|
|
87
|
-
(t) => t.kind === "open" ||
|
|
87
|
+
}, f = r.actions.filter(
|
|
88
|
+
(t) => t.kind === "open" || g && (t.kind !== "alert" || e.isAdmin)
|
|
88
89
|
);
|
|
89
90
|
return /* @__PURE__ */ o("li", { className: "px-3 py-2", children: [
|
|
90
91
|
/* @__PURE__ */ o("div", { className: "flex items-start gap-2", children: [
|
|
@@ -111,28 +112,28 @@ function H({ item: r }) {
|
|
|
111
112
|
r.detail && /* @__PURE__ */ a("p", { className: `truncate text-[11.5px] ${p}`, children: r.detail })
|
|
112
113
|
] }),
|
|
113
114
|
/* @__PURE__ */ o("div", { className: "shrink-0 text-right text-[11px] tabular-nums", children: [
|
|
114
|
-
r.count != null && r.count > 1 && /* @__PURE__ */ a("div", { className: "font-semibold text-[var(--cc-text)]", children: r.count }),
|
|
115
|
+
r.count != null && r.count > 1 && /* @__PURE__ */ a("div", { className: "font-semibold text-[var(--cc-text)]", children: $(r.count) }),
|
|
115
116
|
c && /* @__PURE__ */ a("div", { className: u, "data-tip": "How long it has been like this", children: c })
|
|
116
117
|
] })
|
|
117
118
|
] }),
|
|
118
|
-
|
|
119
|
+
f.length > 0 && !n && /* @__PURE__ */ a("div", { className: "mt-1.5 flex flex-wrap gap-1.5 pl-[70px]", children: f.map((t) => /* @__PURE__ */ a(
|
|
119
120
|
"button",
|
|
120
121
|
{
|
|
121
122
|
type: "button",
|
|
122
123
|
onClick: () => y(t),
|
|
123
|
-
className: `${
|
|
124
|
+
className: `${C} py-0.5 ${h}`,
|
|
124
125
|
children: t.label
|
|
125
126
|
},
|
|
126
127
|
`${t.kind}:${t.label}`
|
|
127
128
|
)) }),
|
|
128
|
-
n &&
|
|
129
|
-
n.kind === "nudge" && /* @__PURE__ */ a(
|
|
130
|
-
n.kind === "transition" && /* @__PURE__ */ a(
|
|
131
|
-
n.kind === "approve" && /* @__PURE__ */ a(
|
|
132
|
-
n.kind === "reassign" && /* @__PURE__ */ a(
|
|
129
|
+
n && g && /* @__PURE__ */ o("div", { className: "mt-2 ml-[70px] rounded-md bg-[var(--cc-raised)] p-2", children: [
|
|
130
|
+
n.kind === "nudge" && /* @__PURE__ */ a(D, { target: n.target, onDone: () => s(null) }),
|
|
131
|
+
n.kind === "transition" && /* @__PURE__ */ a(S, { target: n.target, onDone: () => s(null) }),
|
|
132
|
+
n.kind === "approve" && /* @__PURE__ */ a(P, { approvalId: n.approvalId, onDone: () => s(null) }),
|
|
133
|
+
n.kind === "reassign" && /* @__PURE__ */ a(O, { targets: n.targets, onDone: () => s(null) })
|
|
133
134
|
] })
|
|
134
135
|
] });
|
|
135
136
|
}
|
|
136
137
|
export {
|
|
137
|
-
|
|
138
|
+
G as AttentionPanel
|
|
138
139
|
};
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { jsxs as o, jsx as n, Fragment as w } from "react/jsx-runtime";
|
|
2
|
-
import { Bell as y, ArrowRight as $, ArrowUpRight as
|
|
2
|
+
import { Bell as y, ArrowRight as $, ArrowUpRight as N, ArrowDownRight as k } from "lucide-react";
|
|
3
3
|
import { useState as f } from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import { formatNumber as A } from "../../../lib/utils.js";
|
|
5
|
+
import { useCcQuery as C } from "../api.js";
|
|
6
|
+
import { useCc as _ } from "../state.js";
|
|
7
|
+
import { PANEL as L, PANEL_HEAD as O, TITLE as M, FAINT as u, FOCUS as d, MUTED as v } from "../theme.js";
|
|
8
|
+
import { ageShort as g, ageWords as x, stateListUrl as F } from "../work-links.js";
|
|
9
|
+
const b = "#00a5cc";
|
|
10
|
+
function H() {
|
|
10
11
|
var i;
|
|
11
|
-
const t =
|
|
12
|
+
const t = _(), a = C("/flow", void 0, { refetchInterval: 6e4 }), c = a.data ?? (((i = t.snapshot) == null ? void 0 : i.flow) ?? []).map((l) => ({
|
|
12
13
|
collection: l.collection,
|
|
13
14
|
collection_label: l.collection,
|
|
14
15
|
template_name: l.template_name,
|
|
15
16
|
states: l.states.map((r) => ({ ...r, oldest_age_s: null, median_age_s: null, stuck: 0 })),
|
|
16
|
-
open: l.states.reduce((r,
|
|
17
|
+
open: l.states.reduce((r, p) => r + p.count, 0),
|
|
17
18
|
wip_7d_delta: null,
|
|
18
19
|
completed_7d: 0,
|
|
19
20
|
clears_in_days: null
|
|
20
|
-
})), s = c.some((l) => l.live_only),
|
|
21
|
-
return /* @__PURE__ */ o("section", { className:
|
|
22
|
-
/* @__PURE__ */ o("div", { className:
|
|
23
|
-
/* @__PURE__ */ n("h2", { className:
|
|
21
|
+
})), s = c.some((l) => l.live_only), m = !!t.region && c.length > 0 && c.every((l) => l.region_applies === !1);
|
|
22
|
+
return /* @__PURE__ */ o("section", { className: L, "data-cc-panel": "flow", "aria-busy": a.isLoading, children: [
|
|
23
|
+
/* @__PURE__ */ o("div", { className: O, children: [
|
|
24
|
+
/* @__PURE__ */ n("h2", { className: M, children: "Pipeline flow" }),
|
|
24
25
|
s && /* @__PURE__ */ n("span", { className: `text-[11px] ${u}`, children: "Live — can't rewind this" }),
|
|
25
|
-
!s &&
|
|
26
|
+
!s && m && /* @__PURE__ */ n("span", { className: `text-[11px] ${u}`, children: "Not placed in regions — showing everywhere" })
|
|
26
27
|
] }),
|
|
27
28
|
/* @__PURE__ */ o("div", { className: "space-y-4 p-3", children: [
|
|
28
|
-
c.map((l) => /* @__PURE__ */ n(
|
|
29
|
+
c.map((l) => /* @__PURE__ */ n(R, { f: l }, `${l.collection}:${l.template_name}`)),
|
|
29
30
|
c.length === 0 && !a.isLoading && /* @__PURE__ */ n("p", { className: `text-[12px] ${u}`, children: "No workflow-bound collections visible to you." })
|
|
30
31
|
] })
|
|
31
32
|
] });
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
var
|
|
35
|
-
const a =
|
|
34
|
+
function R({ f: t }) {
|
|
35
|
+
var p;
|
|
36
|
+
const a = _(), [c, s] = f(!1), m = Math.max(
|
|
36
37
|
1,
|
|
37
38
|
t.states.reduce((e, h) => e + h.count, 0)
|
|
38
|
-
), i = (e, h) => a.navigate(
|
|
39
|
+
), i = (e, h) => a.navigate(F(t.collection, { state: e, minAgeHours: h })), l = t.states.filter((e) => e.count > 0), r = ((p = a.config) == null ? void 0 : p.stuck_days) ?? 7;
|
|
39
40
|
return /* @__PURE__ */ o("div", { children: [
|
|
40
41
|
/* @__PURE__ */ o("div", { className: "mb-1 flex items-baseline justify-between gap-2", children: [
|
|
41
42
|
/* @__PURE__ */ n(
|
|
@@ -60,8 +61,8 @@ function F({ f: t }) {
|
|
|
60
61
|
onClick: () => i(e.key),
|
|
61
62
|
className: `h-full transition-opacity hover:opacity-75 ${d}`,
|
|
62
63
|
style: {
|
|
63
|
-
width: `${Math.max(2, e.count /
|
|
64
|
-
background: e.color ??
|
|
64
|
+
width: `${Math.max(2, e.count / m * 100)}%`,
|
|
65
|
+
background: e.color ?? b
|
|
65
66
|
},
|
|
66
67
|
"aria-label": `${e.label}: ${e.count} open. Open the list filtered to ${e.label}`,
|
|
67
68
|
"data-tip": `${e.label}: ${e.count} — open the list`
|
|
@@ -81,12 +82,12 @@ function F({ f: t }) {
|
|
|
81
82
|
"span",
|
|
82
83
|
{
|
|
83
84
|
className: "h-1.5 w-1.5 shrink-0 rounded-full",
|
|
84
|
-
style: { background: e.color ??
|
|
85
|
+
style: { background: e.color ?? b },
|
|
85
86
|
"aria-hidden": !0
|
|
86
87
|
}
|
|
87
88
|
),
|
|
88
89
|
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1 truncate text-[var(--cc-muted)]", children: e.label }),
|
|
89
|
-
/* @__PURE__ */ n("b", { className: "tabular-nums text-[var(--cc-text)]", children: e.count }),
|
|
90
|
+
/* @__PURE__ */ n("b", { className: "tabular-nums text-[var(--cc-text)]", children: A(e.count) }),
|
|
90
91
|
/* @__PURE__ */ n(
|
|
91
92
|
"span",
|
|
92
93
|
{
|
|
@@ -124,7 +125,7 @@ function F({ f: t }) {
|
|
|
124
125
|
) : null
|
|
125
126
|
] }, e.key)) }),
|
|
126
127
|
/* @__PURE__ */ o("div", { className: "mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px]", children: [
|
|
127
|
-
/* @__PURE__ */ n(
|
|
128
|
+
/* @__PURE__ */ n(E, { f: t }),
|
|
128
129
|
t.states.length > l.length && /* @__PURE__ */ n(
|
|
129
130
|
"button",
|
|
130
131
|
{
|
|
@@ -138,12 +139,12 @@ function F({ f: t }) {
|
|
|
138
139
|
] })
|
|
139
140
|
] });
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function E({ f: t }) {
|
|
142
143
|
const a = t.wip_7d_delta;
|
|
143
144
|
if (a == null && t.completed_7d === 0) return null;
|
|
144
|
-
const c = a != null && a > 0, s = a == null || a === 0 ? $ : c ?
|
|
145
|
+
const c = a != null && a > 0, s = a == null || a === 0 ? $ : c ? N : k, m = c ? "text-[var(--cc-warn-text)]" : "text-[var(--cc-muted)]";
|
|
145
146
|
return /* @__PURE__ */ o(w, { children: [
|
|
146
|
-
a != null && /* @__PURE__ */ o("span", { className: `flex items-center gap-0.5 ${
|
|
147
|
+
a != null && /* @__PURE__ */ o("span", { className: `flex items-center gap-0.5 ${m}`, children: [
|
|
147
148
|
/* @__PURE__ */ n(s, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
148
149
|
a === 0 ? "steady this week" : `${a > 0 ? "+" : "−"}${Math.abs(a)} open this week`
|
|
149
150
|
] }),
|
|
@@ -155,5 +156,5 @@ function R({ f: t }) {
|
|
|
155
156
|
] });
|
|
156
157
|
}
|
|
157
158
|
export {
|
|
158
|
-
|
|
159
|
+
H as FlowPanel
|
|
159
160
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as l, jsx as n, Fragment as
|
|
2
|
-
import { useMutation as
|
|
3
|
-
import { ChevronRight as
|
|
1
|
+
import { jsxs as l, jsx as n, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useMutation as C } from "@tanstack/react-query";
|
|
3
|
+
import { ChevronRight as k, LocateFixed as S, MessageSquare as M, Footprints as P } from "lucide-react";
|
|
4
4
|
import { useState as v } from "react";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { post as
|
|
8
|
-
import { toastError as
|
|
9
|
-
import { cn as i } from "../../../lib/utils.js";
|
|
10
|
-
import { UserChip as
|
|
5
|
+
import { toast as A } from "sonner";
|
|
6
|
+
import { useNivaroClient as T } from "../../../context.js";
|
|
7
|
+
import { post as E } from "../../../lib/commands.js";
|
|
8
|
+
import { toastError as F } from "../../../lib/error-toast.js";
|
|
9
|
+
import { cn as i, formatNumber as $ } from "../../../lib/utils.js";
|
|
10
|
+
import { UserChip as O } from "../../item-edit/UserChip.js";
|
|
11
11
|
import { useCc as N } from "../state.js";
|
|
12
|
-
import { PANEL as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
12
|
+
import { PANEL as I, PANEL_HEAD as L, TITLE as z, FAINT as f, FOCUS as m, BUTTON as _, MUTED as U } from "../theme.js";
|
|
13
|
+
const j = 50;
|
|
14
|
+
function te() {
|
|
15
15
|
const e = N(), t = e.snapshot, o = (t == null ? void 0 : t.people.regions) ?? [], [s, b] = v(/* @__PURE__ */ new Set()), u = (a) => `${a.region_id ?? "x"}:${a.label}`, d = (a) => b((c) => {
|
|
16
16
|
const p = new Set(c);
|
|
17
17
|
return p.has(a) ? p.delete(a) : p.add(a), p;
|
|
18
18
|
}), h = e.region && (t == null ? void 0 : t.people.region_applies) === !1;
|
|
19
|
-
return /* @__PURE__ */ l("section", { className:
|
|
20
|
-
/* @__PURE__ */ l("div", { className:
|
|
21
|
-
/* @__PURE__ */ n("h2", { id: "cc-people-title", className:
|
|
19
|
+
return /* @__PURE__ */ l("section", { className: I, "data-cc-panel": "people", "aria-labelledby": "cc-people-title", children: [
|
|
20
|
+
/* @__PURE__ */ l("div", { className: L, children: [
|
|
21
|
+
/* @__PURE__ */ n("h2", { id: "cc-people-title", className: z, children: "People on now" }),
|
|
22
22
|
/* @__PURE__ */ l("span", { className: `text-[11px] tabular-nums ${f}`, children: [
|
|
23
23
|
(t == null ? void 0 : t.people.online_count) ?? 0,
|
|
24
24
|
" online",
|
|
@@ -29,21 +29,21 @@ function ee() {
|
|
|
29
29
|
h && /* @__PURE__ */ n("p", { className: `px-1 pb-1 text-[11px] ${f}`, children: "People are not placed in regions here — showing everyone." }),
|
|
30
30
|
o.map((a) => {
|
|
31
31
|
const c = u(a);
|
|
32
|
-
return /* @__PURE__ */ n(
|
|
32
|
+
return /* @__PURE__ */ n(R, { group: a, expanded: s.has(c), onToggle: () => d(c) }, c);
|
|
33
33
|
}),
|
|
34
34
|
t && o.length === 0 && /* @__PURE__ */ n("p", { className: `px-1 text-[12px] ${f}`, children: "Nobody online right now." }),
|
|
35
35
|
!t && /* @__PURE__ */ n("p", { className: `px-1 text-[12px] ${f}`, children: "Loading…" })
|
|
36
36
|
] })
|
|
37
37
|
] });
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function R({
|
|
40
40
|
group: e,
|
|
41
41
|
expanded: t,
|
|
42
42
|
onToggle: o
|
|
43
43
|
}) {
|
|
44
44
|
var x, g;
|
|
45
|
-
const s = N(), [b, u] = v(!1), d = e.region_id != null ? (x = s.config) == null ? void 0 : x.regions.find((r) => String(r.id) === String(e.region_id)) : null, h = e.lat != null && e.lng != null ? { lat: e.lat, lng: e.lng, zoom: e.region_id != null ? 8 : 12 } : (d == null ? void 0 : d.lat) != null && d.lng != null ? { lat: d.lat, lng: d.lng, zoom: 8 } : null, a = e.people ?? e.names.map((r,
|
|
46
|
-
user_id: `${
|
|
45
|
+
const s = N(), [b, u] = v(!1), d = e.region_id != null ? (x = s.config) == null ? void 0 : x.regions.find((r) => String(r.id) === String(e.region_id)) : null, h = e.lat != null && e.lng != null ? { lat: e.lat, lng: e.lng, zoom: e.region_id != null ? 8 : 12 } : (d == null ? void 0 : d.lat) != null && d.lng != null ? { lat: d.lat, lng: d.lng, zoom: 8 } : null, a = e.people ?? e.names.map((r, w) => ({
|
|
46
|
+
user_id: `${w}`,
|
|
47
47
|
name: r,
|
|
48
48
|
idle: !1,
|
|
49
49
|
page_label: null,
|
|
@@ -64,7 +64,7 @@ function j({
|
|
|
64
64
|
),
|
|
65
65
|
children: [
|
|
66
66
|
/* @__PURE__ */ n(
|
|
67
|
-
|
|
67
|
+
k,
|
|
68
68
|
{
|
|
69
69
|
className: i(
|
|
70
70
|
"h-3.5 w-3.5 shrink-0 text-[var(--cc-faint)] motion-safe:transition-transform",
|
|
@@ -96,7 +96,7 @@ function j({
|
|
|
96
96
|
"rounded p-1 text-[var(--cc-faint)] hover:bg-[var(--cc-chip)] hover:text-[var(--cc-text)]",
|
|
97
97
|
m
|
|
98
98
|
),
|
|
99
|
-
children: /* @__PURE__ */ n(
|
|
99
|
+
children: /* @__PURE__ */ n(S, { className: "h-3.5 w-3.5" })
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
102
|
c && /* @__PURE__ */ n(
|
|
@@ -110,21 +110,21 @@ function j({
|
|
|
110
110
|
"rounded p-1 text-[var(--cc-faint)] hover:bg-[var(--cc-chip)] hover:text-[var(--cc-text)]",
|
|
111
111
|
m
|
|
112
112
|
),
|
|
113
|
-
children: /* @__PURE__ */ n(
|
|
113
|
+
children: /* @__PURE__ */ n(M, { className: "h-3.5 w-3.5" })
|
|
114
114
|
}
|
|
115
115
|
)
|
|
116
116
|
] }),
|
|
117
117
|
b && c && /* @__PURE__ */ n(
|
|
118
|
-
|
|
118
|
+
B,
|
|
119
119
|
{
|
|
120
120
|
label: e.label,
|
|
121
|
-
ids: (e.people ?? []).map((r) => r.user_id).slice(0,
|
|
121
|
+
ids: (e.people ?? []).map((r) => r.user_id).slice(0, j),
|
|
122
122
|
total: e.count,
|
|
123
123
|
onDone: () => u(!1)
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
126
|
t && /* @__PURE__ */ l("ul", { id: p, className: "mb-1 ml-5 mt-0.5 space-y-0.5", children: [
|
|
127
|
-
a.map((r) => /* @__PURE__ */ n(
|
|
127
|
+
a.map((r) => /* @__PURE__ */ n(q, { p: r, real: !!e.people }, r.user_id)),
|
|
128
128
|
e.count > a.length && /* @__PURE__ */ l("li", { className: `px-1 text-[11px] ${f}`, children: [
|
|
129
129
|
"and ",
|
|
130
130
|
e.count - a.length,
|
|
@@ -133,7 +133,7 @@ function j({
|
|
|
133
133
|
] })
|
|
134
134
|
] });
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function q({ p: e, real: t }) {
|
|
137
137
|
const o = N(), s = /* @__PURE__ */ n(
|
|
138
138
|
"button",
|
|
139
139
|
{
|
|
@@ -159,7 +159,7 @@ function R({ p: e, real: t }) {
|
|
|
159
159
|
),
|
|
160
160
|
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
161
161
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
162
|
-
t && !o.kiosk ? /* @__PURE__ */ n(
|
|
162
|
+
t && !o.kiosk ? /* @__PURE__ */ n(O, { userId: e.user_id, children: s }) : /* @__PURE__ */ n("span", { className: "truncate text-[12px] font-medium", children: e.name }),
|
|
163
163
|
/* @__PURE__ */ n("span", { className: `text-[10.5px] ${f}`, children: e.idle ? "idle" : "active" }),
|
|
164
164
|
t && o.isAdmin && !o.kiosk && /* @__PURE__ */ n(
|
|
165
165
|
"button",
|
|
@@ -172,11 +172,11 @@ function R({ p: e, real: t }) {
|
|
|
172
172
|
"ml-auto rounded p-0.5 text-[var(--cc-faint)] hover:bg-[var(--cc-chip)] hover:text-[var(--cc-text)]",
|
|
173
173
|
m
|
|
174
174
|
),
|
|
175
|
-
children: /* @__PURE__ */ n(
|
|
175
|
+
children: /* @__PURE__ */ n(P, { className: "h-3 w-3" })
|
|
176
176
|
}
|
|
177
177
|
)
|
|
178
178
|
] }),
|
|
179
|
-
(e.record || e.page_label) && /* @__PURE__ */ n("p", { className: `truncate text-[11px] ${
|
|
179
|
+
(e.record || e.page_label) && /* @__PURE__ */ n("p", { className: `truncate text-[11px] ${U}`, children: e.record ? /* @__PURE__ */ l(
|
|
180
180
|
"button",
|
|
181
181
|
{
|
|
182
182
|
type: "button",
|
|
@@ -188,30 +188,30 @@ function R({ p: e, real: t }) {
|
|
|
188
188
|
e.record.label
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
|
-
) : /* @__PURE__ */ l(
|
|
191
|
+
) : /* @__PURE__ */ l(y, { children: [
|
|
192
192
|
"On ",
|
|
193
193
|
e.page_label
|
|
194
194
|
] }) })
|
|
195
195
|
] })
|
|
196
196
|
] });
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function B({
|
|
199
199
|
label: e,
|
|
200
200
|
ids: t,
|
|
201
201
|
total: o,
|
|
202
202
|
onDone: s
|
|
203
203
|
}) {
|
|
204
|
-
const b =
|
|
204
|
+
const b = T(), [u, d] = v(""), [h, a] = v(!1), c = C({
|
|
205
205
|
mutationFn: () => b.request(
|
|
206
|
-
|
|
206
|
+
E("/command-center/people/message", { user_ids: t, message: u.trim() })
|
|
207
207
|
),
|
|
208
208
|
onSuccess: (x) => {
|
|
209
209
|
var r;
|
|
210
210
|
const g = ((r = x.data) == null ? void 0 : r.sent) ?? t.length;
|
|
211
|
-
|
|
211
|
+
A.success(`Sent to ${g} ${g === 1 ? "person" : "people"}`), s();
|
|
212
212
|
},
|
|
213
213
|
onError: (x) => {
|
|
214
|
-
a(!1),
|
|
214
|
+
a(!1), F(x, "Message not sent");
|
|
215
215
|
}
|
|
216
216
|
}), p = `cc-msg-${e.replace(/[^A-Za-z0-9_-]/g, "_")}`;
|
|
217
217
|
return /* @__PURE__ */ l("div", { className: "mb-1.5 ml-5 mt-1 space-y-1.5 rounded-md border border-[var(--cc-border)] p-2", children: [
|
|
@@ -223,7 +223,7 @@ function q({
|
|
|
223
223
|
" in",
|
|
224
224
|
" ",
|
|
225
225
|
e,
|
|
226
|
-
o > t.length ? ` (the first ${t.length} of ${o})` : ""
|
|
226
|
+
o > t.length ? ` (the first ${$(t.length)} of ${$(o)})` : ""
|
|
227
227
|
] }),
|
|
228
228
|
/* @__PURE__ */ n(
|
|
229
229
|
"textarea",
|
|
@@ -242,7 +242,7 @@ function q({
|
|
|
242
242
|
}
|
|
243
243
|
),
|
|
244
244
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
245
|
-
/* @__PURE__ */ n("button", { type: "button", onClick: s, className: i(
|
|
245
|
+
/* @__PURE__ */ n("button", { type: "button", onClick: s, className: i(_, m), children: "Cancel" }),
|
|
246
246
|
/* @__PURE__ */ n(
|
|
247
247
|
"button",
|
|
248
248
|
{
|
|
@@ -250,7 +250,7 @@ function q({
|
|
|
250
250
|
disabled: !u.trim() || c.isPending,
|
|
251
251
|
onClick: () => h ? c.mutate() : a(!0),
|
|
252
252
|
className: i(
|
|
253
|
-
|
|
253
|
+
_,
|
|
254
254
|
m,
|
|
255
255
|
h && "border-nvr-cyan bg-nvr-cyan text-white hover:bg-nvr-cyan"
|
|
256
256
|
),
|
|
@@ -261,5 +261,5 @@ function q({
|
|
|
261
261
|
] });
|
|
262
262
|
}
|
|
263
263
|
export {
|
|
264
|
-
|
|
264
|
+
te as PeoplePanel
|
|
265
265
|
};
|