@nivaro/react 0.3.9 → 0.3.10
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/fields/FileField.js +20 -19
- package/dist/full.css +1 -1
- package/dist/hooks/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +512 -501
- package/dist/shared/components/CollectionBrowserView.js +1000 -1001
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +3687 -3580
- package/dist/shared/components/JsonMapEditor.js +18 -17
- package/dist/shared/components/MatrixEditor.js +8 -7
- package/dist/shared/components/MyWorkView.js +32 -31
- package/dist/shared/components/PageRenderer.js +146 -145
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
- package/dist/shared/components/ai/AskPanel.js +55 -54
- package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
- package/dist/shared/components/chat/SlashCommands.js +30 -29
- package/dist/shared/components/chat/chat-outbox.js +76 -75
- package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
- package/dist/shared/components/integrations/console/SignalCard.js +124 -123
- package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/InlineTableField.js +301 -300
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/staged-links.js +86 -0
- package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
- package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueWorklist.js +597 -598
- package/dist/shared/lib/client-version.js +63 -0
- package/dist/shared/lib/force-reload.js +36 -0
- package/dist/shared/lib/load-error.js +11 -10
- package/dist/shared/lib/presence-live.js +54 -35
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/package.json +1 -1
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
import { AlertOctagon as
|
|
3
|
-
import { useState as L, useMemo as
|
|
4
|
-
import { useItemEditAuth as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsxs as a, jsx as r, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { AlertOctagon as F, AlertTriangle as O, ChevronRight as B, Loader2 as M, ChevronDown as W, ExternalLink as G } from "lucide-react";
|
|
3
|
+
import { useState as L, useMemo as V, useId as X, useRef as q } from "react";
|
|
4
|
+
import { useItemEditAuth as H } from "../../../context.js";
|
|
5
|
+
import { userErrorMessage as I } from "../../../lib/safe-error.js";
|
|
6
|
+
import { cn as x, titleCase as J } from "../../../lib/utils.js";
|
|
7
|
+
import { ExplainButton as Q } from "../../ai/ExplainButton.js";
|
|
8
|
+
import { useDrillWindows as Y, DrillTag as Z } from "../../chaos/DrillTag.js";
|
|
9
|
+
import { useSignalAction as ee, useDismissRows as te, useSnooze as ne } from "./api.js";
|
|
10
|
+
import { canDrill as re, RowDrill as oe } from "./drill/index.js";
|
|
11
|
+
import { SnoozeMenu as R, DismissButton as ie } from "./SnoozeMenu.js";
|
|
12
|
+
import { TONE_FILL as se, TONE_TEXT as T, agoText as ae, exactTime as U, TONE_SOFT as le, ageOf as de } from "./tone.js";
|
|
13
|
+
const ce = ["retry_submission", "extension"], ue = (t) => t.kind === "extension" ? j(t) : t.kind, j = (t) => `${t.kind}:${t.id ?? ""}`;
|
|
14
|
+
function me(t) {
|
|
14
15
|
let e = null;
|
|
15
16
|
for (const m of t.rows) (!e || m.first_seen < e) && (e = m.first_seen);
|
|
16
17
|
return e;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function _e({
|
|
19
20
|
signal: t,
|
|
20
21
|
expanded: e,
|
|
21
22
|
onToggle: m,
|
|
@@ -23,7 +24,7 @@ function $e({
|
|
|
23
24
|
onExplain: p,
|
|
24
25
|
canExplain: l
|
|
25
26
|
}) {
|
|
26
|
-
const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ?
|
|
27
|
+
const h = t.severity === "critical", v = h ? "negative" : "warning", S = h ? F : O, y = me(t), z = Y(), $ = t.rows.reduce(
|
|
27
28
|
(N, D) => !N || D.first_seen > N ? D.first_seen : N,
|
|
28
29
|
null
|
|
29
30
|
), k = t.rows[0], [b, C] = L(!1), _ = `ic-signal-body-${t.id.replace(/[^a-z0-9]/gi, "-")}`;
|
|
@@ -43,28 +44,28 @@ function $e({
|
|
|
43
44
|
"aria-controls": _,
|
|
44
45
|
className: "flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
45
46
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ r(
|
|
47
48
|
"span",
|
|
48
49
|
{
|
|
49
50
|
className: x(
|
|
50
51
|
"mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
|
|
51
|
-
|
|
52
|
+
le[v]
|
|
52
53
|
),
|
|
53
54
|
"data-tip": h ? "Critical — something is failing now" : "Worth a look",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ r(S, { className: x("h-3.5 w-3.5", T[v]), "aria-hidden": !0 })
|
|
55
56
|
}
|
|
56
57
|
),
|
|
57
58
|
/* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
|
|
58
59
|
/* @__PURE__ */ a("span", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
$ && /* @__PURE__ */
|
|
61
|
-
t.error ? /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ r("span", { className: "text-[13.5px] font-semibold text-foreground", children: t.label }),
|
|
61
|
+
$ && /* @__PURE__ */ r(Z, { windows: z, at: $, className: "self-center" }),
|
|
62
|
+
t.error ? /* @__PURE__ */ r("span", { className: x("text-[12px] font-medium", T.negative), children: "Couldn't evaluate" }) : /* @__PURE__ */ a("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
|
|
63
|
+
/* @__PURE__ */ r("span", { className: x("font-semibold", T[v]), children: t.count }),
|
|
63
64
|
" open",
|
|
64
|
-
y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${
|
|
65
|
+
y && /* @__PURE__ */ a("span", { "data-tip": `Oldest first seen ${U(y)}`, children: [
|
|
65
66
|
" ",
|
|
66
67
|
"· oldest ",
|
|
67
|
-
|
|
68
|
+
de(y)
|
|
68
69
|
] }),
|
|
69
70
|
t.snoozed.length > 0 && /* @__PURE__ */ a(A, { children: [
|
|
70
71
|
" · ",
|
|
@@ -73,9 +74,9 @@ function $e({
|
|
|
73
74
|
] })
|
|
74
75
|
] })
|
|
75
76
|
] }),
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ r("span", { className: "mt-0.5 block truncate text-[12px] text-muted-foreground", children: t.error ? t.error : k ? `${k.title}${k.detail ? ` — ${k.detail}` : ""}` : t.description })
|
|
77
78
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ r(
|
|
79
80
|
B,
|
|
80
81
|
{
|
|
81
82
|
className: x(
|
|
@@ -93,9 +94,9 @@ function $e({
|
|
|
93
94
|
"Couldn't evaluate · ",
|
|
94
95
|
t.error
|
|
95
96
|
] }) : /* @__PURE__ */ a(A, { children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
|
|
97
|
+
/* @__PURE__ */ r("p", { className: "max-w-[80ch] px-4 pb-1 pt-3 text-[12px] leading-relaxed text-muted-foreground", children: t.description }),
|
|
98
|
+
/* @__PURE__ */ r(
|
|
99
|
+
pe,
|
|
99
100
|
{
|
|
100
101
|
signal: t,
|
|
101
102
|
rows: t.rows,
|
|
@@ -122,7 +123,7 @@ function $e({
|
|
|
122
123
|
"data-ic-snoozed-fold": t.snoozed.length,
|
|
123
124
|
className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12px] font-medium text-muted-foreground hover:text-foreground",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ r(
|
|
126
127
|
B,
|
|
127
128
|
{
|
|
128
129
|
className: x("h-3.5 w-3.5 transition-transform", b && "rotate-90")
|
|
@@ -134,41 +135,41 @@ function $e({
|
|
|
134
135
|
]
|
|
135
136
|
}
|
|
136
137
|
),
|
|
137
|
-
b && /* @__PURE__ */
|
|
138
|
+
b && /* @__PURE__ */ r(he, { signal: t })
|
|
138
139
|
] })
|
|
139
140
|
] })
|
|
140
141
|
]
|
|
141
142
|
}
|
|
142
143
|
);
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
+
function pe({
|
|
145
146
|
signal: t,
|
|
146
147
|
rows: e,
|
|
147
148
|
onOpenRecord: m,
|
|
148
149
|
onExplain: g,
|
|
149
150
|
canExplain: p
|
|
150
151
|
}) {
|
|
151
|
-
const l =
|
|
152
|
+
const l = ee(), h = te(), [v, S] = L({}), [y, z] = L(/* @__PURE__ */ new Set()), [$, k] = L(/* @__PURE__ */ new Set()), b = V(() => {
|
|
152
153
|
if (!e.some((s) => s.group)) return null;
|
|
153
|
-
const
|
|
154
|
+
const o = /* @__PURE__ */ new Map();
|
|
154
155
|
for (const s of e) {
|
|
155
|
-
const i = s.group ?? "—", d =
|
|
156
|
-
d.rows.push(s),
|
|
156
|
+
const i = s.group ?? "—", d = o.get(i) ?? { key: i, label: s.group_label ?? s.group ?? "Other", rows: [] };
|
|
157
|
+
d.rows.push(s), o.set(i, d);
|
|
157
158
|
}
|
|
158
|
-
return [...
|
|
159
|
-
}, [e]), C = async (
|
|
159
|
+
return [...o.values()].sort((s, i) => i.rows.length - s.rows.length);
|
|
160
|
+
}, [e]), C = async (o, s) => {
|
|
160
161
|
var d;
|
|
161
162
|
const i = s.map((c) => c.key);
|
|
162
163
|
z((c) => /* @__PURE__ */ new Set([...c, ...i]));
|
|
163
164
|
try {
|
|
164
|
-
const c = await l.mutateAsync({ signal: t.id, row_keys: i, action:
|
|
165
|
+
const c = await l.mutateAsync({ signal: t.id, row_keys: i, action: o });
|
|
165
166
|
S((n) => {
|
|
166
167
|
const u = { ...n };
|
|
167
168
|
for (const f of c) u[f.key] = f;
|
|
168
169
|
return u;
|
|
169
170
|
}), k((n) => new Set([...n].filter((u) => !i.includes(u))));
|
|
170
171
|
} catch (c) {
|
|
171
|
-
const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? (c
|
|
172
|
+
const n = ((d = c == null ? void 0 : c.response) == null ? void 0 : d.error) ?? I(c, "The action failed");
|
|
172
173
|
S((u) => {
|
|
173
174
|
const f = { ...u };
|
|
174
175
|
for (const w of i) f[w] = { key: w, ok: !1, message: n };
|
|
@@ -177,14 +178,14 @@ function me({
|
|
|
177
178
|
} finally {
|
|
178
179
|
z((c) => new Set([...c].filter((n) => !i.includes(n))));
|
|
179
180
|
}
|
|
180
|
-
}, _ = async (
|
|
181
|
+
}, _ = async (o) => {
|
|
181
182
|
var i;
|
|
182
|
-
const s =
|
|
183
|
+
const s = o.map((d) => d.key);
|
|
183
184
|
z((d) => /* @__PURE__ */ new Set([...d, ...s]));
|
|
184
185
|
try {
|
|
185
186
|
await h.mutateAsync({ signal: t.id, row_keys: s }), k((d) => new Set([...d].filter((c) => !s.includes(c))));
|
|
186
187
|
} catch (d) {
|
|
187
|
-
const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? (d
|
|
188
|
+
const c = ((i = d == null ? void 0 : d.response) == null ? void 0 : i.error) ?? I(d, "Could not dismiss");
|
|
188
189
|
S((n) => {
|
|
189
190
|
const u = { ...n };
|
|
190
191
|
for (const f of s) u[f] = { key: f, ok: !1, message: c };
|
|
@@ -193,48 +194,48 @@ function me({
|
|
|
193
194
|
} finally {
|
|
194
195
|
z((d) => new Set([...d].filter((c) => !s.includes(c))));
|
|
195
196
|
}
|
|
196
|
-
}, N = (
|
|
197
|
+
}, N = (o, s) => {
|
|
197
198
|
var i, d, c, n;
|
|
198
|
-
if (
|
|
199
|
-
const u = ((i =
|
|
199
|
+
if (o.kind === "open") {
|
|
200
|
+
const u = ((i = o.payload) == null ? void 0 : i.collection) ?? ((d = s.record) == null ? void 0 : d.collection), f = ((c = o.payload) == null ? void 0 : c.id) ?? ((n = s.record) == null ? void 0 : n.id);
|
|
200
201
|
u && f && (m == null || m(u, String(f)));
|
|
201
202
|
return;
|
|
202
203
|
}
|
|
203
|
-
if (
|
|
204
|
-
g == null || g(
|
|
204
|
+
if (o.kind === "explain") {
|
|
205
|
+
g == null || g(o, s);
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
207
|
-
C(
|
|
208
|
-
}, D = (
|
|
209
|
-
|
|
208
|
+
C(o, [s]);
|
|
209
|
+
}, D = (o, s) => /* @__PURE__ */ r(
|
|
210
|
+
fe,
|
|
210
211
|
{
|
|
211
212
|
signal: t,
|
|
212
|
-
row:
|
|
213
|
-
result: v[
|
|
214
|
-
busy: y.has(
|
|
213
|
+
row: o,
|
|
214
|
+
result: v[o.key],
|
|
215
|
+
busy: y.has(o.key),
|
|
215
216
|
selectable: s,
|
|
216
|
-
selected: $.has(
|
|
217
|
+
selected: $.has(o.key),
|
|
217
218
|
onSelect: (i) => k((d) => {
|
|
218
219
|
const c = new Set(d);
|
|
219
|
-
return i ? c.add(
|
|
220
|
+
return i ? c.add(o.key) : c.delete(o.key), c;
|
|
220
221
|
}),
|
|
221
|
-
onAction: (i) => N(i,
|
|
222
|
+
onAction: (i) => N(i, o),
|
|
222
223
|
onOpenRecord: m,
|
|
223
224
|
canExplain: p
|
|
224
225
|
},
|
|
225
|
-
|
|
226
|
+
o.key
|
|
226
227
|
);
|
|
227
228
|
if (!b) {
|
|
228
|
-
const
|
|
229
|
+
const o = e.length > 0 && e.every((i) => $.has(i.key)), s = e.filter((i) => $.has(i.key));
|
|
229
230
|
return /* @__PURE__ */ a("div", { children: [
|
|
230
231
|
e.length > 0 && /* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ r(
|
|
232
233
|
"input",
|
|
233
234
|
{
|
|
234
235
|
type: "checkbox",
|
|
235
|
-
checked:
|
|
236
|
+
checked: o,
|
|
236
237
|
ref: (i) => {
|
|
237
|
-
i && (i.indeterminate = s.length > 0 && !
|
|
238
|
+
i && (i.indeterminate = s.length > 0 && !o);
|
|
238
239
|
},
|
|
239
240
|
onChange: (i) => k(new Set(i.target.checked ? e.map((d) => d.key) : [])),
|
|
240
241
|
"aria-label": "Select every problem",
|
|
@@ -251,33 +252,33 @@ function me({
|
|
|
251
252
|
onClick: () => void _(s),
|
|
252
253
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
|
|
253
254
|
children: [
|
|
254
|
-
s.some((i) => y.has(i.key)) && /* @__PURE__ */
|
|
255
|
+
s.some((i) => y.has(i.key)) && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
|
|
255
256
|
"Dismiss selected ",
|
|
256
257
|
s.length
|
|
257
258
|
]
|
|
258
259
|
}
|
|
259
|
-
) : /* @__PURE__ */
|
|
260
|
+
) : /* @__PURE__ */ r("span", { className: "text-[12px] text-muted-foreground", children: "Select problems to dismiss several at once" })
|
|
260
261
|
] }),
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ r("ul", { className: "divide-y divide-border", children: e.map((i) => D(i, !0)) })
|
|
262
263
|
] });
|
|
263
264
|
}
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
const s =
|
|
265
|
+
return /* @__PURE__ */ r("div", { className: "pb-1", children: b.map((o) => {
|
|
266
|
+
const s = o.rows.filter((n) => $.has(n.key)), i = o.rows.length > 0 && s.length === o.rows.length, d = /* @__PURE__ */ new Map();
|
|
266
267
|
for (const n of s) {
|
|
267
268
|
const u = /* @__PURE__ */ new Set();
|
|
268
269
|
for (const f of n.actions) {
|
|
269
|
-
if (!
|
|
270
|
-
const w =
|
|
270
|
+
if (!ce.includes(f.kind)) continue;
|
|
271
|
+
const w = ue(f);
|
|
271
272
|
if (u.has(w)) continue;
|
|
272
273
|
u.add(w);
|
|
273
|
-
const
|
|
274
|
-
|
|
274
|
+
const K = d.get(w) ?? { action: f, rows: [] };
|
|
275
|
+
K.rows.push(n), d.set(w, K);
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
278
|
const c = s.some((n) => y.has(n.key));
|
|
278
|
-
return /* @__PURE__ */ a("div", { "data-ic-group":
|
|
279
|
+
return /* @__PURE__ */ a("div", { "data-ic-group": o.key, className: "mt-2 first:mt-1", children: [
|
|
279
280
|
/* @__PURE__ */ a("div", { className: "flex min-h-9 items-center gap-2.5 bg-muted/60 px-4 py-1.5", children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ r(
|
|
281
282
|
"input",
|
|
282
283
|
{
|
|
283
284
|
type: "checkbox",
|
|
@@ -287,17 +288,17 @@ function me({
|
|
|
287
288
|
},
|
|
288
289
|
onChange: (n) => k((u) => {
|
|
289
290
|
const f = new Set(u);
|
|
290
|
-
for (const w of
|
|
291
|
+
for (const w of o.rows)
|
|
291
292
|
n.target.checked ? f.add(w.key) : f.delete(w.key);
|
|
292
293
|
return f;
|
|
293
294
|
}),
|
|
294
|
-
"aria-label": `Select every problem in ${
|
|
295
|
-
"data-ic-group-select":
|
|
295
|
+
"aria-label": `Select every problem in ${o.label}`,
|
|
296
|
+
"data-ic-group-select": o.key,
|
|
296
297
|
className: "h-3.5 w-3.5 accent-[rgb(var(--nvr-cyan-rgb))]"
|
|
297
298
|
}
|
|
298
299
|
),
|
|
299
|
-
/* @__PURE__ */
|
|
300
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ r("span", { className: "text-[12.5px] font-semibold text-foreground", children: o.label }),
|
|
301
|
+
/* @__PURE__ */ r("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: o.rows.length }),
|
|
301
302
|
/* @__PURE__ */ a("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
302
303
|
[...d.entries()].map(([n, u]) => /* @__PURE__ */ a(
|
|
303
304
|
"button",
|
|
@@ -325,31 +326,31 @@ function me({
|
|
|
325
326
|
onClick: () => void _(s),
|
|
326
327
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground hover:bg-muted disabled:opacity-60",
|
|
327
328
|
children: [
|
|
328
|
-
c && /* @__PURE__ */
|
|
329
|
+
c && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
|
|
329
330
|
"Dismiss selected ",
|
|
330
331
|
s.length
|
|
331
332
|
]
|
|
332
333
|
}
|
|
333
334
|
),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
|
|
335
|
+
/* @__PURE__ */ r(
|
|
336
|
+
R,
|
|
336
337
|
{
|
|
337
338
|
signal: t.id,
|
|
338
339
|
signalLabel: t.label,
|
|
339
|
-
group: { key:
|
|
340
|
+
group: { key: o.key, label: o.label },
|
|
340
341
|
defaultScope: "group"
|
|
341
342
|
}
|
|
342
343
|
)
|
|
343
344
|
] })
|
|
344
345
|
] }),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
] },
|
|
346
|
+
/* @__PURE__ */ r("ul", { className: "divide-y divide-border", children: o.rows.map((n) => D(n, !0)) })
|
|
347
|
+
] }, o.key);
|
|
347
348
|
}) });
|
|
348
349
|
}
|
|
349
|
-
function
|
|
350
|
-
return t.label ? t.label : `${
|
|
350
|
+
function P(t) {
|
|
351
|
+
return t.label ? t.label : `${J(t.collection).replace(/s$/, "")} ${t.id}`;
|
|
351
352
|
}
|
|
352
|
-
function
|
|
353
|
+
function fe({
|
|
353
354
|
signal: t,
|
|
354
355
|
row: e,
|
|
355
356
|
result: m,
|
|
@@ -364,7 +365,7 @@ function pe({
|
|
|
364
365
|
var i, d, c;
|
|
365
366
|
const z = e.since ?? e.first_seen, $ = e.actions.filter(
|
|
366
367
|
(n) => !(n.kind === "open" && e.record) && !(n.kind === "explain" && (y == null ? void 0 : y(n)) === !1)
|
|
367
|
-
), { isAdmin: k } =
|
|
368
|
+
), { isAdmin: k } = H(), [b, C] = L(!1), _ = X(), N = q(null), D = re(e.drill), o = ((i = e.drill) == null ? void 0 : i.kind) === "submission" ? e.actions.find((n) => {
|
|
368
369
|
var u;
|
|
369
370
|
return n.kind === "retry_submission" && n.id === ((u = e.drill) == null ? void 0 : u.id);
|
|
370
371
|
}) : void 0, s = () => {
|
|
@@ -379,7 +380,7 @@ function pe({
|
|
|
379
380
|
className: x(b && "bg-muted/30"),
|
|
380
381
|
children: [
|
|
381
382
|
/* @__PURE__ */ a("div", { className: "flex gap-3 px-4 py-2.5", children: [
|
|
382
|
-
p && /* @__PURE__ */
|
|
383
|
+
p && /* @__PURE__ */ r(
|
|
383
384
|
"input",
|
|
384
385
|
{
|
|
385
386
|
type: "checkbox",
|
|
@@ -391,8 +392,8 @@ function pe({
|
|
|
391
392
|
}
|
|
392
393
|
),
|
|
393
394
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
e.detail && /* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ r("p", { className: "text-[12.5px] font-medium text-foreground", children: e.title }),
|
|
396
|
+
e.detail && /* @__PURE__ */ r(
|
|
396
397
|
"p",
|
|
397
398
|
{
|
|
398
399
|
className: "mt-0.5 line-clamp-2 break-words text-[12px] leading-snug text-muted-foreground",
|
|
@@ -400,8 +401,8 @@ function pe({
|
|
|
400
401
|
children: e.detail
|
|
401
402
|
}
|
|
402
403
|
),
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
|
|
404
|
+
/* @__PURE__ */ r(
|
|
405
|
+
E,
|
|
405
406
|
{
|
|
406
407
|
since: z,
|
|
407
408
|
record: e.record,
|
|
@@ -419,12 +420,12 @@ function pe({
|
|
|
419
420
|
T[m.ok ? "positive" : "negative"]
|
|
420
421
|
),
|
|
421
422
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ r(
|
|
423
424
|
"span",
|
|
424
425
|
{
|
|
425
426
|
className: x(
|
|
426
427
|
"mt-[5px] h-1.5 w-1.5 shrink-0 rounded-full",
|
|
427
|
-
|
|
428
|
+
se[m.ok ? "positive" : "negative"]
|
|
428
429
|
)
|
|
429
430
|
}
|
|
430
431
|
),
|
|
@@ -433,8 +434,8 @@ function pe({
|
|
|
433
434
|
}
|
|
434
435
|
)
|
|
435
436
|
] }),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
437
|
+
/* @__PURE__ */ r(
|
|
438
|
+
E,
|
|
438
439
|
{
|
|
439
440
|
since: z,
|
|
440
441
|
record: e.record,
|
|
@@ -462,8 +463,8 @@ function pe({
|
|
|
462
463
|
),
|
|
463
464
|
children: [
|
|
464
465
|
"Details",
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
|
|
466
|
+
/* @__PURE__ */ r(
|
|
467
|
+
W,
|
|
467
468
|
{
|
|
468
469
|
className: x(
|
|
469
470
|
"h-3 w-3 transition-transform duration-200",
|
|
@@ -484,15 +485,15 @@ function pe({
|
|
|
484
485
|
onClick: () => v(n),
|
|
485
486
|
className: "inline-flex h-7 items-center gap-1.5 rounded-md border border-border bg-card px-2.5 text-[12px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
486
487
|
children: [
|
|
487
|
-
g && n.kind !== "explain" && /* @__PURE__ */
|
|
488
|
+
g && n.kind !== "explain" && /* @__PURE__ */ r(M, { className: "h-3 w-3 animate-spin" }),
|
|
488
489
|
n.label
|
|
489
490
|
]
|
|
490
491
|
},
|
|
491
|
-
|
|
492
|
+
j(n)
|
|
492
493
|
)),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
|
|
494
|
+
/* @__PURE__ */ r(ie, { signal: t.id, rowKey: e.key }),
|
|
495
|
+
/* @__PURE__ */ r(
|
|
496
|
+
R,
|
|
496
497
|
{
|
|
497
498
|
signal: t.id,
|
|
498
499
|
signalLabel: t.label,
|
|
@@ -503,8 +504,8 @@ function pe({
|
|
|
503
504
|
)
|
|
504
505
|
] })
|
|
505
506
|
] }),
|
|
506
|
-
k && /* @__PURE__ */
|
|
507
|
-
|
|
507
|
+
k && /* @__PURE__ */ r("div", { className: "pb-3 pl-11 pr-4", "data-ic-explain": e.key, children: /* @__PURE__ */ r(
|
|
508
|
+
Q,
|
|
508
509
|
{
|
|
509
510
|
kind: "signal-row",
|
|
510
511
|
params: { signal: t.id, row_key: e.key },
|
|
@@ -512,7 +513,7 @@ function pe({
|
|
|
512
513
|
}
|
|
513
514
|
) }),
|
|
514
515
|
b && D && e.drill && // Esc anywhere inside the open drill collapses it.
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ r(
|
|
516
517
|
"section",
|
|
517
518
|
{
|
|
518
519
|
id: _,
|
|
@@ -521,12 +522,12 @@ function pe({
|
|
|
521
522
|
n.key === "Escape" && !n.defaultPrevented && (n.stopPropagation(), s());
|
|
522
523
|
},
|
|
523
524
|
className: "border-t border-border pb-4 pl-11 pr-4 pt-3",
|
|
524
|
-
children: /* @__PURE__ */
|
|
525
|
+
children: /* @__PURE__ */ r(
|
|
525
526
|
oe,
|
|
526
527
|
{
|
|
527
528
|
drill: e.drill,
|
|
528
529
|
onOpenRecord: S,
|
|
529
|
-
onRetry:
|
|
530
|
+
onRetry: o ? () => v(o) : void 0,
|
|
530
531
|
retryBusy: g
|
|
531
532
|
}
|
|
532
533
|
)
|
|
@@ -536,7 +537,7 @@ function pe({
|
|
|
536
537
|
}
|
|
537
538
|
);
|
|
538
539
|
}
|
|
539
|
-
function
|
|
540
|
+
function E({
|
|
540
541
|
since: t,
|
|
541
542
|
record: e,
|
|
542
543
|
onOpenRecord: m,
|
|
@@ -544,12 +545,12 @@ function I({
|
|
|
544
545
|
stacked: p
|
|
545
546
|
}) {
|
|
546
547
|
return /* @__PURE__ */ a("div", { className: x("flex items-center text-[11.5px] text-muted-foreground", g), children: [
|
|
547
|
-
/* @__PURE__ */ a("span", { "data-tip":
|
|
548
|
+
/* @__PURE__ */ a("span", { "data-tip": U(t), className: "tabular-nums", children: [
|
|
548
549
|
"Since ",
|
|
549
|
-
|
|
550
|
+
ae(t)
|
|
550
551
|
] }),
|
|
551
552
|
e && /* @__PURE__ */ a(A, { children: [
|
|
552
|
-
!p && /* @__PURE__ */
|
|
553
|
+
!p && /* @__PURE__ */ r("span", { "aria-hidden": !0, children: "·" }),
|
|
553
554
|
m ? /* @__PURE__ */ a(
|
|
554
555
|
"button",
|
|
555
556
|
{
|
|
@@ -558,23 +559,23 @@ function I({
|
|
|
558
559
|
onClick: () => m(e.collection, e.id),
|
|
559
560
|
className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground",
|
|
560
561
|
children: [
|
|
561
|
-
|
|
562
|
-
/* @__PURE__ */
|
|
562
|
+
P(e),
|
|
563
|
+
/* @__PURE__ */ r(G, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
|
|
563
564
|
]
|
|
564
565
|
}
|
|
565
|
-
) : /* @__PURE__ */
|
|
566
|
+
) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: P(e) })
|
|
566
567
|
] })
|
|
567
568
|
] });
|
|
568
569
|
}
|
|
569
|
-
function
|
|
570
|
-
const { remove: e } =
|
|
570
|
+
function he({ signal: t }) {
|
|
571
|
+
const { remove: e } = ne(), m = /* @__PURE__ */ new Map();
|
|
571
572
|
for (const p of t.snoozed) {
|
|
572
573
|
if (!p.snooze) continue;
|
|
573
574
|
const l = m.get(p.snooze.id) ?? [];
|
|
574
575
|
l.push(p), m.set(p.snooze.id, l);
|
|
575
576
|
}
|
|
576
577
|
const g = (p) => new Set(p.map((h) => h.group ?? "")).size === 1 && p[0].group ? `everything in ${p[0].group_label ?? p[0].group}` : `all of “${t.label}”`;
|
|
577
|
-
return /* @__PURE__ */
|
|
578
|
+
return /* @__PURE__ */ r("ul", { className: "divide-y divide-border border-t border-border bg-muted/30", children: t.snoozed.map((p) => {
|
|
578
579
|
const l = p.snooze, h = l ? m.get(l.id) ?? [] : [], v = l != null && l.until_occurrence ? "Dismissed — shows again if it happens again" : `Snoozed ${l != null && l.until_change ? "until it changes" : l != null && l.until ? `until ${new Date(l.until).toLocaleString(void 0, {
|
|
579
580
|
month: "short",
|
|
580
581
|
day: "numeric",
|
|
@@ -583,14 +584,14 @@ function fe({ signal: t }) {
|
|
|
583
584
|
})}` : ""}`;
|
|
584
585
|
return /* @__PURE__ */ a("li", { "data-ic-row": p.key, "data-ic-snoozed": !0, className: "flex gap-3 px-4 py-2", children: [
|
|
585
586
|
/* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ r("p", { className: "truncate text-[12.5px] text-foreground", children: p.title }),
|
|
587
588
|
/* @__PURE__ */ a("p", { className: "text-[11.5px] text-muted-foreground", children: [
|
|
588
589
|
v,
|
|
589
590
|
h.length > 1 ? ` with ${g(h)}` : "",
|
|
590
591
|
l != null && l.note ? ` — “${l.note}”` : ""
|
|
591
592
|
] })
|
|
592
593
|
] }),
|
|
593
|
-
l && /* @__PURE__ */
|
|
594
|
+
l && /* @__PURE__ */ r(
|
|
594
595
|
"button",
|
|
595
596
|
{
|
|
596
597
|
type: "button",
|
|
@@ -607,6 +608,6 @@ function fe({ signal: t }) {
|
|
|
607
608
|
}) });
|
|
608
609
|
}
|
|
609
610
|
export {
|
|
610
|
-
|
|
611
|
-
|
|
611
|
+
_e as SignalCard,
|
|
612
|
+
me as oldestSeen
|
|
612
613
|
};
|