@nivaro/react 0.3.117 → 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 +136 -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 +3757 -3695
- 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/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/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/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/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
- 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/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useMemo as L, useCallback as
|
|
1
|
+
import { useQueryClient as te, useMutation as ne, useQuery as ae } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo as L, useCallback as h, useSyncExternalStore as se } from "react";
|
|
3
3
|
import { useOptionalNivaroClient as z } from "../context.js";
|
|
4
|
-
import { post as
|
|
4
|
+
import { post as p, del as M, patch as D, put as ie, get as re } from "./commands.js";
|
|
5
5
|
import { toastError as $ } from "./error-toast.js";
|
|
6
|
-
const
|
|
6
|
+
const oe = {
|
|
7
7
|
state: "open",
|
|
8
8
|
width: 320,
|
|
9
9
|
tab: "watching",
|
|
10
10
|
sort: "mine"
|
|
11
|
-
},
|
|
11
|
+
}, pe = 280, ye = 480, Q = 1180, N = {
|
|
12
12
|
all: ["watch-list"],
|
|
13
13
|
prefs: ["watch-list", "prefs"],
|
|
14
14
|
rows: (t) => ["watch-list", "rows", t],
|
|
@@ -17,17 +17,17 @@ const re = {
|
|
|
17
17
|
mentions: ["watch-list", "mentions"],
|
|
18
18
|
team: (t, a) => ["watch-list", "team", t, a],
|
|
19
19
|
alertOptions: (t, a) => ["watch-list", "alert-options", t, a]
|
|
20
|
-
},
|
|
20
|
+
}, ce = {
|
|
21
21
|
desktop: !1,
|
|
22
22
|
auto_add: !1,
|
|
23
23
|
auto_remove: !1,
|
|
24
24
|
digest: !1,
|
|
25
25
|
remove_completed: !1
|
|
26
|
-
},
|
|
26
|
+
}, v = (t, a) => `${t}:${a}`;
|
|
27
27
|
function ge(t) {
|
|
28
28
|
return t.map((a) => a.key).join("|");
|
|
29
29
|
}
|
|
30
|
-
let
|
|
30
|
+
let m = {
|
|
31
31
|
sheet: !1,
|
|
32
32
|
localChanged: /* @__PURE__ */ new Set(),
|
|
33
33
|
changed: 0,
|
|
@@ -36,64 +36,64 @@ let f = {
|
|
|
36
36
|
seenLocal: /* @__PURE__ */ new Map(),
|
|
37
37
|
wide: typeof window > "u" ? !0 : window.innerWidth >= Q
|
|
38
38
|
};
|
|
39
|
-
const
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
for (const a of
|
|
39
|
+
const T = /* @__PURE__ */ new Set();
|
|
40
|
+
function y(t) {
|
|
41
|
+
m = { ...m, ...t };
|
|
42
|
+
for (const a of T) a();
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
return
|
|
46
|
-
|
|
44
|
+
function ue(t) {
|
|
45
|
+
return T.add(t), T.size === 1 && typeof window < "u" && (window.addEventListener("resize", x), x()), () => {
|
|
46
|
+
T.delete(t), T.size === 0 && typeof window < "u" && window.removeEventListener("resize", x);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
function x() {
|
|
50
50
|
const t = window.innerWidth >= Q;
|
|
51
|
-
t !==
|
|
51
|
+
t !== m.wide && y({ wide: t, ...t ? { sheet: !1 } : {} });
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
() =>
|
|
57
|
-
() =>
|
|
53
|
+
function ve() {
|
|
54
|
+
return se(
|
|
55
|
+
ue,
|
|
56
|
+
() => m,
|
|
57
|
+
() => m
|
|
58
58
|
);
|
|
59
59
|
}
|
|
60
60
|
const W = {
|
|
61
61
|
publish(t) {
|
|
62
|
-
(t.changed !==
|
|
62
|
+
(t.changed !== m.changed || t.unreadMentions !== m.unreadMentions) && y(t);
|
|
63
63
|
},
|
|
64
64
|
setMounted(t) {
|
|
65
|
-
t !==
|
|
65
|
+
t !== m.mounted && y({ mounted: t });
|
|
66
66
|
},
|
|
67
|
-
openSheet: () =>
|
|
68
|
-
closeSheet: () =>
|
|
67
|
+
openSheet: () => y({ sheet: !0 }),
|
|
68
|
+
closeSheet: () => y({ sheet: !1 }),
|
|
69
69
|
markLocal(t) {
|
|
70
70
|
if (t.length === 0) return;
|
|
71
|
-
const a = new Set(
|
|
72
|
-
for (const
|
|
73
|
-
a.size !==
|
|
71
|
+
const a = new Set(m.localChanged);
|
|
72
|
+
for (const i of t) a.add(i);
|
|
73
|
+
a.size !== m.localChanged.size && y({ localChanged: a });
|
|
74
74
|
},
|
|
75
75
|
noteSeen(t, a) {
|
|
76
|
-
const
|
|
77
|
-
for (const
|
|
78
|
-
|
|
76
|
+
const i = new Map(m.seenLocal), c = Date.now();
|
|
77
|
+
for (const d of t ?? a) i.set(d, c);
|
|
78
|
+
y({ seenLocal: i });
|
|
79
79
|
},
|
|
80
80
|
clearLocal(t) {
|
|
81
81
|
if (!t) {
|
|
82
|
-
|
|
82
|
+
m.localChanged.size && y({ localChanged: /* @__PURE__ */ new Set() });
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
const a = new Set(
|
|
86
|
-
for (const
|
|
87
|
-
a.size !==
|
|
85
|
+
const a = new Set(m.localChanged);
|
|
86
|
+
for (const i of t) a.delete(i);
|
|
87
|
+
a.size !== m.localChanged.size && y({ localChanged: a });
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
function R() {
|
|
91
91
|
return {
|
|
92
92
|
pins: [],
|
|
93
|
-
dock:
|
|
93
|
+
dock: oe,
|
|
94
94
|
replies_seen_at: null,
|
|
95
95
|
max: 50,
|
|
96
|
-
settings:
|
|
96
|
+
settings: ce,
|
|
97
97
|
alerts: [],
|
|
98
98
|
teams: [],
|
|
99
99
|
removed: []
|
|
@@ -110,10 +110,10 @@ function O(t) {
|
|
|
110
110
|
removed: t.removed ?? []
|
|
111
111
|
} : a;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const t = z(), a =
|
|
115
|
-
queryKey:
|
|
116
|
-
queryFn: () => t.request(
|
|
113
|
+
function le() {
|
|
114
|
+
const t = z(), a = ae({
|
|
115
|
+
queryKey: N.prefs,
|
|
116
|
+
queryFn: () => t.request(re("/watch-list/prefs")).then((i) => i.data),
|
|
117
117
|
enabled: !!t,
|
|
118
118
|
staleTime: 5 * 6e4,
|
|
119
119
|
gcTime: 30 * 6e4,
|
|
@@ -122,326 +122,327 @@ function ue() {
|
|
|
122
122
|
return { prefs: L(() => O(a.data), [a.data]), ready: a.isSuccess };
|
|
123
123
|
}
|
|
124
124
|
let U = 0, A = 0, K = !1;
|
|
125
|
-
function
|
|
126
|
-
const t = z(), a =
|
|
125
|
+
function Ce() {
|
|
126
|
+
const t = z(), a = te(), { prefs: i, ready: c } = le(), d = L(() => new Set(i.pins.map((n) => n.key)), [i.pins]), l = h(
|
|
127
127
|
(n) => {
|
|
128
|
-
a.setQueryData(
|
|
128
|
+
a.setQueryData(N.prefs, (e) => n(e ?? R()));
|
|
129
129
|
},
|
|
130
130
|
[a]
|
|
131
|
-
),
|
|
131
|
+
), w = h(
|
|
132
132
|
(n) => {
|
|
133
133
|
n != null && n.data && a.setQueryData(
|
|
134
|
-
|
|
134
|
+
N.prefs,
|
|
135
135
|
(e) => O({ direct_reports: e == null ? void 0 : e.direct_reports, me: e == null ? void 0 : e.me, ...n.data })
|
|
136
136
|
);
|
|
137
137
|
},
|
|
138
138
|
[a]
|
|
139
|
-
),
|
|
139
|
+
), S = ne({
|
|
140
140
|
mutationFn: async (n) => t.request(n)
|
|
141
|
-
}),
|
|
141
|
+
}), u = h(
|
|
142
142
|
async (n, e) => {
|
|
143
143
|
if (!t) return;
|
|
144
144
|
const s = ++U;
|
|
145
145
|
A++;
|
|
146
146
|
try {
|
|
147
|
-
const
|
|
148
|
-
s === U ?
|
|
149
|
-
} catch (
|
|
150
|
-
throw a.invalidateQueries({ queryKey:
|
|
147
|
+
const o = await S.mutateAsync(n);
|
|
148
|
+
s === U ? w(o) : K = !0;
|
|
149
|
+
} catch (o) {
|
|
150
|
+
throw a.invalidateQueries({ queryKey: N.prefs }), $(o, e), o;
|
|
151
151
|
} finally {
|
|
152
|
-
A--, A === 0 && (K && (K = !1, a.invalidateQueries({ queryKey:
|
|
152
|
+
A--, A === 0 && (K && (K = !1, a.invalidateQueries({ queryKey: N.prefs })), a.invalidateQueries({ queryKey: ["watch-list", "rows"] }), a.invalidateQueries({ queryKey: ["watch-list", "summary"] }));
|
|
153
153
|
}
|
|
154
154
|
},
|
|
155
|
-
[t,
|
|
156
|
-
), C =
|
|
155
|
+
[t, S, a, w]
|
|
156
|
+
), C = h(
|
|
157
157
|
async (n, e) => {
|
|
158
|
-
const s =
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
...
|
|
163
|
-
pins: [{ key: s, collection: n, id: String(e), pinned_at:
|
|
164
|
-
})), await
|
|
165
|
-
|
|
158
|
+
const s = v(n, e);
|
|
159
|
+
if (d.has(s)) return;
|
|
160
|
+
const o = (/* @__PURE__ */ new Date()).toISOString();
|
|
161
|
+
l((r) => ({
|
|
162
|
+
...r,
|
|
163
|
+
pins: [{ key: s, collection: n, id: String(e), pinned_at: o }, ...r.pins]
|
|
164
|
+
})), await u(
|
|
165
|
+
p("/watch-list/pins", { collection: n, id: String(e) }),
|
|
166
166
|
"Could not add it to your watch list"
|
|
167
167
|
);
|
|
168
168
|
},
|
|
169
|
-
[
|
|
170
|
-
), _ =
|
|
169
|
+
[l, d, u]
|
|
170
|
+
), _ = h(
|
|
171
171
|
async (n, e) => {
|
|
172
|
-
const s =
|
|
173
|
-
|
|
172
|
+
const s = v(n, e);
|
|
173
|
+
l((o) => ({ ...o, pins: o.pins.filter((r) => r.key !== s) })), W.clearLocal([s]), await u(
|
|
174
174
|
M(`/watch-list/pins/${encodeURIComponent(n)}/${encodeURIComponent(String(e))}`),
|
|
175
175
|
"Could not remove it from your watch list"
|
|
176
176
|
);
|
|
177
177
|
},
|
|
178
|
-
[
|
|
179
|
-
),
|
|
178
|
+
[l, u]
|
|
179
|
+
), k = h(
|
|
180
180
|
async (n, e) => {
|
|
181
|
-
const s =
|
|
181
|
+
const s = d.has(v(n, e));
|
|
182
182
|
return s ? await _(n, e) : await C(n, e), !s;
|
|
183
183
|
},
|
|
184
|
-
[
|
|
185
|
-
),
|
|
184
|
+
[d, C, _]
|
|
185
|
+
), q = h(
|
|
186
186
|
(n) => {
|
|
187
|
-
|
|
187
|
+
l((e) => ({ ...e, dock: { ...e.dock, ...n } })), u(D("/watch-list/dock", n), "Could not save the watch list layout").catch(
|
|
188
188
|
() => {
|
|
189
189
|
}
|
|
190
190
|
);
|
|
191
191
|
},
|
|
192
|
-
[
|
|
193
|
-
),
|
|
192
|
+
[l, u]
|
|
193
|
+
), E = h(
|
|
194
194
|
(n) => {
|
|
195
|
-
|
|
196
|
-
const s = new Map(e.pins.map((
|
|
197
|
-
for (const
|
|
198
|
-
return { ...e, pins:
|
|
199
|
-
}),
|
|
195
|
+
l((e) => {
|
|
196
|
+
const s = new Map(e.pins.map((r) => [r.key, r])), o = n.map((r) => s.get(r)).filter((r) => !!r);
|
|
197
|
+
for (const r of e.pins) n.includes(r.key) || o.push(r);
|
|
198
|
+
return { ...e, pins: o };
|
|
199
|
+
}), u(ie("/watch-list/order", { keys: n }), "Could not save the new order").catch(() => {
|
|
200
200
|
});
|
|
201
201
|
},
|
|
202
|
-
[
|
|
203
|
-
),
|
|
202
|
+
[l, u]
|
|
203
|
+
), I = h(
|
|
204
204
|
(n) => {
|
|
205
205
|
W.clearLocal(n), W.noteSeen(
|
|
206
206
|
n ?? null,
|
|
207
|
-
|
|
207
|
+
i.pins.map((e) => e.key)
|
|
208
208
|
), a.setQueriesData(
|
|
209
209
|
{ queryKey: ["watch-list", "rows"] },
|
|
210
210
|
(e) => {
|
|
211
211
|
var s;
|
|
212
212
|
return e && {
|
|
213
213
|
...e,
|
|
214
|
-
changed: n ? e.changed.filter((
|
|
214
|
+
changed: n ? e.changed.filter((o) => !n.includes(o)) : [],
|
|
215
215
|
rows: (s = e.rows) == null ? void 0 : s.map(
|
|
216
|
-
(
|
|
216
|
+
(o) => o.change && (!n || n.includes(o.key)) ? { ...o, change: { ...o.change, changed: !1, unseen: 0 } } : o
|
|
217
217
|
)
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
), a.setQueriesData(
|
|
221
221
|
{ queryKey: ["watch-list", "summary"] },
|
|
222
222
|
(e) => e && { ...e, changed: n ? e.changed.filter((s) => !n.includes(s)) : [] }
|
|
223
|
-
), t && t.request(
|
|
223
|
+
), t && t.request(p("/watch-list/seen", n ? { keys: n } : {})).then(w).catch(() => {
|
|
224
224
|
});
|
|
225
225
|
},
|
|
226
|
-
[t, a,
|
|
227
|
-
),
|
|
226
|
+
[t, a, w, i.pins]
|
|
227
|
+
), P = h(
|
|
228
228
|
async (n) => {
|
|
229
|
-
|
|
229
|
+
l((e) => {
|
|
230
230
|
const s = { ...e.settings, ...n };
|
|
231
231
|
return s.auto_add || (s.auto_remove = !1), { ...e, settings: s };
|
|
232
|
-
}), await
|
|
232
|
+
}), await u(D("/watch-list/settings", n), "Could not save the setting");
|
|
233
233
|
},
|
|
234
|
-
[
|
|
235
|
-
),
|
|
234
|
+
[l, u]
|
|
235
|
+
), H = h(
|
|
236
236
|
async (n) => {
|
|
237
|
-
await
|
|
237
|
+
await u(p("/watch-list/alerts", n), "Could not add the alert");
|
|
238
238
|
},
|
|
239
|
-
[
|
|
240
|
-
),
|
|
239
|
+
[u]
|
|
240
|
+
), F = h(
|
|
241
241
|
async (n) => {
|
|
242
|
-
|
|
242
|
+
l((e) => ({ ...e, alerts: e.alerts.filter((s) => s.id !== n) })), await u(
|
|
243
243
|
M(`/watch-list/alerts/${encodeURIComponent(n)}`),
|
|
244
244
|
"Could not remove the alert"
|
|
245
245
|
);
|
|
246
246
|
},
|
|
247
|
-
[
|
|
248
|
-
),
|
|
247
|
+
[l, u]
|
|
248
|
+
), j = h(
|
|
249
249
|
async (n) => {
|
|
250
250
|
if (!t) return null;
|
|
251
251
|
try {
|
|
252
252
|
const e = await t.request(
|
|
253
|
-
|
|
253
|
+
p("/watch-list/teams", n)
|
|
254
254
|
);
|
|
255
|
-
return
|
|
255
|
+
return w(e), e.data.created ?? null;
|
|
256
256
|
} catch (e) {
|
|
257
257
|
throw $(e, "Could not make the shared list"), e;
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
|
-
[t,
|
|
261
|
-
),
|
|
260
|
+
[t, w]
|
|
261
|
+
), G = h(
|
|
262
262
|
async (n, e) => {
|
|
263
|
-
await
|
|
263
|
+
await u(D(g(n), e), "Could not save the shared list");
|
|
264
264
|
},
|
|
265
|
-
[
|
|
266
|
-
),
|
|
265
|
+
[u]
|
|
266
|
+
), V = h(
|
|
267
267
|
async (n, e, s) => {
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
(
|
|
271
|
-
...
|
|
272
|
-
teams:
|
|
273
|
-
(
|
|
268
|
+
const o = v(n, e);
|
|
269
|
+
l(
|
|
270
|
+
(r) => s ? {
|
|
271
|
+
...r,
|
|
272
|
+
teams: r.teams.map(
|
|
273
|
+
(f) => f.id === s ? { ...f, removed: (f.removed ?? []).filter((b) => b.key !== o) } : f
|
|
274
274
|
)
|
|
275
|
-
} : { ...
|
|
276
|
-
), await
|
|
277
|
-
|
|
275
|
+
} : { ...r, removed: r.removed.filter((f) => f.key !== o) }
|
|
276
|
+
), await u(
|
|
277
|
+
p(s ? `${g(s)}/removed/restore` : "/watch-list/removed/restore", {
|
|
278
278
|
collection: n,
|
|
279
279
|
id: e
|
|
280
280
|
}),
|
|
281
281
|
"Could not put it back"
|
|
282
282
|
);
|
|
283
283
|
},
|
|
284
|
-
[
|
|
285
|
-
),
|
|
284
|
+
[l, u]
|
|
285
|
+
), X = h(
|
|
286
286
|
async (n) => {
|
|
287
|
-
|
|
287
|
+
l((e) => ({ ...e, teams: e.teams.filter((s) => s.id !== n) })), await u(M(g(n)), "Could not delete the shared list");
|
|
288
288
|
},
|
|
289
|
-
[
|
|
290
|
-
),
|
|
289
|
+
[l, u]
|
|
290
|
+
), B = h(
|
|
291
291
|
async (n) => {
|
|
292
|
-
|
|
292
|
+
l((e) => ({ ...e, teams: e.teams.filter((s) => s.id !== n) })), await u(p(`${g(n)}/leave`, {}), "Could not leave the shared list");
|
|
293
293
|
},
|
|
294
|
-
[
|
|
295
|
-
),
|
|
294
|
+
[l, u]
|
|
295
|
+
), J = h(
|
|
296
296
|
async (n) => {
|
|
297
297
|
if (!t) return null;
|
|
298
298
|
try {
|
|
299
299
|
const e = await t.request(
|
|
300
|
-
|
|
300
|
+
p(`${g(n)}/take-over`, {})
|
|
301
301
|
);
|
|
302
|
-
return
|
|
302
|
+
return w(e), e.data.moved ?? null;
|
|
303
303
|
} catch (e) {
|
|
304
304
|
throw $(e, "Could not take over the shared list"), e;
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
|
-
[t,
|
|
308
|
-
),
|
|
307
|
+
[t, w]
|
|
308
|
+
), Y = h(
|
|
309
309
|
async (n, e, s) => {
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
...
|
|
313
|
-
teams:
|
|
314
|
-
(
|
|
315
|
-
...
|
|
310
|
+
const o = v(e, s);
|
|
311
|
+
l((r) => ({
|
|
312
|
+
...r,
|
|
313
|
+
teams: r.teams.map(
|
|
314
|
+
(f) => f.id === n && !f.pins.some((b) => b.key === o) ? {
|
|
315
|
+
...f,
|
|
316
316
|
pins: [
|
|
317
|
-
{ key:
|
|
318
|
-
...
|
|
317
|
+
{ key: o, collection: e, id: s, pinned_at: (/* @__PURE__ */ new Date()).toISOString(), by: "" },
|
|
318
|
+
...f.pins
|
|
319
319
|
]
|
|
320
|
-
} :
|
|
320
|
+
} : f
|
|
321
321
|
)
|
|
322
|
-
})), await
|
|
323
|
-
|
|
322
|
+
})), await u(
|
|
323
|
+
p(`${g(n)}/pins`, { collection: e, id: s }),
|
|
324
324
|
"Could not add it to the shared list"
|
|
325
325
|
);
|
|
326
326
|
},
|
|
327
|
-
[
|
|
328
|
-
),
|
|
327
|
+
[l, u]
|
|
328
|
+
), Z = h(
|
|
329
329
|
async (n, e, s) => {
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
...
|
|
333
|
-
teams:
|
|
334
|
-
(
|
|
330
|
+
const o = v(e, s);
|
|
331
|
+
l((r) => ({
|
|
332
|
+
...r,
|
|
333
|
+
teams: r.teams.map(
|
|
334
|
+
(f) => f.id === n ? { ...f, pins: f.pins.filter((b) => b.key !== o) } : f
|
|
335
335
|
)
|
|
336
|
-
})), await
|
|
336
|
+
})), await u(
|
|
337
337
|
M(`${g(n)}/pins/${encodeURIComponent(e)}/${encodeURIComponent(s)}`),
|
|
338
338
|
"Could not remove it from the shared list"
|
|
339
339
|
);
|
|
340
340
|
},
|
|
341
|
-
[
|
|
342
|
-
),
|
|
341
|
+
[l, u]
|
|
342
|
+
), ee = h(
|
|
343
343
|
(n, e) => {
|
|
344
344
|
a.setQueriesData(
|
|
345
345
|
{ queryKey: ["watch-list", "team", n] },
|
|
346
346
|
(s) => {
|
|
347
|
-
var
|
|
347
|
+
var o;
|
|
348
348
|
return s && {
|
|
349
349
|
...s,
|
|
350
|
-
changed: e ? s.changed.filter((
|
|
351
|
-
rows: (
|
|
352
|
-
(
|
|
350
|
+
changed: e ? s.changed.filter((r) => !e.includes(r)) : [],
|
|
351
|
+
rows: (o = s.rows) == null ? void 0 : o.map(
|
|
352
|
+
(r) => r.change && (!e || e.includes(r.key)) ? { ...r, change: { ...r.change, changed: !1, unseen: 0 } } : r
|
|
353
353
|
)
|
|
354
354
|
};
|
|
355
355
|
}
|
|
356
|
-
), t && t.request(
|
|
356
|
+
), t && t.request(p(`${g(n)}/seen`, e ? { keys: e } : {})).catch(() => {
|
|
357
357
|
});
|
|
358
358
|
},
|
|
359
359
|
[t, a]
|
|
360
360
|
);
|
|
361
361
|
return {
|
|
362
|
-
prefs:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
362
|
+
prefs: i,
|
|
363
|
+
prefsReady: c,
|
|
364
|
+
setSettings: P,
|
|
365
|
+
addAlert: H,
|
|
366
|
+
removeAlert: F,
|
|
367
|
+
createTeam: j,
|
|
368
|
+
editTeam: G,
|
|
369
|
+
deleteTeam: X,
|
|
370
|
+
leaveTeam: B,
|
|
371
|
+
takeOverTeam: J,
|
|
372
|
+
restoreRemoved: V,
|
|
373
|
+
teamPin: Y,
|
|
374
|
+
teamUnpin: Z,
|
|
375
|
+
teamSeen: ee,
|
|
376
|
+
isPinned: (n, e) => d.has(v(n, e)),
|
|
376
377
|
pin: C,
|
|
377
378
|
unpin: _,
|
|
378
|
-
toggle:
|
|
379
|
-
setDock:
|
|
380
|
-
reorder:
|
|
381
|
-
markSeen:
|
|
382
|
-
full:
|
|
379
|
+
toggle: k,
|
|
380
|
+
setDock: q,
|
|
381
|
+
reorder: E,
|
|
382
|
+
markSeen: I,
|
|
383
|
+
full: i.pins.length >= i.max
|
|
383
384
|
};
|
|
384
385
|
}
|
|
385
386
|
const g = (t) => `/watch-list/teams/${encodeURIComponent(t)}`;
|
|
386
|
-
function
|
|
387
|
+
function _e(t) {
|
|
387
388
|
const a = t;
|
|
388
389
|
return !a || typeof a.closest != "function" ? !1 : !!a.closest(
|
|
389
390
|
'input, textarea, select, [contenteditable=""], [contenteditable="true"], [role="textbox"], [role="combobox"], [role="menu"], [role="listbox"]'
|
|
390
391
|
);
|
|
391
392
|
}
|
|
392
|
-
function
|
|
393
|
+
function Se(t, a) {
|
|
393
394
|
if (a === "mine") return t;
|
|
394
|
-
const
|
|
395
|
-
return [...t].sort((
|
|
396
|
-
var
|
|
397
|
-
if (
|
|
395
|
+
const i = (c) => c ? new Date(c).getTime() : Number.NaN;
|
|
396
|
+
return [...t].sort((c, d) => {
|
|
397
|
+
var S, u, C, _;
|
|
398
|
+
if (c.available !== d.available) return c.available ? -1 : 1;
|
|
398
399
|
if (a === "changed") {
|
|
399
|
-
const k =
|
|
400
|
+
const k = i(((S = c.change) == null ? void 0 : S.at) ?? c.updated_at), q = i(((u = d.change) == null ? void 0 : u.at) ?? d.updated_at);
|
|
400
401
|
return (Number.isNaN(q) ? 0 : q) - (Number.isNaN(k) ? 0 : k);
|
|
401
402
|
}
|
|
402
|
-
const
|
|
403
|
-
return Number.isNaN(
|
|
403
|
+
const l = i((C = c.sla) == null ? void 0 : C.due_at), w = i((_ = d.sla) == null ? void 0 : _.due_at);
|
|
404
|
+
return Number.isNaN(l) && Number.isNaN(w) ? 0 : Number.isNaN(l) ? 1 : Number.isNaN(w) ? -1 : l - w;
|
|
404
405
|
});
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function be(t) {
|
|
407
408
|
const a = Math.max(0, Math.round(t));
|
|
408
409
|
return a < 3600 ? `${Math.max(1, Math.round(a / 60))} m` : a < 86400 ? `${Math.round(a / 3600)} h` : `${Math.round(a / 86400)} d`;
|
|
409
410
|
}
|
|
410
|
-
function
|
|
411
|
-
const
|
|
412
|
-
for (const
|
|
413
|
-
for (const
|
|
414
|
-
return [...
|
|
411
|
+
function Ne(t, a, i) {
|
|
412
|
+
const c = /* @__PURE__ */ new Set();
|
|
413
|
+
for (const d of t ?? []) i.has(d) && c.add(d);
|
|
414
|
+
for (const d of a) i.has(d) && c.add(d);
|
|
415
|
+
return [...c];
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
-
return a.size === 0 ? t : t.map((
|
|
418
|
-
var
|
|
419
|
-
const
|
|
420
|
-
return !
|
|
417
|
+
function Te(t, a) {
|
|
418
|
+
return a.size === 0 ? t : t.map((i) => {
|
|
419
|
+
var d;
|
|
420
|
+
const c = a.get(i.key);
|
|
421
|
+
return !c || !((d = i.change) != null && d.changed) || new Date(i.change.at).getTime() > c ? i : { ...i, change: { ...i.change, changed: !1, unseen: 0 } };
|
|
421
422
|
});
|
|
422
423
|
}
|
|
423
|
-
function
|
|
424
|
-
const
|
|
425
|
-
return
|
|
424
|
+
function ke(t, a) {
|
|
425
|
+
const i = new Map(a.filter((c) => c.done_at).map((c) => [c.key, c.done_at]));
|
|
426
|
+
return i.size === 0 ? t : t.map((c) => i.has(c.key) ? { ...c, completed_at: i.get(c.key) } : c);
|
|
426
427
|
}
|
|
427
428
|
export {
|
|
428
|
-
|
|
429
|
+
oe as WATCH_DOCK_DEFAULT,
|
|
429
430
|
Q as WATCH_DOCK_MIN_VIEWPORT,
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
ce as WATCH_SETTINGS_DEFAULT,
|
|
432
|
+
ye as WATCH_WIDTH_MAX,
|
|
433
|
+
pe as WATCH_WIDTH_MIN,
|
|
434
|
+
Ne as changedKeys,
|
|
435
|
+
v as pinKeyOf,
|
|
435
436
|
ge as pinsSignature,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
437
|
+
Se as sortWatchRows,
|
|
438
|
+
be as spanText,
|
|
439
|
+
_e as typingTarget,
|
|
440
|
+
Ce as useWatchActions,
|
|
441
|
+
le as useWatchPrefs,
|
|
442
|
+
ve as useWatchUi,
|
|
443
|
+
N as watchKeys,
|
|
443
444
|
W as watchUi,
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
ke as withCompleted,
|
|
446
|
+
Te as withLocalSeen,
|
|
446
447
|
O as withPrefDefaults
|
|
447
448
|
};
|