@nivaro/react 0.3.116 → 0.3.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as L } from "@tanstack/react-query";
|
|
3
|
-
import { Users as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useOptionalNivaroClient as
|
|
3
|
+
import { Users as D, Check as j, Settings2 as M, Plus as q, X as B, BellRing as P, Bell as W, GitBranch as U, ListChecks as I, Clock as K, Search as H } from "lucide-react";
|
|
4
|
+
import { useState as f, useId as Q, useRef as Y, useMemo as G } from "react";
|
|
5
|
+
import { useOptionalNivaroClient as E } from "../../context.js";
|
|
6
6
|
import { get as F } from "../../lib/commands.js";
|
|
7
|
-
import { describeError as
|
|
8
|
-
import { desktopPermission as
|
|
9
|
-
import { watchKeys as
|
|
10
|
-
import { Popover as
|
|
11
|
-
import { Skeleton as
|
|
7
|
+
import { describeError as X } from "../../lib/error-message.js";
|
|
8
|
+
import { desktopPermission as z, requestDesktopPermission as J } from "../../lib/watch-desktop.js";
|
|
9
|
+
import { watchKeys as V } from "../../lib/watch-list.js";
|
|
10
|
+
import { Popover as _, PopoverTrigger as S, PopoverContent as O } from "../ui/popover.js";
|
|
11
|
+
import { Skeleton as Z } from "../ui/skeleton.js";
|
|
12
12
|
function w({
|
|
13
13
|
checked: t,
|
|
14
|
-
onChange:
|
|
15
|
-
label:
|
|
16
|
-
hint:
|
|
17
|
-
disabled:
|
|
18
|
-
indent:
|
|
14
|
+
onChange: s,
|
|
15
|
+
label: o,
|
|
16
|
+
hint: r,
|
|
17
|
+
disabled: n,
|
|
18
|
+
indent: c
|
|
19
19
|
}) {
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
20
|
+
const p = Q();
|
|
21
|
+
return /* @__PURE__ */ l("div", { className: `flex items-start gap-3 py-2 ${c ? "pl-4" : ""}`, children: [
|
|
22
|
+
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
|
|
23
23
|
/* @__PURE__ */ e(
|
|
24
24
|
"label",
|
|
25
25
|
{
|
|
26
|
-
htmlFor:
|
|
27
|
-
className: `block text-[12.5px] font-medium ${
|
|
28
|
-
children:
|
|
26
|
+
htmlFor: p,
|
|
27
|
+
className: `block text-balance text-[12.5px] font-medium ${n ? "text-slate-400 dark:text-slate-500" : "text-slate-800 dark:text-slate-100"}`,
|
|
28
|
+
children: o
|
|
29
29
|
}
|
|
30
30
|
),
|
|
31
|
-
|
|
31
|
+
r && /* @__PURE__ */ e("div", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: r })
|
|
32
32
|
] }),
|
|
33
33
|
/* @__PURE__ */ e(
|
|
34
34
|
"button",
|
|
35
35
|
{
|
|
36
|
-
id:
|
|
36
|
+
id: p,
|
|
37
37
|
type: "button",
|
|
38
38
|
role: "switch",
|
|
39
39
|
"aria-checked": t,
|
|
40
|
-
disabled:
|
|
41
|
-
onClick: () =>
|
|
40
|
+
disabled: n,
|
|
41
|
+
onClick: () => s(!t),
|
|
42
42
|
className: `relative mt-0.5 inline-flex h-[18px] w-8 shrink-0 items-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 focus-visible:ring-offset-1 focus-visible:ring-offset-popover disabled:cursor-not-allowed disabled:opacity-40 ${t ? "bg-nvr-cyan" : "bg-slate-300 dark:bg-white/[0.16]"}`,
|
|
43
43
|
children: /* @__PURE__ */ e(
|
|
44
44
|
"span",
|
|
@@ -54,49 +54,49 @@ function w({
|
|
|
54
54
|
function $({ children: t }) {
|
|
55
55
|
return /* @__PURE__ */ e("p", { className: "px-3 pb-1 pt-3 text-[11px] font-semibold text-slate-500 dark:text-slate-400", children: t });
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
function
|
|
57
|
+
const ee = "flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-500 transition-colors hover:bg-slate-100 hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-200";
|
|
58
|
+
function ge({
|
|
59
59
|
actions: t,
|
|
60
|
-
onOpenTeam:
|
|
61
|
-
onNewTeam:
|
|
60
|
+
onOpenTeam: s,
|
|
61
|
+
onNewTeam: o
|
|
62
62
|
}) {
|
|
63
|
-
const { settings:
|
|
64
|
-
if (!
|
|
63
|
+
const { settings: r, teams: n } = t.prefs, [c, p] = f(() => z()), [h, a] = f(!1), m = async (i) => {
|
|
64
|
+
if (!i) return void t.setSettings({ desktop: !1 }).catch(() => {
|
|
65
65
|
});
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
const x = c === "granted" ? c : await J();
|
|
67
|
+
p(x), x === "granted" && await t.setSettings({ desktop: !0 }).catch(() => {
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
/* @__PURE__ */ e(
|
|
70
|
+
return /* @__PURE__ */ l(_, { open: h, onOpenChange: a, children: [
|
|
71
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
72
72
|
"button",
|
|
73
73
|
{
|
|
74
74
|
type: "button",
|
|
75
75
|
"aria-label": "Watch list settings",
|
|
76
76
|
"data-tip": "Settings",
|
|
77
|
-
className:
|
|
77
|
+
className: ee,
|
|
78
78
|
"data-watch-settings": !0,
|
|
79
|
-
children: /* @__PURE__ */ e(
|
|
79
|
+
children: /* @__PURE__ */ e(M, { className: "h-3.5 w-3.5" })
|
|
80
80
|
}
|
|
81
81
|
) }),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
82
|
+
/* @__PURE__ */ l(
|
|
83
|
+
O,
|
|
84
84
|
{
|
|
85
85
|
align: "end",
|
|
86
86
|
className: "w-[300px] p-0",
|
|
87
|
-
onOpenAutoFocus: (
|
|
87
|
+
onOpenAutoFocus: (i) => i.preventDefault(),
|
|
88
88
|
children: [
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ l("div", { className: "px-3 pt-1", children: [
|
|
90
90
|
/* @__PURE__ */ e($, { children: "Tell me" }),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ l("div", { className: "divide-y divide-slate-100 px-3 dark:divide-white/[0.06]", children: [
|
|
92
92
|
/* @__PURE__ */ e(
|
|
93
93
|
w,
|
|
94
94
|
{
|
|
95
95
|
label: "Desktop alerts",
|
|
96
|
-
hint:
|
|
97
|
-
checked:
|
|
98
|
-
disabled:
|
|
99
|
-
onChange: (
|
|
96
|
+
hint: c === "unsupported" ? "This browser cannot show notifications." : c === "denied" ? /* @__PURE__ */ e("span", { className: "text-amber-700 dark:text-amber-300", children: "Your browser blocks notifications for this site. Allow them in the browser’s site settings, then turn this on." }) : "A notice on your computer when someone else changes a pinned record while this page is in the background.",
|
|
97
|
+
checked: r.desktop && c === "granted",
|
|
98
|
+
disabled: c === "unsupported",
|
|
99
|
+
onChange: (i) => void m(i)
|
|
100
100
|
}
|
|
101
101
|
),
|
|
102
102
|
/* @__PURE__ */ e(
|
|
@@ -104,21 +104,21 @@ function be({
|
|
|
104
104
|
{
|
|
105
105
|
label: "Daily email",
|
|
106
106
|
hint: "One email each morning of what changed on your pinned records. Nothing on quiet days.",
|
|
107
|
-
checked:
|
|
108
|
-
onChange: (
|
|
107
|
+
checked: r.digest,
|
|
108
|
+
onChange: (i) => void t.setSettings({ digest: i }).catch(() => {
|
|
109
109
|
})
|
|
110
110
|
}
|
|
111
111
|
)
|
|
112
112
|
] }),
|
|
113
113
|
/* @__PURE__ */ e($, { children: "Pin for me" }),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ l("div", { className: "px-3", children: [
|
|
115
115
|
/* @__PURE__ */ e(
|
|
116
116
|
w,
|
|
117
117
|
{
|
|
118
118
|
label: "Records that land on my step",
|
|
119
119
|
hint: "When a record moves to a step you own, it is pinned here for you.",
|
|
120
|
-
checked:
|
|
121
|
-
onChange: (
|
|
120
|
+
checked: r.auto_add,
|
|
121
|
+
onChange: (i) => void t.setSettings({ auto_add: i }).catch(() => {
|
|
122
122
|
})
|
|
123
123
|
}
|
|
124
124
|
),
|
|
@@ -128,9 +128,9 @@ function be({
|
|
|
128
128
|
indent: !0,
|
|
129
129
|
label: "Unpin them when they leave my step",
|
|
130
130
|
hint: "Only records pinned this way. A record you pinned yourself stays.",
|
|
131
|
-
checked:
|
|
132
|
-
disabled: !
|
|
133
|
-
onChange: (
|
|
131
|
+
checked: r.auto_remove,
|
|
132
|
+
disabled: !r.auto_add,
|
|
133
|
+
onChange: (i) => void t.setSettings({ auto_remove: i }).catch(() => {
|
|
134
134
|
})
|
|
135
135
|
}
|
|
136
136
|
)
|
|
@@ -141,39 +141,39 @@ function be({
|
|
|
141
141
|
{
|
|
142
142
|
label: "Remove records when they’re completed",
|
|
143
143
|
hint: "They show “Completed”, then leave 24 hours later or once you’ve seen them. Recently removed keeps them 7 days, with Undo.",
|
|
144
|
-
checked:
|
|
145
|
-
onChange: (
|
|
144
|
+
checked: r.remove_completed,
|
|
145
|
+
onChange: (i) => void t.setSettings({ remove_completed: i }).catch(() => {
|
|
146
146
|
})
|
|
147
147
|
}
|
|
148
148
|
) })
|
|
149
149
|
] }),
|
|
150
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ l("div", { className: "mt-1 border-t border-border px-3 pb-2", children: [
|
|
151
151
|
/* @__PURE__ */ e($, { children: "Shared lists" }),
|
|
152
|
-
|
|
152
|
+
n.length === 0 ? /* @__PURE__ */ e("p", { className: "px-3 pb-1 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "A list your team watches together. Each person sees only the records they can open." }) : /* @__PURE__ */ e("ul", { className: "pb-1", children: n.map((i) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ l(
|
|
153
153
|
"button",
|
|
154
154
|
{
|
|
155
155
|
type: "button",
|
|
156
156
|
onClick: () => {
|
|
157
|
-
a(!1),
|
|
157
|
+
a(!1), s(i.id);
|
|
158
158
|
},
|
|
159
159
|
className: "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
160
160
|
children: [
|
|
161
|
-
/* @__PURE__ */ e(
|
|
162
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children:
|
|
163
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children:
|
|
161
|
+
/* @__PURE__ */ e(D, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
162
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: i.name }),
|
|
163
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: i.pins.length })
|
|
164
164
|
]
|
|
165
165
|
}
|
|
166
|
-
) },
|
|
167
|
-
/* @__PURE__ */
|
|
166
|
+
) }, i.id)) }),
|
|
167
|
+
/* @__PURE__ */ l(
|
|
168
168
|
"button",
|
|
169
169
|
{
|
|
170
170
|
type: "button",
|
|
171
171
|
onClick: () => {
|
|
172
|
-
a(!1),
|
|
172
|
+
a(!1), o();
|
|
173
173
|
},
|
|
174
174
|
className: "flex w-full items-center gap-2 rounded-md px-3 py-1.5 text-left text-[12.5px] font-medium text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
175
175
|
children: [
|
|
176
|
-
/* @__PURE__ */ e(
|
|
176
|
+
/* @__PURE__ */ e(q, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
177
177
|
"New shared list"
|
|
178
178
|
]
|
|
179
179
|
}
|
|
@@ -184,7 +184,7 @@ function be({
|
|
|
184
184
|
)
|
|
185
185
|
] });
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const te = {
|
|
188
188
|
step: "It reaches a step",
|
|
189
189
|
field: "A field changes",
|
|
190
190
|
overdue: "It’s overdue"
|
|
@@ -192,43 +192,43 @@ const ee = {
|
|
|
192
192
|
function A(t) {
|
|
193
193
|
return `${t.kind === "step" ? `Reaches ${t.label ?? t.step ?? "a step"}` : t.kind === "field" ? `${t.label ?? t.field ?? "A field"} changes` : "It’s overdue"} · ${t.repeat ? "every time" : "once"}`;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function T({
|
|
196
196
|
items: t,
|
|
197
|
-
value:
|
|
198
|
-
onPick:
|
|
199
|
-
placeholder:
|
|
200
|
-
empty:
|
|
197
|
+
value: s,
|
|
198
|
+
onPick: o,
|
|
199
|
+
placeholder: r,
|
|
200
|
+
empty: n
|
|
201
201
|
}) {
|
|
202
|
-
const [
|
|
203
|
-
const a =
|
|
204
|
-
return a ? t.filter((
|
|
205
|
-
}, [t,
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
t.length > 7 && /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */ e(
|
|
202
|
+
const [c, p] = f(""), h = G(() => {
|
|
203
|
+
const a = c.trim().toLowerCase();
|
|
204
|
+
return a ? t.filter((m) => m.label.toLowerCase().includes(a)) : t;
|
|
205
|
+
}, [t, c]);
|
|
206
|
+
return /* @__PURE__ */ l("div", { className: "rounded-md border border-border", children: [
|
|
207
|
+
t.length > 7 && /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5 border-b border-border px-2", children: [
|
|
208
|
+
/* @__PURE__ */ e(H, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-slate-400" }),
|
|
209
209
|
/* @__PURE__ */ e(
|
|
210
210
|
"input",
|
|
211
211
|
{
|
|
212
|
-
value:
|
|
213
|
-
onChange: (a) =>
|
|
214
|
-
placeholder:
|
|
215
|
-
"aria-label":
|
|
212
|
+
value: c,
|
|
213
|
+
onChange: (a) => p(a.target.value),
|
|
214
|
+
placeholder: r,
|
|
215
|
+
"aria-label": r,
|
|
216
216
|
className: "h-7 min-w-0 flex-1 bg-transparent text-[12px] text-slate-800 outline-none placeholder:text-slate-400 dark:text-slate-100"
|
|
217
217
|
}
|
|
218
218
|
)
|
|
219
219
|
] }),
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const
|
|
224
|
-
return /* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ l("div", { role: "listbox", "aria-label": r, className: "max-h-36 overflow-y-auto p-1", children: [
|
|
221
|
+
h.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[11.5px] text-slate-500 dark:text-slate-400", children: n }),
|
|
222
|
+
h.map((a) => {
|
|
223
|
+
const m = a.value === s;
|
|
224
|
+
return /* @__PURE__ */ l(
|
|
225
225
|
"button",
|
|
226
226
|
{
|
|
227
227
|
type: "button",
|
|
228
228
|
role: "option",
|
|
229
|
-
"aria-selected":
|
|
230
|
-
onClick: () =>
|
|
231
|
-
className: `flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] ${
|
|
229
|
+
"aria-selected": m,
|
|
230
|
+
onClick: () => o(a.value, a.label),
|
|
231
|
+
className: `flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px] ${m ? "bg-accent text-slate-900 dark:text-slate-50" : "text-slate-700 hover:bg-muted dark:text-slate-200"}`,
|
|
232
232
|
children: [
|
|
233
233
|
a.color !== void 0 && /* @__PURE__ */ e(
|
|
234
234
|
"span",
|
|
@@ -239,7 +239,7 @@ function O({
|
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
241
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a.label }),
|
|
242
|
-
|
|
242
|
+
m && /* @__PURE__ */ e(j, { "aria-hidden": !0, className: "h-3 w-3 shrink-0 text-nvr-cyan" })
|
|
243
243
|
]
|
|
244
244
|
},
|
|
245
245
|
a.value
|
|
@@ -248,126 +248,126 @@ function O({
|
|
|
248
248
|
] })
|
|
249
249
|
] });
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function ae({
|
|
252
252
|
value: t,
|
|
253
|
-
options:
|
|
254
|
-
onChange:
|
|
255
|
-
label:
|
|
253
|
+
options: s,
|
|
254
|
+
onChange: o,
|
|
255
|
+
label: r
|
|
256
256
|
}) {
|
|
257
257
|
return /* @__PURE__ */ e(
|
|
258
258
|
"div",
|
|
259
259
|
{
|
|
260
260
|
role: "radiogroup",
|
|
261
|
-
"aria-label":
|
|
261
|
+
"aria-label": r,
|
|
262
262
|
className: "inline-flex rounded-md bg-slate-100 p-0.5 dark:bg-white/[0.06]",
|
|
263
|
-
children:
|
|
263
|
+
children: s.map((n) => (
|
|
264
264
|
// biome-ignore lint/a11y/useSemanticElements: a segmented control, styled as one row
|
|
265
265
|
/* @__PURE__ */ e(
|
|
266
266
|
"button",
|
|
267
267
|
{
|
|
268
268
|
type: "button",
|
|
269
269
|
role: "radio",
|
|
270
|
-
"aria-checked":
|
|
271
|
-
onClick: () =>
|
|
272
|
-
className: `rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${
|
|
273
|
-
children:
|
|
270
|
+
"aria-checked": n.value === t,
|
|
271
|
+
onClick: () => o(n.value),
|
|
272
|
+
className: `rounded px-2.5 py-1 text-[11.5px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${n.value === t ? "bg-white text-slate-900 shadow-[0_1px_2px_rgba(15,23,42,0.08)] dark:bg-white/[0.12] dark:text-slate-50" : "text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-200"}`,
|
|
273
|
+
children: n.label
|
|
274
274
|
},
|
|
275
|
-
|
|
275
|
+
n.value
|
|
276
276
|
)
|
|
277
277
|
))
|
|
278
278
|
}
|
|
279
279
|
);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function se({
|
|
282
282
|
row: t,
|
|
283
|
-
actions:
|
|
284
|
-
onDone:
|
|
283
|
+
actions: s,
|
|
284
|
+
onDone: o
|
|
285
285
|
}) {
|
|
286
|
-
var
|
|
287
|
-
const
|
|
288
|
-
queryKey:
|
|
289
|
-
queryFn: () =>
|
|
286
|
+
var b, g;
|
|
287
|
+
const r = E(), n = L({
|
|
288
|
+
queryKey: V.alertOptions(t.collection, t.id),
|
|
289
|
+
queryFn: () => r.request(
|
|
290
290
|
F(
|
|
291
291
|
`/watch-list/alert-options/${encodeURIComponent(t.collection)}/${encodeURIComponent(t.id)}`
|
|
292
292
|
)
|
|
293
|
-
).then((
|
|
294
|
-
enabled: !!
|
|
293
|
+
).then((u) => u.data),
|
|
294
|
+
enabled: !!r,
|
|
295
295
|
staleTime: 5 * 6e4
|
|
296
|
-
}), [
|
|
297
|
-
if (!(!N ||
|
|
298
|
-
|
|
296
|
+
}), [c, p] = f("step"), [h, a] = f(null), [m, d] = f("once"), [i, x] = f(!1), N = c === "overdue" || !!h, v = async () => {
|
|
297
|
+
if (!(!N || i)) {
|
|
298
|
+
x(!0);
|
|
299
299
|
try {
|
|
300
|
-
await
|
|
300
|
+
await s.addAlert({
|
|
301
301
|
collection: t.collection,
|
|
302
302
|
id: t.id,
|
|
303
|
-
kind:
|
|
304
|
-
...
|
|
305
|
-
...
|
|
306
|
-
repeat:
|
|
307
|
-
}),
|
|
303
|
+
kind: c,
|
|
304
|
+
...c === "step" ? { step: h == null ? void 0 : h.value, label: h == null ? void 0 : h.label } : {},
|
|
305
|
+
...c === "field" ? { field: h == null ? void 0 : h.value, label: h == null ? void 0 : h.label } : {},
|
|
306
|
+
repeat: m === "always"
|
|
307
|
+
}), o();
|
|
308
308
|
} catch {
|
|
309
309
|
} finally {
|
|
310
|
-
|
|
310
|
+
x(!1);
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
};
|
|
314
|
-
if (
|
|
315
|
-
const
|
|
316
|
-
return /* @__PURE__ */ e("p", { className: "py-2 text-[12px] text-slate-600 dark:text-slate-300", children:
|
|
314
|
+
if (n.isError) {
|
|
315
|
+
const u = X(n.error, "The choices could not load");
|
|
316
|
+
return /* @__PURE__ */ e("p", { className: "py-2 text-[12px] text-slate-600 dark:text-slate-300", children: u.title });
|
|
317
317
|
}
|
|
318
|
-
const y = ((
|
|
319
|
-
return /* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */ e("div", { role: "radiogroup", "aria-label": "Tell me when", className: "space-y-0.5", children: ["step", "field", "overdue"].map((
|
|
321
|
-
const k =
|
|
318
|
+
const y = ((b = n.data) == null ? void 0 : b.steps) ?? [], C = ((g = n.data) == null ? void 0 : g.fields) ?? [];
|
|
319
|
+
return /* @__PURE__ */ l("div", { className: "space-y-2.5", children: [
|
|
320
|
+
/* @__PURE__ */ e("div", { role: "radiogroup", "aria-label": "Tell me when", className: "space-y-0.5", children: ["step", "field", "overdue"].map((u) => {
|
|
321
|
+
const k = u === "step" && n.isSuccess && y.length === 0;
|
|
322
322
|
return (
|
|
323
323
|
// biome-ignore lint/a11y/useSemanticElements: a choice list, styled as menu rows
|
|
324
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ l(
|
|
325
325
|
"button",
|
|
326
326
|
{
|
|
327
327
|
type: "button",
|
|
328
328
|
role: "radio",
|
|
329
|
-
"aria-checked":
|
|
329
|
+
"aria-checked": c === u,
|
|
330
330
|
disabled: k,
|
|
331
331
|
onClick: () => {
|
|
332
|
-
|
|
332
|
+
p(u), a(null);
|
|
333
333
|
},
|
|
334
|
-
className: `flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${
|
|
334
|
+
className: `flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-[12.5px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${c === u ? "bg-accent font-medium text-slate-900 dark:text-slate-50" : "text-slate-600 hover:bg-muted dark:text-slate-300"}`,
|
|
335
335
|
children: [
|
|
336
|
-
/* @__PURE__ */ e(
|
|
337
|
-
|
|
336
|
+
/* @__PURE__ */ e(u === "step" ? U : u === "field" ? I : K, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
337
|
+
te[u]
|
|
338
338
|
]
|
|
339
339
|
},
|
|
340
|
-
|
|
340
|
+
u
|
|
341
341
|
)
|
|
342
342
|
);
|
|
343
343
|
}) }),
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
c !== "overdue" && (n.isLoading ? /* @__PURE__ */ e(Z, { className: "h-24 w-full rounded-md" }) : c === "step" ? /* @__PURE__ */ e(
|
|
345
|
+
T,
|
|
346
346
|
{
|
|
347
|
-
items: y.map((
|
|
348
|
-
value: (
|
|
349
|
-
onPick: (
|
|
347
|
+
items: y.map((u) => ({ value: u.key, label: u.label, color: u.color })),
|
|
348
|
+
value: (h == null ? void 0 : h.value) ?? "",
|
|
349
|
+
onPick: (u, k) => a({ value: u, label: k }),
|
|
350
350
|
placeholder: "Find a step",
|
|
351
351
|
empty: "No steps match"
|
|
352
352
|
}
|
|
353
353
|
) : /* @__PURE__ */ e(
|
|
354
|
-
|
|
354
|
+
T,
|
|
355
355
|
{
|
|
356
|
-
items: C.map((
|
|
357
|
-
value: (
|
|
358
|
-
onPick: (
|
|
356
|
+
items: C.map((u) => ({ value: u.field, label: u.label })),
|
|
357
|
+
value: (h == null ? void 0 : h.value) ?? "",
|
|
358
|
+
onPick: (u, k) => a({ value: u, label: k }),
|
|
359
359
|
placeholder: "Find a field",
|
|
360
360
|
empty: "No fields match"
|
|
361
361
|
}
|
|
362
362
|
)),
|
|
363
|
-
|
|
364
|
-
/* @__PURE__ */
|
|
363
|
+
c === "overdue" && /* @__PURE__ */ e("p", { className: "px-2 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "When its current step passes its due time. One alert per step it runs late on." }),
|
|
364
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 pt-0.5", children: [
|
|
365
365
|
/* @__PURE__ */ e(
|
|
366
|
-
|
|
366
|
+
ae,
|
|
367
367
|
{
|
|
368
368
|
label: "How often",
|
|
369
|
-
value:
|
|
370
|
-
onChange:
|
|
369
|
+
value: m,
|
|
370
|
+
onChange: d,
|
|
371
371
|
options: [
|
|
372
372
|
{ value: "once", label: "Once" },
|
|
373
373
|
{ value: "always", label: "Every time" }
|
|
@@ -378,77 +378,121 @@ function ae({
|
|
|
378
378
|
"button",
|
|
379
379
|
{
|
|
380
380
|
type: "button",
|
|
381
|
-
disabled: !N ||
|
|
382
|
-
onClick: () => void
|
|
383
|
-
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-
|
|
384
|
-
children:
|
|
381
|
+
disabled: !N || i,
|
|
382
|
+
onClick: () => void v(),
|
|
383
|
+
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:font-medium disabled:text-slate-400 disabled:hover:opacity-100 dark:disabled:bg-white/[0.06] dark:disabled:!text-slate-500",
|
|
384
|
+
children: i ? "Adding…" : "Add alert"
|
|
385
385
|
}
|
|
386
386
|
)
|
|
387
387
|
] })
|
|
388
388
|
] });
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
|
|
390
|
+
function le(t) {
|
|
391
|
+
const s = t == null ? void 0 : t.closest("[data-watch-dock]");
|
|
392
|
+
if (!t || !s) return { side: "left", sideOffset: 6 };
|
|
393
|
+
const o = s.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
394
|
+
return o.left < 300 ? { side: "bottom", sideOffset: 4 } : { side: "left", sideOffset: Math.max(6, Math.round(r.left - o.left) + 8) };
|
|
395
|
+
}
|
|
396
|
+
function ve({ row: t, actions: s }) {
|
|
397
|
+
const o = s.prefs.alerts.filter((n) => n.key === t.key);
|
|
398
|
+
if (o.length === 0) return null;
|
|
399
|
+
const r = A(o[0]) + (o.length > 1 ? ` +${o.length - 1}` : "");
|
|
400
|
+
return /* @__PURE__ */ l("span", { "data-tip": r, "data-watch-alert-mark": !0, className: "flex text-nvr-cyan", children: [
|
|
401
|
+
/* @__PURE__ */ e(P, { "aria-hidden": !0, className: "h-3 w-3" }),
|
|
402
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: [
|
|
403
|
+
"Alert: ",
|
|
404
|
+
r
|
|
405
|
+
] })
|
|
406
|
+
] });
|
|
407
|
+
}
|
|
408
|
+
function ye({ row: t, actions: s }) {
|
|
409
|
+
const o = s.prefs.pins.find((n) => n.key === t.key);
|
|
410
|
+
if (!(o != null && o.auto)) return null;
|
|
411
|
+
const r = s.prefs.settings.auto_remove ? "Pinned for you: it landed on your step. It unpins when it leaves your step." : "Pinned for you: it landed on your step.";
|
|
412
|
+
return /* @__PURE__ */ l(
|
|
413
|
+
"span",
|
|
414
|
+
{
|
|
415
|
+
"data-tip": r,
|
|
416
|
+
"data-watch-auto-pin": !0,
|
|
417
|
+
className: "inline-flex h-4 items-center rounded px-1 text-[10px] font-medium text-slate-500 ring-1 ring-inset ring-slate-200 dark:text-slate-400 dark:ring-white/[0.12]",
|
|
418
|
+
children: [
|
|
419
|
+
"For you",
|
|
420
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: [
|
|
421
|
+
". ",
|
|
422
|
+
r
|
|
423
|
+
] })
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
function ke({ row: t, actions: s }) {
|
|
429
|
+
const [o, r] = f(!1), [n, c] = f(!1), [p, h] = f({
|
|
430
|
+
side: "left",
|
|
431
|
+
sideOffset: 6
|
|
432
|
+
}), a = Y(null), m = s.prefs.alerts.filter((x) => x.key === t.key), d = m.length > 0, i = t.title ?? t.collection_label;
|
|
433
|
+
return /* @__PURE__ */ l(
|
|
434
|
+
_,
|
|
394
435
|
{
|
|
395
|
-
open:
|
|
396
|
-
onOpenChange: (
|
|
397
|
-
h(
|
|
436
|
+
open: o,
|
|
437
|
+
onOpenChange: (x) => {
|
|
438
|
+
x && (h(le(a.current)), c(!d)), r(x);
|
|
398
439
|
},
|
|
399
440
|
children: [
|
|
400
|
-
/* @__PURE__ */ e(
|
|
441
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
401
442
|
"button",
|
|
402
443
|
{
|
|
444
|
+
ref: a,
|
|
403
445
|
type: "button",
|
|
404
|
-
"aria-label":
|
|
405
|
-
"data-tip":
|
|
406
|
-
"data-watch-alert":
|
|
407
|
-
onClick: (
|
|
408
|
-
className: `flex h-6 w-6 items-center justify-center rounded-md transition-colors focus-visible:visible focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 group-hover/row:visible ${
|
|
409
|
-
children:
|
|
446
|
+
"aria-label": d ? `Alerts on ${i} (${m.length})` : `Add an alert on ${i}`,
|
|
447
|
+
"data-tip": d ? A(m[0]) + (m.length > 1 ? ` +${m.length - 1}` : "") : "Alert me when…",
|
|
448
|
+
"data-watch-alert": d ? "on" : "off",
|
|
449
|
+
onClick: (x) => x.stopPropagation(),
|
|
450
|
+
className: `flex h-6 w-6 items-center justify-center rounded-md transition-colors focus-visible:visible focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 group-hover/row:visible ${o ? "" : "invisible"} ${d ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 dark:text-slate-500 dark:hover:bg-white/[0.08] dark:hover:text-slate-200"}`,
|
|
451
|
+
children: d ? /* @__PURE__ */ e(P, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" })
|
|
410
452
|
}
|
|
411
453
|
) }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
454
|
+
/* @__PURE__ */ l(
|
|
455
|
+
O,
|
|
414
456
|
{
|
|
415
|
-
align: "end",
|
|
416
|
-
side:
|
|
417
|
-
|
|
418
|
-
|
|
457
|
+
align: p.side === "left" ? "start" : "end",
|
|
458
|
+
side: p.side,
|
|
459
|
+
sideOffset: p.sideOffset,
|
|
460
|
+
collisionPadding: { top: 56, bottom: 12, left: 12, right: 12 },
|
|
461
|
+
className: "w-[296px] max-w-[calc(100vw-24px)] p-3",
|
|
462
|
+
onClick: (x) => x.stopPropagation(),
|
|
419
463
|
children: [
|
|
420
464
|
/* @__PURE__ */ e("p", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: "Tell me when…" }),
|
|
421
|
-
/* @__PURE__ */ e("p", { className: "mb-2 truncate text-[11.5px] text-slate-500 dark:text-slate-400", children:
|
|
422
|
-
|
|
465
|
+
/* @__PURE__ */ e("p", { className: "mb-2 truncate text-[11.5px] text-slate-500 dark:text-slate-400", children: i }),
|
|
466
|
+
d && /* @__PURE__ */ e("ul", { className: "mb-2 space-y-0.5", "aria-label": "Alerts on this record", children: m.map((x) => /* @__PURE__ */ l(
|
|
423
467
|
"li",
|
|
424
468
|
{
|
|
425
|
-
className: "flex items-
|
|
469
|
+
className: "flex items-start gap-2 rounded-md bg-slate-50 py-1 pl-2 pr-1 text-[12px] text-slate-700 dark:bg-white/[0.04] dark:text-slate-200",
|
|
426
470
|
children: [
|
|
427
|
-
/* @__PURE__ */ e(
|
|
428
|
-
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1
|
|
471
|
+
/* @__PURE__ */ e(P, { "aria-hidden": !0, className: "mt-[3px] h-3 w-3 shrink-0 text-nvr-cyan" }),
|
|
472
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 break-words py-px leading-snug", children: A(x) }),
|
|
429
473
|
/* @__PURE__ */ e(
|
|
430
474
|
"button",
|
|
431
475
|
{
|
|
432
476
|
type: "button",
|
|
433
|
-
"aria-label": `Remove alert: ${A(
|
|
434
|
-
onClick: () => void
|
|
477
|
+
"aria-label": `Remove alert: ${A(x)}`,
|
|
478
|
+
onClick: () => void s.removeAlert(x.id).catch(() => {
|
|
435
479
|
}),
|
|
436
480
|
className: "flex h-5 w-5 shrink-0 items-center justify-center rounded text-slate-400 hover:bg-slate-200/70 hover:text-slate-700 dark:hover:bg-white/[0.08] dark:hover:text-slate-200",
|
|
437
|
-
children: /* @__PURE__ */ e(
|
|
481
|
+
children: /* @__PURE__ */ e(B, { className: "h-3 w-3" })
|
|
438
482
|
}
|
|
439
483
|
)
|
|
440
484
|
]
|
|
441
485
|
},
|
|
442
|
-
|
|
486
|
+
x.id
|
|
443
487
|
)) }),
|
|
444
|
-
|
|
488
|
+
n ? /* @__PURE__ */ e(se, { row: t, actions: s, onDone: () => c(!1) }) : /* @__PURE__ */ l(
|
|
445
489
|
"button",
|
|
446
490
|
{
|
|
447
491
|
type: "button",
|
|
448
|
-
onClick: () =>
|
|
492
|
+
onClick: () => c(!0),
|
|
449
493
|
className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
450
494
|
children: [
|
|
451
|
-
/* @__PURE__ */ e(
|
|
495
|
+
/* @__PURE__ */ e(q, { className: "h-3.5 w-3.5" }),
|
|
452
496
|
"Add another"
|
|
453
497
|
]
|
|
454
498
|
}
|
|
@@ -460,80 +504,80 @@ function fe({ row: t, actions: r }) {
|
|
|
460
504
|
}
|
|
461
505
|
);
|
|
462
506
|
}
|
|
463
|
-
function
|
|
507
|
+
function ne({
|
|
464
508
|
value: t,
|
|
465
|
-
onChange:
|
|
466
|
-
meId:
|
|
509
|
+
onChange: s,
|
|
510
|
+
meId: o
|
|
467
511
|
}) {
|
|
468
|
-
const
|
|
469
|
-
queryKey: ["watch-list", "people",
|
|
470
|
-
queryFn: () =>
|
|
471
|
-
(
|
|
472
|
-
id: String(
|
|
473
|
-
name: `${
|
|
474
|
-
email:
|
|
512
|
+
const r = E(), [n, c] = f(""), p = n.trim(), h = L({
|
|
513
|
+
queryKey: ["watch-list", "people", p],
|
|
514
|
+
queryFn: () => r.request(F("/users", { search: p, limit: 8 })).then(
|
|
515
|
+
(d) => (d.data ?? []).map((i) => ({
|
|
516
|
+
id: String(i.id),
|
|
517
|
+
name: `${i.first_name ?? ""} ${i.last_name ?? ""}`.trim() || i.email || "Someone",
|
|
518
|
+
email: i.email
|
|
475
519
|
}))
|
|
476
520
|
),
|
|
477
|
-
enabled: !!
|
|
521
|
+
enabled: !!r && p.length > 1,
|
|
478
522
|
staleTime: 3e4
|
|
479
|
-
}), a = new Set(t.map((
|
|
480
|
-
return /* @__PURE__ */
|
|
481
|
-
t.length > 0 && /* @__PURE__ */ e("ul", { className: "mb-2 flex flex-wrap gap-1.5", "aria-label": "People on this list", children: t.map((
|
|
523
|
+
}), a = new Set(t.map((d) => d.id.toLowerCase())), m = (h.data ?? []).filter((d) => !a.has(d.id.toLowerCase()));
|
|
524
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
525
|
+
t.length > 0 && /* @__PURE__ */ e("ul", { className: "mb-2 flex flex-wrap gap-1.5", "aria-label": "People on this list", children: t.map((d) => /* @__PURE__ */ l(
|
|
482
526
|
"li",
|
|
483
527
|
{
|
|
484
528
|
className: "inline-flex items-center gap-1 rounded-full bg-slate-100 py-0.5 pl-2.5 pr-1 text-[12px] text-slate-700 dark:bg-white/[0.07] dark:text-slate-200",
|
|
485
529
|
children: [
|
|
486
|
-
|
|
487
|
-
|
|
530
|
+
d.name,
|
|
531
|
+
o && d.id.toLowerCase() === o.toLowerCase() && /* @__PURE__ */ e("span", { className: "text-slate-500 dark:text-slate-400", children: "(you)" }),
|
|
488
532
|
/* @__PURE__ */ e(
|
|
489
533
|
"button",
|
|
490
534
|
{
|
|
491
535
|
type: "button",
|
|
492
|
-
"aria-label": `Take ${
|
|
493
|
-
onClick: () =>
|
|
536
|
+
"aria-label": `Take ${d.name} off the list`,
|
|
537
|
+
onClick: () => s(t.filter((i) => i.id !== d.id)),
|
|
494
538
|
className: "flex h-4 w-4 items-center justify-center rounded-full text-slate-400 hover:bg-slate-200 hover:text-slate-700 dark:hover:bg-white/[0.1] dark:hover:text-slate-200",
|
|
495
|
-
children: /* @__PURE__ */ e(
|
|
539
|
+
children: /* @__PURE__ */ e(B, { className: "h-2.5 w-2.5" })
|
|
496
540
|
}
|
|
497
541
|
)
|
|
498
542
|
]
|
|
499
543
|
},
|
|
500
|
-
|
|
544
|
+
d.id
|
|
501
545
|
)) }),
|
|
502
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ l("div", { className: "relative", children: [
|
|
503
547
|
/* @__PURE__ */ e(
|
|
504
548
|
"input",
|
|
505
549
|
{
|
|
506
|
-
value:
|
|
507
|
-
onChange: (
|
|
550
|
+
value: n,
|
|
551
|
+
onChange: (d) => c(d.target.value),
|
|
508
552
|
placeholder: "Add someone by name",
|
|
509
553
|
"aria-label": "Add someone by name",
|
|
510
554
|
className: "h-8 w-full rounded-md border border-border bg-background px-2.5 text-[12.5px] text-slate-800 outline-none placeholder:text-slate-400 focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-slate-100"
|
|
511
555
|
}
|
|
512
556
|
),
|
|
513
|
-
|
|
557
|
+
p.length > 1 && (m.length > 0 || h.isSuccess) && /* @__PURE__ */ l(
|
|
514
558
|
"div",
|
|
515
559
|
{
|
|
516
560
|
role: "listbox",
|
|
517
561
|
"aria-label": "People",
|
|
518
562
|
className: "absolute left-0 right-0 z-10 mt-1 max-h-48 overflow-y-auto rounded-md border border-border bg-popover p-1 shadow-md",
|
|
519
563
|
children: [
|
|
520
|
-
|
|
521
|
-
|
|
564
|
+
m.length === 0 && /* @__PURE__ */ e("p", { className: "px-2 py-1.5 text-[12px] text-slate-500 dark:text-slate-400", children: "Nobody else matches" }),
|
|
565
|
+
m.map((d) => /* @__PURE__ */ l(
|
|
522
566
|
"button",
|
|
523
567
|
{
|
|
524
568
|
type: "button",
|
|
525
569
|
role: "option",
|
|
526
570
|
"aria-selected": !1,
|
|
527
571
|
onClick: () => {
|
|
528
|
-
|
|
572
|
+
s([...t, d]), c("");
|
|
529
573
|
},
|
|
530
574
|
className: "block w-full rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
531
575
|
children: [
|
|
532
|
-
|
|
533
|
-
|
|
576
|
+
d.name,
|
|
577
|
+
d.email && /* @__PURE__ */ e("span", { className: "ml-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: d.email })
|
|
534
578
|
]
|
|
535
579
|
},
|
|
536
|
-
|
|
580
|
+
d.id
|
|
537
581
|
))
|
|
538
582
|
]
|
|
539
583
|
}
|
|
@@ -541,35 +585,35 @@ function se({
|
|
|
541
585
|
] })
|
|
542
586
|
] });
|
|
543
587
|
}
|
|
544
|
-
function
|
|
588
|
+
function we({
|
|
545
589
|
actions: t,
|
|
546
|
-
team:
|
|
547
|
-
meId:
|
|
548
|
-
meName:
|
|
549
|
-
onClose:
|
|
550
|
-
onCreated:
|
|
590
|
+
team: s,
|
|
591
|
+
meId: o,
|
|
592
|
+
meName: r,
|
|
593
|
+
onClose: n,
|
|
594
|
+
onCreated: c
|
|
551
595
|
}) {
|
|
552
|
-
const [
|
|
553
|
-
() =>
|
|
554
|
-
), [
|
|
555
|
-
const
|
|
556
|
-
if (!(!
|
|
596
|
+
const [p, h] = f((s == null ? void 0 : s.name) ?? ""), [a, m] = f(
|
|
597
|
+
() => s ? s.members.map((b) => ({ id: b.id, name: b.name })) : o ? [{ id: o, name: r || "You" }] : []
|
|
598
|
+
), [d, i] = f(!1), [x, N] = f(s ? !!s.remove_completed : !0), [v, y] = f(!1), C = t.prefs.direct_reports ?? 0, R = async () => {
|
|
599
|
+
const b = p.trim();
|
|
600
|
+
if (!(!b || v)) {
|
|
557
601
|
y(!0);
|
|
558
602
|
try {
|
|
559
|
-
if (
|
|
560
|
-
await t.editTeam(
|
|
561
|
-
name:
|
|
562
|
-
members: a.map((
|
|
563
|
-
remove_completed:
|
|
564
|
-
}),
|
|
603
|
+
if (s)
|
|
604
|
+
await t.editTeam(s.id, {
|
|
605
|
+
name: b,
|
|
606
|
+
members: a.map((g) => g.id),
|
|
607
|
+
remove_completed: x
|
|
608
|
+
}), n();
|
|
565
609
|
else {
|
|
566
|
-
const
|
|
567
|
-
name:
|
|
568
|
-
members: a.map((
|
|
569
|
-
reports:
|
|
570
|
-
remove_completed:
|
|
610
|
+
const g = await t.createTeam({
|
|
611
|
+
name: b,
|
|
612
|
+
members: a.map((u) => u.id),
|
|
613
|
+
reports: d,
|
|
614
|
+
remove_completed: x
|
|
571
615
|
});
|
|
572
|
-
|
|
616
|
+
g ? c(g) : n();
|
|
573
617
|
}
|
|
574
618
|
} catch {
|
|
575
619
|
} finally {
|
|
@@ -577,26 +621,26 @@ function ve({
|
|
|
577
621
|
}
|
|
578
622
|
}
|
|
579
623
|
};
|
|
580
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ l(
|
|
581
625
|
"form",
|
|
582
626
|
{
|
|
583
627
|
className: "space-y-4 px-4 py-4",
|
|
584
|
-
onSubmit: (
|
|
585
|
-
|
|
628
|
+
onSubmit: (b) => {
|
|
629
|
+
b.preventDefault(), R();
|
|
586
630
|
},
|
|
587
631
|
"data-watch-team-editor": !0,
|
|
588
632
|
children: [
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children:
|
|
633
|
+
/* @__PURE__ */ l("div", { children: [
|
|
634
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: s ? "Change shared list" : "New shared list" }),
|
|
591
635
|
/* @__PURE__ */ e("p", { className: "mt-0.5 text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "Everyone on it sees it as a tab here and can add records. Each person only sees the records they can open." })
|
|
592
636
|
] }),
|
|
593
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ l("label", { className: "block", children: [
|
|
594
638
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Name" }),
|
|
595
639
|
/* @__PURE__ */ e(
|
|
596
640
|
"input",
|
|
597
641
|
{
|
|
598
|
-
value:
|
|
599
|
-
onChange: (
|
|
642
|
+
value: p,
|
|
643
|
+
onChange: (b) => h(b.target.value),
|
|
600
644
|
maxLength: 60,
|
|
601
645
|
placeholder: "Night shift, Region East…",
|
|
602
646
|
autoFocus: !0,
|
|
@@ -604,16 +648,16 @@ function ve({
|
|
|
604
648
|
}
|
|
605
649
|
)
|
|
606
650
|
] }),
|
|
607
|
-
/* @__PURE__ */
|
|
651
|
+
/* @__PURE__ */ l("div", { children: [
|
|
608
652
|
/* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "People" }),
|
|
609
|
-
/* @__PURE__ */ e(
|
|
610
|
-
!
|
|
653
|
+
/* @__PURE__ */ e(ne, { value: a, onChange: m, meId: o }),
|
|
654
|
+
!s && C > 0 && /* @__PURE__ */ l("label", { className: "mt-2 flex items-center gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
611
655
|
/* @__PURE__ */ e(
|
|
612
656
|
"input",
|
|
613
657
|
{
|
|
614
658
|
type: "checkbox",
|
|
615
|
-
checked:
|
|
616
|
-
onChange: (
|
|
659
|
+
checked: d,
|
|
660
|
+
onChange: (b) => i(b.target.checked),
|
|
617
661
|
className: "h-3.5 w-3.5 rounded border-slate-300 accent-[var(--nvr-cyan,#00ceff)]"
|
|
618
662
|
}
|
|
619
663
|
),
|
|
@@ -622,27 +666,27 @@ function ve({
|
|
|
622
666
|
")"
|
|
623
667
|
] })
|
|
624
668
|
] }),
|
|
625
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ l("label", { className: "flex items-start gap-2 text-[12px] text-slate-700 dark:text-slate-200", children: [
|
|
626
670
|
/* @__PURE__ */ e(
|
|
627
671
|
"input",
|
|
628
672
|
{
|
|
629
673
|
type: "checkbox",
|
|
630
|
-
checked:
|
|
631
|
-
onChange: (
|
|
674
|
+
checked: x,
|
|
675
|
+
onChange: (b) => N(b.target.checked),
|
|
632
676
|
className: "mt-0.5 h-3.5 w-3.5 rounded border-slate-300 accent-[var(--nvr-cyan,#00ceff)]"
|
|
633
677
|
}
|
|
634
678
|
),
|
|
635
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ l("span", { children: [
|
|
636
680
|
"Remove records when they’re completed",
|
|
637
681
|
/* @__PURE__ */ e("span", { className: "mt-0.5 block text-[11.5px] leading-snug text-slate-500 dark:text-slate-400", children: "They show “Completed”, then leave the list 24 hours later. Recently removed keeps them 7 days, with Undo." })
|
|
638
682
|
] })
|
|
639
683
|
] }),
|
|
640
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
|
|
641
685
|
/* @__PURE__ */ e(
|
|
642
686
|
"button",
|
|
643
687
|
{
|
|
644
688
|
type: "button",
|
|
645
|
-
onClick:
|
|
689
|
+
onClick: n,
|
|
646
690
|
className: "rounded-md px-3 py-1.5 text-[12px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
|
|
647
691
|
children: "Cancel"
|
|
648
692
|
}
|
|
@@ -651,9 +695,9 @@ function ve({
|
|
|
651
695
|
"button",
|
|
652
696
|
{
|
|
653
697
|
type: "submit",
|
|
654
|
-
disabled: !
|
|
655
|
-
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-
|
|
656
|
-
children:
|
|
698
|
+
disabled: !p.trim() || v,
|
|
699
|
+
className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-semibold text-white transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:bg-slate-100 disabled:font-medium disabled:text-slate-400 disabled:hover:opacity-100 dark:disabled:bg-white/[0.06] dark:disabled:!text-slate-500",
|
|
700
|
+
children: v ? "Saving…" : s ? "Save" : "Make list"
|
|
657
701
|
}
|
|
658
702
|
)
|
|
659
703
|
] })
|
|
@@ -661,39 +705,39 @@ function ve({
|
|
|
661
705
|
}
|
|
662
706
|
);
|
|
663
707
|
}
|
|
664
|
-
function
|
|
708
|
+
function Ne({
|
|
665
709
|
actions: t,
|
|
666
|
-
collection:
|
|
667
|
-
itemId:
|
|
668
|
-
size:
|
|
710
|
+
collection: s,
|
|
711
|
+
itemId: o,
|
|
712
|
+
size: r = "md"
|
|
669
713
|
}) {
|
|
670
|
-
const
|
|
671
|
-
if (
|
|
672
|
-
const
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
/* @__PURE__ */ e(
|
|
714
|
+
const n = t.prefs.teams.filter((a) => (a.is_member || a.can_manage) && !a.owner_gone), c = `${s}:${o}`, p = n.filter((a) => a.pins.some((m) => m.key === c)).length;
|
|
715
|
+
if (n.length === 0) return null;
|
|
716
|
+
const h = r === "sm" ? "h-3 w-3" : "h-3.5 w-3.5";
|
|
717
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
718
|
+
/* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(
|
|
675
719
|
"button",
|
|
676
720
|
{
|
|
677
721
|
type: "button",
|
|
678
|
-
"aria-label":
|
|
679
|
-
"data-tip":
|
|
680
|
-
"data-watch-share":
|
|
722
|
+
"aria-label": p > 0 ? `On ${p} shared list${p === 1 ? "" : "s"}` : "Add to a shared list",
|
|
723
|
+
"data-tip": p > 0 ? `On ${p} shared list${p === 1 ? "" : "s"}` : "Add to a shared list",
|
|
724
|
+
"data-watch-share": p > 0 ? "on" : "off",
|
|
681
725
|
onClick: (a) => a.stopPropagation(),
|
|
682
|
-
className: `inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${
|
|
683
|
-
children: /* @__PURE__ */ e(
|
|
726
|
+
className: `inline-flex shrink-0 items-center justify-center rounded-md transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 ${r === "sm" ? "h-6 w-6" : "h-7 w-7"} ${p > 0 ? "text-nvr-cyan hover:bg-nvr-cyan/10" : "text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:text-slate-500 dark:hover:bg-white/[0.06] dark:hover:text-slate-300"}`,
|
|
727
|
+
children: /* @__PURE__ */ e(D, { className: h })
|
|
684
728
|
}
|
|
685
729
|
) }),
|
|
686
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ l(O, { align: "start", className: "w-60 p-1", onClick: (a) => a.stopPropagation(), children: [
|
|
687
731
|
/* @__PURE__ */ e("p", { className: "px-2 pb-1 pt-1.5 text-[11px] font-semibold text-slate-500 dark:text-slate-400", children: "Shared lists" }),
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
return /* @__PURE__ */
|
|
732
|
+
n.map((a) => {
|
|
733
|
+
const m = a.pins.some((d) => d.key === c);
|
|
734
|
+
return /* @__PURE__ */ l(
|
|
691
735
|
"button",
|
|
692
736
|
{
|
|
693
737
|
type: "button",
|
|
694
738
|
role: "menuitemcheckbox",
|
|
695
|
-
"aria-checked":
|
|
696
|
-
onClick: () => void (
|
|
739
|
+
"aria-checked": m,
|
|
740
|
+
onClick: () => void (m ? t.teamUnpin(a.id, s, o) : t.teamPin(a.id, s, o)).catch(() => {
|
|
697
741
|
}),
|
|
698
742
|
className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] text-slate-700 hover:bg-muted dark:text-slate-200",
|
|
699
743
|
children: [
|
|
@@ -701,8 +745,8 @@ function ge({
|
|
|
701
745
|
"span",
|
|
702
746
|
{
|
|
703
747
|
"aria-hidden": !0,
|
|
704
|
-
className: `flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border ${
|
|
705
|
-
children:
|
|
748
|
+
className: `flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded border ${m ? "border-nvr-cyan bg-nvr-cyan text-white" : "border-slate-300 dark:border-white/20"}`,
|
|
749
|
+
children: m && /* @__PURE__ */ e(j, { className: "h-2.5 w-2.5", strokeWidth: 3 })
|
|
706
750
|
}
|
|
707
751
|
),
|
|
708
752
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: a.name })
|
|
@@ -715,9 +759,11 @@ function ge({
|
|
|
715
759
|
] });
|
|
716
760
|
}
|
|
717
761
|
export {
|
|
718
|
-
|
|
719
|
-
ve as
|
|
720
|
-
|
|
721
|
-
|
|
762
|
+
ke as AlertButton,
|
|
763
|
+
ve as AlertMark,
|
|
764
|
+
ye as AutoPinMark,
|
|
765
|
+
we as TeamEditor,
|
|
766
|
+
ge as WatchSettingsMenu,
|
|
767
|
+
Ne as WatchShareMenu,
|
|
722
768
|
A as alertWords
|
|
723
769
|
};
|