@nivaro/react 0.3.127 → 0.3.129
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 +124 -95
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +29 -3
- package/dist/index.js +150 -147
- package/dist/shared/components/CollectionBrowserView.js +3259 -3211
- package/dist/shared/components/DataTable.js +406 -401
- package/dist/shared/components/ItemEditForm.js +4485 -4409
- package/dist/shared/components/MatrixEditor.js +548 -490
- package/dist/shared/components/MyWorkView.js +284 -274
- package/dist/shared/components/NotificationBell.js +264 -218
- package/dist/shared/components/RecordGridEditor.js +582 -472
- package/dist/shared/components/ai/AiMarkdown.js +215 -196
- package/dist/shared/components/chat/chat-core.js +331 -346
- package/dist/shared/components/chat/chat-typing.js +25 -0
- package/dist/shared/components/command-center/CommandCenterView.js +1 -1
- package/dist/shared/components/command-center/PeekPanel.js +8 -1
- package/dist/shared/components/command-center/api.js +17 -9
- package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
- package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
- package/dist/shared/components/item-edit/GroupSection.js +1 -1
- package/dist/shared/components/item-edit/HeaderTools.js +216 -210
- package/dist/shared/components/item-edit/InlineTableField.js +432 -429
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
- package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
- package/dist/shared/components/item-edit/RowComments.js +33 -30
- package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
- package/dist/shared/components/item-edit/live-related.js +29 -16
- package/dist/shared/components/item-edit/record-opened-live.js +86 -0
- package/dist/shared/components/panels/CommentPanel.js +345 -327
- package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
- package/dist/shared/components/queue/QueueItemSheet.js +171 -130
- package/dist/shared/components/record-grid-guard.js +85 -0
- package/dist/shared/components/support/TicketDetailSheet.js +213 -174
- package/dist/shared/components/trackers/MirroredText.js +40 -0
- package/dist/shared/components/trackers/SourceTracker.js +168 -0
- package/dist/shared/components/trackers/TrackerChip.js +71 -0
- package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
- package/dist/shared/components/trackers/TrackerPickers.js +245 -0
- package/dist/shared/components/trackers/tracker-model.js +126 -0
- package/dist/shared/components/trackers/use-tracker-link.js +159 -0
- package/dist/shared/lib/at-risk-fields.js +14 -0
- package/dist/shared/lib/live-queries.js +9 -8
- package/dist/shared/lib/live-screen.js +77 -76
- package/dist/shared/lib/presence-hooks.js +190 -127
- package/dist/shared/lib/user-sync.js +78 -65
- package/dist/shared/lib/waiting-count.js +40 -29
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs as u, jsx as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { Eye as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { get as
|
|
6
|
-
import { formatRelative as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as u, jsx as p, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as g } from "@tanstack/react-query";
|
|
3
|
+
import { Eye as x, EyeOff as y } from "lucide-react";
|
|
4
|
+
import { useNivaroClient as b } from "../../context.js";
|
|
5
|
+
import { get as v } from "../../lib/commands.js";
|
|
6
|
+
import { formatRelative as w, formatDateTime as d, cn as $ } from "../../lib/utils.js";
|
|
7
|
+
import { useRefreshOnRecordOpened as _ } from "../item-edit/record-opened-live.js";
|
|
8
|
+
import { UserChip as O } from "../item-edit/UserChip.js";
|
|
9
|
+
const f = "pipeline-owner-opened";
|
|
10
|
+
function N(e, r = w) {
|
|
10
11
|
var s, n, t;
|
|
11
12
|
if (e.status === "not_opened")
|
|
12
13
|
return {
|
|
@@ -24,34 +25,34 @@ function N(e, r = v) {
|
|
|
24
25
|
tail: ` opened this ${r(e.opened_at)}${i}`
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function C({
|
|
28
29
|
collection: e,
|
|
29
30
|
item: r,
|
|
30
31
|
stateId: i,
|
|
31
32
|
className: l
|
|
32
33
|
}) {
|
|
33
|
-
const s =
|
|
34
|
-
queryKey: [
|
|
34
|
+
const s = b(), { data: n } = g({
|
|
35
|
+
queryKey: [f, e, r, i],
|
|
35
36
|
queryFn: () => s.request(
|
|
36
|
-
|
|
37
|
-
).then((
|
|
37
|
+
v(`/pipelines/instance/${e}/${r}/owner-opened`)
|
|
38
|
+
).then((c) => c.data ?? null),
|
|
38
39
|
staleTime: 6e4,
|
|
39
40
|
retry: !1
|
|
40
41
|
});
|
|
41
|
-
if (!n || n.status !== "opened" && n.status !== "not_opened") return null;
|
|
42
|
+
if (_(e, r, [f, e, r]), !n || n.status !== "opened" && n.status !== "not_opened") return null;
|
|
42
43
|
const t = N(n);
|
|
43
44
|
if (!t) return null;
|
|
44
|
-
const o = n.status === "opened", m = o ?
|
|
45
|
+
const o = n.status === "opened", m = o ? x : y, a = o ? d(n.opened_at) : d(n.entered_at);
|
|
45
46
|
return /* @__PURE__ */ u(
|
|
46
47
|
"p",
|
|
47
48
|
{
|
|
48
49
|
"data-owner-opened": n.status,
|
|
49
|
-
className:
|
|
50
|
+
className: $(
|
|
50
51
|
"flex items-start gap-1.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400",
|
|
51
52
|
l
|
|
52
53
|
),
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ p(
|
|
55
56
|
m,
|
|
56
57
|
{
|
|
57
58
|
"aria-hidden": !0,
|
|
@@ -62,11 +63,11 @@ function A({
|
|
|
62
63
|
"span",
|
|
63
64
|
{
|
|
64
65
|
className: "min-w-0 text-left",
|
|
65
|
-
"data-tip": o ? `Opened ${
|
|
66
|
+
"data-tip": o ? `Opened ${a}` : `In this step since ${a}`,
|
|
66
67
|
children: [
|
|
67
68
|
t.lead,
|
|
68
|
-
o && n.by ? /* @__PURE__ */ u(
|
|
69
|
-
/* @__PURE__ */
|
|
69
|
+
o && n.by ? /* @__PURE__ */ u(h, { children: [
|
|
70
|
+
/* @__PURE__ */ p(O, { userId: n.by.id, children: /* @__PURE__ */ p(
|
|
70
71
|
"button",
|
|
71
72
|
{
|
|
72
73
|
type: "button",
|
|
@@ -86,7 +87,7 @@ function A({
|
|
|
86
87
|
);
|
|
87
88
|
}
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
f as OWNER_OPENED_HEAD,
|
|
91
|
+
C as OwnerOpenedLine,
|
|
91
92
|
N as ownerOpenedWords
|
|
92
93
|
};
|
|
@@ -73,7 +73,7 @@ function ve({
|
|
|
73
73
|
enabled: !!((R = d == null ? void 0 : d.findings) != null && R.length),
|
|
74
74
|
staleTime: 6e4
|
|
75
75
|
}), L = () => {
|
|
76
|
-
i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: [t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
|
|
76
|
+
i.invalidateQueries({ queryKey: ["record-integrity", t, r] }), i.invalidateQueries({ queryKey: ["item", t, r] }), i.invalidateQueries({ queryKey: ["rrv-record", t, r] }), i.invalidateQueries({ queryKey: ["o2m-rows"] }), i.invalidateQueries({ queryKey: ["revisions"] });
|
|
77
77
|
};
|
|
78
78
|
if (!(d != null && d.enabled) || d.findings.length === 0) return null;
|
|
79
79
|
const v = d.findings.length;
|
|
@@ -49,7 +49,7 @@ function F({ s, onApplied: m }) {
|
|
|
49
49
|
onSuccess: (e) => {
|
|
50
50
|
$.success(
|
|
51
51
|
`${e.team.action === "create" ? "Created" : "Linked"} ${e.team.name} on ${e.cells.length} cell${e.cells.length === 1 ? "" : "s"}`
|
|
52
|
-
), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["owner-groups"] }), e.team.id != null && m(e.team.id);
|
|
52
|
+
), l.invalidateQueries({ queryKey: ["team-suggestions"] }), l.invalidateQueries({ queryKey: ["user-groups"] }), l.invalidateQueries({ queryKey: ["user-groups-teams"] }), l.invalidateQueries({ queryKey: ["pipeline-all-owner-groups"] }), e.team.id != null && m(e.team.id);
|
|
53
53
|
},
|
|
54
54
|
onError: (e) => w(e, "Could not apply")
|
|
55
55
|
}), q = [...new Set(s.cells.map((e) => e.template_name ?? "Template"))], k = s.members.filter((e) => e.redacted || e.status && e.status !== "active");
|
|
@@ -1,127 +1,167 @@
|
|
|
1
|
-
import { jsxs as n, jsx as r, Fragment as
|
|
2
|
-
import { useQueryClient as
|
|
3
|
-
import { ExternalLink as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { toast as
|
|
6
|
-
import { useNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { formatMultiValue as
|
|
9
|
-
import { useLiveRecord as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { jsxs as n, jsx as r, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as le, useQuery as W, useMutation as U } from "@tanstack/react-query";
|
|
3
|
+
import { ExternalLink as de, ArrowRight as z } from "lucide-react";
|
|
4
|
+
import { useState as K, useEffect as ce } from "react";
|
|
5
|
+
import { toast as k } from "sonner";
|
|
6
|
+
import { useNivaroClient as me, useItemNavigation as ue } from "../../context.js";
|
|
7
|
+
import { get as G, post as J } from "../../lib/commands.js";
|
|
8
|
+
import { formatMultiValue as pe } from "../../lib/format-value.js";
|
|
9
|
+
import { useLiveRecord as be, batchTouches as M, LIVE_ASPECTS as I } from "../../lib/live.js";
|
|
10
|
+
import { usePresence as xe } from "../../lib/presence-hooks.js";
|
|
11
|
+
import { userErrorMessage as he } from "../../lib/safe-error.js";
|
|
12
|
+
import { cn as X, formatRelative as fe, humanHours as ge } from "../../lib/utils.js";
|
|
13
|
+
import { lockedMoveOffer as ye, transitionRequirementsFromError as ve } from "../panels/PipelinePanel.js";
|
|
14
|
+
import { TransitionRequirementsDialog as ke } from "../panels/TransitionRequirementsDialog.js";
|
|
15
|
+
import { Badge as Ne } from "../ui/badge.js";
|
|
16
|
+
import { Sheet as we, SheetContent as _e, SheetHeader as qe, SheetTitle as Ce } from "../ui/sheet.js";
|
|
17
|
+
import { OwnerAvatars as Se } from "./OwnerAvatars.js";
|
|
18
|
+
import { pathHeader as Te } from "./path-label.js";
|
|
19
|
+
import { useTransitionNote as Ke, needsTransitionNote as Me } from "./transition-note.js";
|
|
20
|
+
function Ie(t) {
|
|
21
|
+
return (t ?? []).filter((c) => c.in_row_menu !== !1);
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
23
|
+
function Pe(t) {
|
|
24
|
+
return ge(t);
|
|
24
25
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
26
|
+
const Ae = Te;
|
|
27
|
+
function h({ label: t, children: c }) {
|
|
27
28
|
return /* @__PURE__ */ n("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
|
|
28
29
|
/* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: t }),
|
|
29
|
-
/* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children:
|
|
30
|
+
/* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: c })
|
|
30
31
|
] });
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function $e(t, c, N) {
|
|
34
|
+
return {
|
|
35
|
+
transition_id: t,
|
|
36
|
+
...c ? { comment: c } : {},
|
|
37
|
+
...N ? { lock_ack: !0 } : {}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function et({
|
|
33
41
|
item: t,
|
|
34
|
-
onOpenChange:
|
|
35
|
-
onClaim:
|
|
36
|
-
onRelease:
|
|
37
|
-
workNextActive:
|
|
38
|
-
onNext:
|
|
39
|
-
refetchItems:
|
|
40
|
-
stateLabels:
|
|
41
|
-
collectionLabel:
|
|
42
|
-
claimsEnabled:
|
|
43
|
-
columnFormats:
|
|
44
|
-
fieldLabel:
|
|
45
|
-
width:
|
|
46
|
-
itemLayout:
|
|
47
|
-
onOpenRecord:
|
|
42
|
+
onOpenChange: c,
|
|
43
|
+
onClaim: N,
|
|
44
|
+
onRelease: Y,
|
|
45
|
+
workNextActive: Z,
|
|
46
|
+
onNext: P,
|
|
47
|
+
refetchItems: A,
|
|
48
|
+
stateLabels: w,
|
|
49
|
+
collectionLabel: $,
|
|
50
|
+
claimsEnabled: L = !0,
|
|
51
|
+
columnFormats: g,
|
|
52
|
+
fieldLabel: _,
|
|
53
|
+
width: ee,
|
|
54
|
+
itemLayout: E,
|
|
55
|
+
onOpenRecord: Q
|
|
48
56
|
}) {
|
|
49
|
-
var
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const { data:
|
|
57
|
+
var H;
|
|
58
|
+
const f = le(), y = me(), { open: te, urlFor: re } = ue(), [q, R] = K(""), [m, C] = K(null), [S, p] = K(null), j = Ke(), o = t == null ? void 0 : t.collection, s = t == null ? void 0 : t.item_id;
|
|
59
|
+
ce(() => p(null), [o, s]);
|
|
60
|
+
const { data: l } = W({
|
|
53
61
|
queryKey: ["queue-sheet-instance", o, s],
|
|
54
|
-
queryFn: () =>
|
|
62
|
+
queryFn: () => y.request(G(`/pipelines/instance/${o}/${s}`)).then((e) => e.data),
|
|
55
63
|
enabled: !!o && !!s
|
|
56
|
-
}), { data:
|
|
64
|
+
}), { data: b } = W({
|
|
57
65
|
queryKey: ["queue-sheet-comments", o, s],
|
|
58
|
-
queryFn: () =>
|
|
66
|
+
queryFn: () => y.request(G("/comments", { collection: o, item: s })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
|
|
59
67
|
enabled: !!o && !!s
|
|
60
|
-
}), i =
|
|
61
|
-
mutationFn: ({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
}), { viewers: x } = xe(o, s), i = U({
|
|
69
|
+
mutationFn: ({
|
|
70
|
+
transitionId: e,
|
|
71
|
+
comment: a,
|
|
72
|
+
lockAck: v
|
|
73
|
+
}) => y.request(
|
|
74
|
+
J(
|
|
75
|
+
`/pipelines/instance/${o}/${s}/transition`,
|
|
76
|
+
$e(e, a, v)
|
|
77
|
+
)
|
|
66
78
|
),
|
|
67
79
|
onSuccess: () => {
|
|
68
|
-
|
|
80
|
+
C(null), p(null), f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), A(), k.success("Transitioned");
|
|
69
81
|
},
|
|
70
|
-
onError: (e, { transitionId: a, comment:
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
onError: (e, { transitionId: a, comment: v }) => {
|
|
83
|
+
p(null);
|
|
84
|
+
const O = ye(e);
|
|
85
|
+
if (O) {
|
|
86
|
+
const u = ((l == null ? void 0 : l.available_transitions) ?? []).find((se) => se.id === a), oe = (u == null ? void 0 : u.label) || "Move";
|
|
87
|
+
k.warning(O.message, {
|
|
88
|
+
id: `nvr-locked-move:${o}:${String(s)}`,
|
|
89
|
+
duration: 2e4,
|
|
90
|
+
action: {
|
|
91
|
+
label: `${oe} anyway`,
|
|
92
|
+
onClick: () => i.mutate({ transitionId: a, comment: v, lockAck: !0 })
|
|
93
|
+
},
|
|
94
|
+
cancel: { label: "Wait", onClick: () => {
|
|
95
|
+
} }
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const V = ve(e);
|
|
100
|
+
if (V) {
|
|
101
|
+
C((u) => ({
|
|
102
|
+
payload: V,
|
|
76
103
|
transitionId: a,
|
|
77
|
-
comment:
|
|
78
|
-
revision: ((
|
|
104
|
+
comment: v,
|
|
105
|
+
revision: ((u == null ? void 0 : u.revision) ?? 0) + 1
|
|
79
106
|
}));
|
|
80
107
|
return;
|
|
81
108
|
}
|
|
82
|
-
|
|
109
|
+
k.error(he(e, "Transition failed"));
|
|
83
110
|
}
|
|
84
|
-
}),
|
|
85
|
-
mutationFn: (e) =>
|
|
111
|
+
}), F = U({
|
|
112
|
+
mutationFn: (e) => y.request(J("/comments", { collection: o, item: s, text: e })),
|
|
86
113
|
onSuccess: () => {
|
|
87
|
-
|
|
114
|
+
R(""), f.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
|
|
88
115
|
},
|
|
89
|
-
onError: () =>
|
|
116
|
+
onError: () => k.error("Failed to post comment")
|
|
90
117
|
});
|
|
91
|
-
|
|
92
|
-
|
|
118
|
+
be(o, s, (e) => {
|
|
119
|
+
M(e, I.state) ? (f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), e.own || A()) : M(e, I.owners) && f.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), M(e, I.comments) && f.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
|
|
93
120
|
});
|
|
94
|
-
const
|
|
95
|
-
const a =
|
|
121
|
+
const T = Ie(l == null ? void 0 : l.available_transitions), d = S && T.some((e) => e.id === S.id) ? S : null, B = new Map(((l == null ? void 0 : l.states) ?? []).map((e) => [e.id, e])), D = (e) => {
|
|
122
|
+
const a = B.get(e.to_state);
|
|
96
123
|
return e.label || (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || "Move";
|
|
97
|
-
},
|
|
98
|
-
const a =
|
|
124
|
+
}, ae = (e) => {
|
|
125
|
+
const a = B.get(e.to_state);
|
|
99
126
|
return (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || e.label || "the next step";
|
|
100
|
-
},
|
|
127
|
+
}, ne = async (e) => {
|
|
101
128
|
if (!i.isPending) {
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
const a = await
|
|
129
|
+
if (Me(e)) {
|
|
130
|
+
p(null);
|
|
131
|
+
const a = await j.ask(D(e));
|
|
105
132
|
if (!a) return;
|
|
106
133
|
i.mutate({ transitionId: e.id, comment: a });
|
|
107
134
|
return;
|
|
108
135
|
}
|
|
109
|
-
|
|
136
|
+
p(e);
|
|
110
137
|
}
|
|
111
138
|
};
|
|
112
|
-
return /* @__PURE__ */ n(
|
|
139
|
+
return /* @__PURE__ */ n(we, { open: !!t, onOpenChange: c, children: [
|
|
113
140
|
/* @__PURE__ */ r(
|
|
114
|
-
|
|
141
|
+
_e,
|
|
115
142
|
{
|
|
116
143
|
side: "right",
|
|
117
144
|
className: "flex max-w-full flex-col gap-0 p-0",
|
|
118
|
-
style: { width:
|
|
119
|
-
children: t && /* @__PURE__ */ n(
|
|
120
|
-
/* @__PURE__ */ r(
|
|
145
|
+
style: { width: ee ?? 480, maxWidth: "96vw" },
|
|
146
|
+
children: t && /* @__PURE__ */ n(ie, { children: [
|
|
147
|
+
/* @__PURE__ */ r(qe, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
|
|
121
148
|
/* @__PURE__ */ n("div", { className: "min-w-0", children: [
|
|
122
|
-
/* @__PURE__ */ r(
|
|
149
|
+
/* @__PURE__ */ r(Ce, { className: "truncate text-[15px] font-semibold", children: t.label }),
|
|
123
150
|
/* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center gap-2", children: [
|
|
124
|
-
/* @__PURE__ */ r(
|
|
151
|
+
/* @__PURE__ */ r(Ne, { variant: "outline", children: $ ? $(t.collection) : t.collection }),
|
|
152
|
+
x.length > 0 && /* @__PURE__ */ n(
|
|
153
|
+
"span",
|
|
154
|
+
{
|
|
155
|
+
"data-queue-sheet-viewers": x.length,
|
|
156
|
+
"data-tip": `Also viewing: ${x.map((e) => e.name).join(", ")}`,
|
|
157
|
+
className: "relative inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-1.5 py-0.5 text-[11px] font-medium text-nvr-navy dark:text-nvr-cyan",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ r("span", { "aria-hidden": !0, className: "h-1.5 w-1.5 rounded-full bg-nvr-cyan" }),
|
|
160
|
+
x.length === 1 ? x[0].name : `${x.length} others`,
|
|
161
|
+
/* @__PURE__ */ r("span", { className: "sr-only", children: " also viewing" })
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
),
|
|
125
165
|
t.state && /* @__PURE__ */ r(
|
|
126
166
|
"span",
|
|
127
167
|
{
|
|
@@ -130,7 +170,7 @@ function We({
|
|
|
130
170
|
backgroundColor: t.state_color ? `${t.state_color}1a` : void 0,
|
|
131
171
|
color: t.state_color ?? void 0
|
|
132
172
|
},
|
|
133
|
-
children: (
|
|
173
|
+
children: (w == null ? void 0 : w[t.state]) ?? t.state
|
|
134
174
|
}
|
|
135
175
|
)
|
|
136
176
|
] })
|
|
@@ -138,60 +178,60 @@ function We({
|
|
|
138
178
|
/* @__PURE__ */ n(
|
|
139
179
|
"a",
|
|
140
180
|
{
|
|
141
|
-
href:
|
|
181
|
+
href: re({
|
|
142
182
|
collection: t.collection,
|
|
143
183
|
itemId: t.item_id,
|
|
144
|
-
layoutSlug:
|
|
184
|
+
layoutSlug: E ?? null
|
|
145
185
|
}),
|
|
146
186
|
onClick: (e) => {
|
|
147
|
-
e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0 || (e.preventDefault(),
|
|
187
|
+
e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0 || (e.preventDefault(), Q ? Q(t) : te({
|
|
148
188
|
collection: t.collection,
|
|
149
189
|
itemId: t.item_id,
|
|
150
|
-
layoutSlug:
|
|
190
|
+
layoutSlug: E ?? null
|
|
151
191
|
}));
|
|
152
192
|
},
|
|
153
193
|
className: "flex shrink-0 items-center gap-1 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
|
|
154
194
|
children: [
|
|
155
195
|
"Open ",
|
|
156
|
-
/* @__PURE__ */ r(
|
|
196
|
+
/* @__PURE__ */ r(de, { className: "h-3 w-3" })
|
|
157
197
|
]
|
|
158
198
|
}
|
|
159
199
|
)
|
|
160
200
|
] }) }),
|
|
161
201
|
/* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
|
|
162
202
|
/* @__PURE__ */ n("div", { className: "mb-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
|
|
163
|
-
/* @__PURE__ */ r(
|
|
164
|
-
/* @__PURE__ */ r(
|
|
165
|
-
/* @__PURE__ */ r(
|
|
203
|
+
/* @__PURE__ */ r(h, { label: "Owners", children: /* @__PURE__ */ r(Se, { owners: t.owners, max: 6 }) }),
|
|
204
|
+
/* @__PURE__ */ r(h, { label: "Claimed by", children: ((H = t.claimed_by) == null ? void 0 : H.name) ?? "—" }),
|
|
205
|
+
/* @__PURE__ */ r(h, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
|
|
166
206
|
"span",
|
|
167
207
|
{
|
|
168
|
-
className:
|
|
208
|
+
className: X(
|
|
169
209
|
"rounded px-1.5 py-0.5 text-[11px] font-medium",
|
|
170
210
|
t.sla_status === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : t.sla_status === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"
|
|
171
211
|
),
|
|
172
212
|
children: t.sla_status
|
|
173
213
|
}
|
|
174
214
|
) : "—" }),
|
|
175
|
-
/* @__PURE__ */ r(
|
|
176
|
-
t.at_risk && /* @__PURE__ */ r(
|
|
177
|
-
Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(
|
|
215
|
+
/* @__PURE__ */ r(h, { label: "Aging", children: Pe(t.aging_hours) }),
|
|
216
|
+
t.at_risk && /* @__PURE__ */ r(h, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
|
|
217
|
+
Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(h, { label: (_ == null ? void 0 : _(e)) || Ae(e), children: a == null || a === "" ? "—" : g != null && g[e] ? pe(String(a), g[e]) : String(a) }, e))
|
|
178
218
|
] }),
|
|
179
|
-
|
|
219
|
+
T.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
|
|
180
220
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Transitions" }),
|
|
181
|
-
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children:
|
|
221
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: T.map((e) => /* @__PURE__ */ n(
|
|
182
222
|
"button",
|
|
183
223
|
{
|
|
184
224
|
type: "button",
|
|
185
225
|
disabled: i.isPending,
|
|
186
226
|
"aria-pressed": (d == null ? void 0 : d.id) === e.id,
|
|
187
|
-
onClick: () => void
|
|
188
|
-
className:
|
|
227
|
+
onClick: () => void ne(e),
|
|
228
|
+
className: X(
|
|
189
229
|
"flex items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] font-medium text-slate-700 hover:border-nvr-cyan hover:text-nvr-navy disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
190
230
|
(d == null ? void 0 : d.id) === e.id && "border-nvr-cyan"
|
|
191
231
|
),
|
|
192
232
|
children: [
|
|
193
|
-
|
|
194
|
-
/* @__PURE__ */ r(
|
|
233
|
+
D(e),
|
|
234
|
+
/* @__PURE__ */ r(z, { className: "h-3 w-3 text-slate-400" })
|
|
195
235
|
]
|
|
196
236
|
},
|
|
197
237
|
e.id
|
|
@@ -209,7 +249,7 @@ function We({
|
|
|
209
249
|
/* @__PURE__ */ r("span", { className: "font-semibold", children: t.label }),
|
|
210
250
|
" to",
|
|
211
251
|
" ",
|
|
212
|
-
/* @__PURE__ */ r("span", { className: "font-semibold", children:
|
|
252
|
+
/* @__PURE__ */ r("span", { className: "font-semibold", children: ae(d) }),
|
|
213
253
|
"?"
|
|
214
254
|
] }),
|
|
215
255
|
/* @__PURE__ */ n("div", { className: "mt-2 flex gap-2", children: [
|
|
@@ -228,7 +268,7 @@ function We({
|
|
|
228
268
|
{
|
|
229
269
|
type: "button",
|
|
230
270
|
disabled: i.isPending,
|
|
231
|
-
onClick: () =>
|
|
271
|
+
onClick: () => p(null),
|
|
232
272
|
className: "h-7 rounded-md border border-slate-200 bg-white px-3 text-[12px] text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-300",
|
|
233
273
|
children: "Keep"
|
|
234
274
|
}
|
|
@@ -238,11 +278,11 @@ function We({
|
|
|
238
278
|
}
|
|
239
279
|
)
|
|
240
280
|
] }),
|
|
241
|
-
(
|
|
281
|
+
(L || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
|
|
242
282
|
"button",
|
|
243
283
|
{
|
|
244
284
|
type: "button",
|
|
245
|
-
onClick: () => t.claimed_by ?
|
|
285
|
+
onClick: () => t.claimed_by ? Y(t) : N(t),
|
|
246
286
|
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90",
|
|
247
287
|
children: t.claimed_by ? "Release claim" : "Claim this item"
|
|
248
288
|
}
|
|
@@ -250,21 +290,21 @@ function We({
|
|
|
250
290
|
/* @__PURE__ */ n("div", { children: [
|
|
251
291
|
/* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Comments" }),
|
|
252
292
|
/* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
|
|
253
|
-
((
|
|
293
|
+
((b == null ? void 0 : b.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
|
|
254
294
|
/* @__PURE__ */ n("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
|
|
255
295
|
[e.first_name, e.last_name].filter(Boolean).join(" ") || e.email || "—",
|
|
256
|
-
/* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children:
|
|
296
|
+
/* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: fe(e.created_at) })
|
|
257
297
|
] }),
|
|
258
298
|
/* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: e.text })
|
|
259
299
|
] }, e.id)),
|
|
260
|
-
((
|
|
300
|
+
((b == null ? void 0 : b.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
|
|
261
301
|
] }),
|
|
262
302
|
/* @__PURE__ */ n("div", { className: "mt-2.5", children: [
|
|
263
303
|
/* @__PURE__ */ r(
|
|
264
304
|
"textarea",
|
|
265
305
|
{
|
|
266
|
-
value:
|
|
267
|
-
onChange: (e) =>
|
|
306
|
+
value: q,
|
|
307
|
+
onChange: (e) => R(e.target.value),
|
|
268
308
|
placeholder: "Add a comment…",
|
|
269
309
|
rows: 2,
|
|
270
310
|
className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
|
|
@@ -274,8 +314,8 @@ function We({
|
|
|
274
314
|
"button",
|
|
275
315
|
{
|
|
276
316
|
type: "button",
|
|
277
|
-
disabled: !
|
|
278
|
-
onClick: () =>
|
|
317
|
+
disabled: !q.trim() || F.isPending,
|
|
318
|
+
onClick: () => F.mutate(q.trim()),
|
|
279
319
|
className: "mt-1 rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:text-slate-800 disabled:opacity-50 dark:border-border dark:text-slate-300",
|
|
280
320
|
children: "Post"
|
|
281
321
|
}
|
|
@@ -283,40 +323,41 @@ function We({
|
|
|
283
323
|
] })
|
|
284
324
|
] })
|
|
285
325
|
] }),
|
|
286
|
-
|
|
326
|
+
Z && P && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
|
|
287
327
|
"button",
|
|
288
328
|
{
|
|
289
329
|
type: "button",
|
|
290
|
-
onClick:
|
|
330
|
+
onClick: P,
|
|
291
331
|
className: "flex w-full items-center justify-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-2 text-[13px] font-semibold text-white hover:bg-nvr-cyan/90",
|
|
292
332
|
children: [
|
|
293
333
|
"Next ",
|
|
294
|
-
/* @__PURE__ */ r(
|
|
334
|
+
/* @__PURE__ */ r(z, { className: "h-3.5 w-3.5" })
|
|
295
335
|
]
|
|
296
336
|
}
|
|
297
337
|
) })
|
|
298
338
|
] })
|
|
299
339
|
}
|
|
300
340
|
),
|
|
301
|
-
|
|
302
|
-
|
|
341
|
+
m && /* @__PURE__ */ r(
|
|
342
|
+
ke,
|
|
303
343
|
{
|
|
304
|
-
payload:
|
|
305
|
-
transitionId:
|
|
306
|
-
isRetry:
|
|
344
|
+
payload: m.payload,
|
|
345
|
+
transitionId: m.transitionId,
|
|
346
|
+
isRetry: m.revision > 1,
|
|
307
347
|
onSubmitted: () => i.mutate({
|
|
308
|
-
transitionId:
|
|
309
|
-
comment:
|
|
348
|
+
transitionId: m.transitionId,
|
|
349
|
+
comment: m.comment
|
|
310
350
|
}),
|
|
311
351
|
executing: i.isPending,
|
|
312
|
-
onClose: () =>
|
|
352
|
+
onClose: () => C(null)
|
|
313
353
|
},
|
|
314
|
-
|
|
354
|
+
m.revision
|
|
315
355
|
),
|
|
316
|
-
|
|
356
|
+
j.dialog
|
|
317
357
|
] });
|
|
318
358
|
}
|
|
319
359
|
export {
|
|
320
|
-
|
|
321
|
-
|
|
360
|
+
et as QueueItemSheet,
|
|
361
|
+
Ie as peekTransitions,
|
|
362
|
+
$e as sheetTransitionBody
|
|
322
363
|
};
|