@nivaro/react 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/slots/pipeline/OwnersSection.js +79 -75
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +33 -2
- package/dist/index.js +520 -516
- package/dist/shared/components/CollectionBrowserView.js +2373 -2298
- package/dist/shared/components/DataTable.js +347 -335
- package/dist/shared/components/ItemEditForm.js +5278 -5149
- package/dist/shared/components/ListLoadError.js +33 -0
- package/dist/shared/components/PageRenderer.js +562 -529
- package/dist/shared/components/ProfileView.js +53 -51
- package/dist/shared/components/RecordReadView.js +119 -117
- package/dist/shared/components/ReportView.js +1268 -1241
- package/dist/shared/components/cbv/export-rows.js +69 -0
- package/dist/shared/components/cbv/saved-view-risk.js +35 -0
- package/dist/shared/components/cbv/unknown-fields.js +18 -0
- package/dist/shared/components/integrations/console/AlertsView.js +27 -25
- package/dist/shared/components/integrations/console/EventsView.js +244 -209
- package/dist/shared/components/item-edit/CatalogPickerField.js +946 -878
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +84 -57
- package/dist/shared/components/item-edit/FieldAffordances.js +63 -61
- package/dist/shared/components/item-edit/FieldRow.js +195 -179
- package/dist/shared/components/item-edit/FilePickerField.js +257 -254
- package/dist/shared/components/item-edit/HeaderTools.js +139 -95
- package/dist/shared/components/item-edit/InlineTableField.js +2087 -2075
- package/dist/shared/components/item-edit/RowComments.js +1 -3
- package/dist/shared/components/item-edit/SummaryPanel.js +62 -62
- package/dist/shared/components/item-edit/UserChip.js +113 -113
- package/dist/shared/components/item-edit/file-download.js +18 -0
- package/dist/shared/components/item-edit/line-qty.js +67 -32
- package/dist/shared/components/item-edit/save-refusal.js +23 -0
- package/dist/shared/components/monitoring/TrafficMiniMap.js +9 -9
- package/dist/shared/components/panels/CommentPanel.js +30 -30
- package/dist/shared/components/panels/ItemLockBanner.js +207 -185
- package/dist/shared/components/panels/PipelinePanel.js +915 -786
- package/dist/shared/components/pipeline/PipelineEditorView.js +45 -25
- package/dist/shared/components/profile/DelegationCard.js +1 -1
- package/dist/shared/components/profile/session-actions.js +24 -24
- package/dist/shared/components/queue/QueueItemSheet.js +18 -18
- package/dist/shared/components/queue/QueueWorklist.js +517 -504
- package/dist/shared/components/ui/dropdown-menu.js +8 -7
- package/dist/shared/lib/draft-store.js +60 -33
- package/dist/shared/lib/leave-guard.js +38 -0
- package/dist/shared/lib/load-error.js +38 -17
- package/dist/shared/lib/summary-mode.js +25 -25
- package/dist/shared/lib/table-pins.js +23 -0
- package/dist/shared/lib/validation-rules.js +55 -51
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { RefreshCw as ie, Search as
|
|
3
|
-
import { useState as g, useId as
|
|
1
|
+
import { jsxs as s, jsx as r, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import { RefreshCw as ie, Search as Se, X as Pe, ArrowUpRight as Ee, ArrowDownLeft as _e, ExternalLink as De } from "lucide-react";
|
|
3
|
+
import { useState as g, useId as Oe, useEffect as L, useMemo as S } from "react";
|
|
4
4
|
import { toast as ne } from "sonner";
|
|
5
|
-
import { useDebounced as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Checkbox as
|
|
8
|
-
import { SimpleSelect as
|
|
5
|
+
import { useDebounced as Te } from "../../../hooks/useDebounced.js";
|
|
6
|
+
import { cn as w } from "../../../lib/utils.js";
|
|
7
|
+
import { Checkbox as Ie } from "../../ui/checkbox.js";
|
|
8
|
+
import { SimpleSelect as K } from "../../ui/SimpleSelect.js";
|
|
9
9
|
import { useIntegrationEvents as Re, useReplayEvent as Ae } from "./api.js";
|
|
10
10
|
import { agoText as le, exactTime as ce, TONE_TEXT as de, TONE_SOFT as ue, TONE_BORDER as $e, TONE_FILL as Fe } from "./tone.js";
|
|
11
11
|
import { EventPathSheet as Le } from "./event-path/EventPathSheet.js";
|
|
@@ -19,154 +19,175 @@ const Ke = {
|
|
|
19
19
|
["in", "Inbound"],
|
|
20
20
|
["poll", "Polls & feeds"]
|
|
21
21
|
], Ue = {
|
|
22
|
-
in:
|
|
22
|
+
in: _e,
|
|
23
23
|
out: Ee,
|
|
24
24
|
poll: ie
|
|
25
25
|
}, ae = {
|
|
26
26
|
in: "Inbound — a partner called us",
|
|
27
27
|
out: "Outbound — we pushed to a partner",
|
|
28
28
|
poll: "Poll or feed — we asked the partner"
|
|
29
|
-
},
|
|
29
|
+
}, O = (t) => t.provider ?? t.source ?? "", T = (t) => `${O(t)}:${t.id}`;
|
|
30
|
+
function Ye(t) {
|
|
31
|
+
const o = (a) => [
|
|
32
|
+
O(a),
|
|
33
|
+
a.collection ?? "",
|
|
34
|
+
a.item_id ?? "",
|
|
35
|
+
a.label,
|
|
36
|
+
a.text,
|
|
37
|
+
a.context ?? "",
|
|
38
|
+
a.status ?? "",
|
|
39
|
+
a.partner ?? "",
|
|
40
|
+
a.caller ?? "",
|
|
41
|
+
String(a.created_at).slice(0, 19)
|
|
42
|
+
].join("\0"), i = [];
|
|
43
|
+
for (const a of t) {
|
|
44
|
+
const d = o(a), c = i[i.length - 1];
|
|
45
|
+
c && c.sig === d && !a.replayable && !c.event.replayable ? c.repeats++ : i.push({ event: a, repeats: 1, sig: d });
|
|
46
|
+
}
|
|
47
|
+
return i.map(({ event: a, repeats: d }) => ({ event: a, repeats: d }));
|
|
48
|
+
}
|
|
49
|
+
const je = [
|
|
30
50
|
["", "All"],
|
|
31
51
|
["error", "Problems"],
|
|
32
52
|
["ok", "OK"],
|
|
33
53
|
["info", "Info"]
|
|
34
54
|
];
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
return d === 0 ? "Today" : d === 1 ? "Yesterday" :
|
|
55
|
+
function Be(t, o = /* @__PURE__ */ new Date()) {
|
|
56
|
+
const i = new Date(t), a = (c) => new Date(c.getFullYear(), c.getMonth(), c.getDate()).getTime(), d = Math.round((a(o) - a(i)) / 864e5);
|
|
57
|
+
return d === 0 ? "Today" : d === 1 ? "Yesterday" : i.toLocaleDateString(void 0, {
|
|
38
58
|
weekday: "long",
|
|
39
59
|
month: "short",
|
|
40
60
|
day: "numeric",
|
|
41
|
-
...
|
|
61
|
+
...i.getFullYear() !== o.getFullYear() ? { year: "numeric" } : {}
|
|
42
62
|
});
|
|
43
63
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return `${
|
|
64
|
+
const We = (t) => {
|
|
65
|
+
const o = new Date(t);
|
|
66
|
+
return `${o.getFullYear()}-${o.getMonth()}-${o.getDate()}`;
|
|
47
67
|
};
|
|
48
68
|
function se({
|
|
49
69
|
value: t,
|
|
50
|
-
options:
|
|
51
|
-
onChange:
|
|
52
|
-
label:
|
|
70
|
+
options: o,
|
|
71
|
+
onChange: i,
|
|
72
|
+
label: a,
|
|
53
73
|
disabled: d,
|
|
54
|
-
...
|
|
74
|
+
...c
|
|
55
75
|
}) {
|
|
56
76
|
return /* @__PURE__ */ r(
|
|
57
77
|
"fieldset",
|
|
58
78
|
{
|
|
59
|
-
"aria-label":
|
|
79
|
+
"aria-label": a,
|
|
60
80
|
disabled: d,
|
|
61
|
-
...
|
|
81
|
+
...c,
|
|
62
82
|
className: "m-0 inline-flex h-8 min-w-0 overflow-hidden rounded-md border border-border bg-card p-0",
|
|
63
|
-
children:
|
|
64
|
-
const h = t ===
|
|
83
|
+
children: o.map(([m, u]) => {
|
|
84
|
+
const h = t === m;
|
|
65
85
|
return /* @__PURE__ */ r(
|
|
66
86
|
"button",
|
|
67
87
|
{
|
|
68
88
|
type: "button",
|
|
69
89
|
"aria-pressed": h,
|
|
70
|
-
"data-value":
|
|
71
|
-
onClick: () =>
|
|
72
|
-
className:
|
|
90
|
+
"data-value": m || "all",
|
|
91
|
+
onClick: () => i(m),
|
|
92
|
+
className: w(
|
|
73
93
|
"px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",
|
|
74
94
|
h ? "bg-[#1e293b] text-[#f2f2f2] dark:bg-nvr-cyan/20 dark:text-foreground dark:ring-1 dark:ring-inset dark:ring-nvr-cyan/40" : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
75
95
|
),
|
|
76
|
-
children:
|
|
96
|
+
children: u
|
|
77
97
|
},
|
|
78
|
-
|
|
98
|
+
m || "_all"
|
|
79
99
|
);
|
|
80
100
|
})
|
|
81
101
|
}
|
|
82
102
|
);
|
|
83
103
|
}
|
|
84
|
-
function
|
|
85
|
-
const
|
|
104
|
+
function Xe({ event: t }) {
|
|
105
|
+
const o = Ae(), [i, a] = g(!1), d = T(t), c = o.isPending;
|
|
86
106
|
return /* @__PURE__ */ r(
|
|
87
107
|
"button",
|
|
88
108
|
{
|
|
89
109
|
type: "button",
|
|
90
110
|
"data-ic-event-replay": d,
|
|
91
|
-
"data-armed":
|
|
92
|
-
disabled:
|
|
93
|
-
onBlur: () => !
|
|
94
|
-
onKeyDown: (
|
|
95
|
-
onClick: (
|
|
96
|
-
if (
|
|
97
|
-
|
|
111
|
+
"data-armed": i || void 0,
|
|
112
|
+
disabled: c,
|
|
113
|
+
onBlur: () => !c && a(!1),
|
|
114
|
+
onKeyDown: (m) => m.key === "Escape" && a(!1),
|
|
115
|
+
onClick: (m) => {
|
|
116
|
+
if (m.stopPropagation(), !i) {
|
|
117
|
+
a(!0);
|
|
98
118
|
return;
|
|
99
119
|
}
|
|
100
|
-
|
|
101
|
-
onSuccess: (
|
|
102
|
-
|
|
120
|
+
o.mutate(t, {
|
|
121
|
+
onSuccess: (u) => {
|
|
122
|
+
a(!1), ne.success("Event replayed", u.detail ? { description: u.detail } : void 0);
|
|
103
123
|
},
|
|
104
|
-
onError: (
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
const h = ((
|
|
124
|
+
onError: (u) => {
|
|
125
|
+
var f;
|
|
126
|
+
a(!1);
|
|
127
|
+
const h = ((f = u == null ? void 0 : u.response) == null ? void 0 : f.error) ?? (u instanceof Error ? u.message : null);
|
|
108
128
|
ne.error(h ?? "Replay failed", { duration: 8e3 });
|
|
109
129
|
}
|
|
110
130
|
});
|
|
111
131
|
},
|
|
112
|
-
className:
|
|
132
|
+
className: w(
|
|
113
133
|
"h-7 shrink-0 whitespace-nowrap rounded-md px-2.5 text-[12px] font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-70",
|
|
114
|
-
|
|
134
|
+
i ? (
|
|
115
135
|
// Tinted brand fill + foreground ink: raw brand cyan under white
|
|
116
136
|
// text is ~1.9:1, and brand-coloured text on white is no better.
|
|
117
137
|
"bg-nvr-cyan/15 text-foreground ring-1 ring-inset ring-nvr-cyan/50 hover:bg-nvr-cyan/25 dark:bg-nvr-cyan/20"
|
|
118
138
|
) : "text-muted-foreground hover:bg-muted hover:text-foreground"
|
|
119
139
|
),
|
|
120
|
-
children:
|
|
140
|
+
children: c ? "Replaying…" : i ? "Replay this event?" : "Replay"
|
|
121
141
|
}
|
|
122
142
|
);
|
|
123
143
|
}
|
|
124
|
-
function
|
|
144
|
+
function qe({
|
|
125
145
|
event: t,
|
|
126
|
-
onOpenRecord:
|
|
146
|
+
onOpenRecord: o
|
|
127
147
|
}) {
|
|
128
148
|
if (!t.item_id || !t.collection) return null;
|
|
129
|
-
const
|
|
130
|
-
return
|
|
149
|
+
const i = t.collection, a = t.item_label || `${i.replace(/_/g, " ")} ${t.item_id}`;
|
|
150
|
+
return o ? /* @__PURE__ */ s(
|
|
131
151
|
"button",
|
|
132
152
|
{
|
|
133
153
|
type: "button",
|
|
134
|
-
"data-ic-record": `${
|
|
154
|
+
"data-ic-record": `${i}:${t.item_id}`,
|
|
135
155
|
onClick: (d) => {
|
|
136
|
-
d.stopPropagation(),
|
|
156
|
+
d.stopPropagation(), o(i, String(t.item_id));
|
|
137
157
|
},
|
|
138
158
|
className: "inline-flex max-w-full items-center gap-1 truncate font-medium text-foreground underline decoration-border underline-offset-2 hover:decoration-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
139
159
|
children: [
|
|
140
|
-
|
|
141
|
-
/* @__PURE__ */ r(
|
|
160
|
+
a,
|
|
161
|
+
/* @__PURE__ */ r(De, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": !0 })
|
|
142
162
|
]
|
|
143
163
|
}
|
|
144
|
-
) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children:
|
|
164
|
+
) : /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: a });
|
|
145
165
|
}
|
|
146
|
-
function
|
|
166
|
+
function He({
|
|
147
167
|
event: t,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
168
|
+
repeats: o = 1,
|
|
169
|
+
direction: i,
|
|
170
|
+
onOpenRecord: a,
|
|
171
|
+
onSelect: d
|
|
151
172
|
}) {
|
|
152
|
-
const
|
|
153
|
-
|
|
173
|
+
const c = t.status ?? "info", m = Ke[c] ?? "neutral", u = T(t), h = i ? Ue[i] : null, f = (b) => {
|
|
174
|
+
b.target === b.currentTarget && (b.key === "Enter" || b.key === " ") && (b.preventDefault(), d(t));
|
|
154
175
|
};
|
|
155
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ s(
|
|
156
177
|
"li",
|
|
157
178
|
{
|
|
158
|
-
"data-ic-event":
|
|
179
|
+
"data-ic-event": u,
|
|
159
180
|
"data-ic-event-status": t.status ?? "",
|
|
160
181
|
className: "flex items-start gap-3 px-4 py-2.5 transition-colors hover:bg-muted/40",
|
|
161
182
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ s(
|
|
163
184
|
"div",
|
|
164
185
|
{
|
|
165
186
|
role: "button",
|
|
166
187
|
tabIndex: 0,
|
|
167
|
-
"data-ic-event-open":
|
|
168
|
-
onClick: () =>
|
|
169
|
-
onKeyDown:
|
|
188
|
+
"data-ic-event-open": u,
|
|
189
|
+
onClick: () => d(t),
|
|
190
|
+
onKeyDown: f,
|
|
170
191
|
className: "flex min-w-0 flex-1 cursor-pointer items-start gap-3 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
171
192
|
children: [
|
|
172
193
|
/* @__PURE__ */ r(
|
|
@@ -177,39 +198,51 @@ function qe({
|
|
|
177
198
|
children: le(t.created_at)
|
|
178
199
|
}
|
|
179
200
|
),
|
|
180
|
-
/* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
201
|
+
/* @__PURE__ */ s("span", { className: "flex w-[136px] shrink-0 items-center gap-2 pt-px", children: [
|
|
202
|
+
h && i ? /* @__PURE__ */ r(
|
|
203
|
+
h,
|
|
183
204
|
{
|
|
184
205
|
className: "h-3.5 w-3.5 shrink-0 text-muted-foreground",
|
|
185
206
|
role: "img",
|
|
186
|
-
"aria-label": ae[
|
|
187
|
-
"data-ic-event-direction":
|
|
188
|
-
"data-tip": ae[
|
|
207
|
+
"aria-label": ae[i],
|
|
208
|
+
"data-ic-event-direction": i,
|
|
209
|
+
"data-tip": ae[i]
|
|
189
210
|
}
|
|
190
211
|
) : /* @__PURE__ */ r("span", { className: "w-3.5 shrink-0", "aria-hidden": !0 }),
|
|
191
212
|
/* @__PURE__ */ r(
|
|
192
213
|
"span",
|
|
193
214
|
{
|
|
194
|
-
className:
|
|
215
|
+
className: w("h-2 w-2 shrink-0 rounded-full", Fe[m]),
|
|
195
216
|
role: "img",
|
|
196
|
-
"aria-label": oe[
|
|
197
|
-
"data-tip": oe[
|
|
217
|
+
"aria-label": oe[c] ?? "Info",
|
|
218
|
+
"data-tip": oe[c] ?? "Info"
|
|
198
219
|
}
|
|
199
220
|
),
|
|
200
221
|
/* @__PURE__ */ r("span", { className: "truncate text-[12.5px] text-muted-foreground", "data-tip": t.label, children: t.label })
|
|
201
222
|
] }),
|
|
202
|
-
/* @__PURE__ */
|
|
203
|
-
/* @__PURE__ */
|
|
204
|
-
/* @__PURE__ */ r(
|
|
205
|
-
t.record_count != null && t.record_count > 1 && /* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
|
|
224
|
+
/* @__PURE__ */ s("p", { className: "flex flex-wrap items-baseline gap-x-2 text-[13px] leading-5", children: [
|
|
225
|
+
/* @__PURE__ */ r(qe, { event: t, onOpenRecord: a }),
|
|
226
|
+
t.record_count != null && t.record_count > 1 && /* @__PURE__ */ s("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
|
|
206
227
|
t.record_count,
|
|
207
228
|
" records"
|
|
208
229
|
] }),
|
|
209
|
-
|
|
230
|
+
o > 1 && /* @__PURE__ */ s(
|
|
210
231
|
"span",
|
|
211
232
|
{
|
|
212
|
-
className:
|
|
233
|
+
className: "text-[12px] tabular-nums text-muted-foreground",
|
|
234
|
+
"data-ic-event-repeats": o,
|
|
235
|
+
"data-tip": `${o} identical events in the same second`,
|
|
236
|
+
children: [
|
|
237
|
+
"×",
|
|
238
|
+
o
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
c === "error" && /* @__PURE__ */ r(
|
|
243
|
+
"span",
|
|
244
|
+
{
|
|
245
|
+
className: w(
|
|
213
246
|
"rounded-full px-1.5 py-px text-[11px] font-medium",
|
|
214
247
|
ue.negative,
|
|
215
248
|
de.negative
|
|
@@ -218,9 +251,9 @@ function qe({
|
|
|
218
251
|
}
|
|
219
252
|
)
|
|
220
253
|
] }),
|
|
221
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ s("p", { className: "text-[12.5px] leading-5 text-foreground [overflow-wrap:anywhere]", children: [
|
|
222
255
|
t.text,
|
|
223
|
-
t.context && /* @__PURE__ */
|
|
256
|
+
t.context && /* @__PURE__ */ s("span", { className: "text-muted-foreground", children: [
|
|
224
257
|
" · ",
|
|
225
258
|
t.context
|
|
226
259
|
] })
|
|
@@ -229,114 +262,114 @@ function qe({
|
|
|
229
262
|
]
|
|
230
263
|
}
|
|
231
264
|
),
|
|
232
|
-
t.replayable && /* @__PURE__ */ r(
|
|
265
|
+
t.replayable && /* @__PURE__ */ r(Xe, { event: t })
|
|
233
266
|
]
|
|
234
267
|
}
|
|
235
268
|
);
|
|
236
269
|
}
|
|
237
|
-
function
|
|
238
|
-
return /* @__PURE__ */
|
|
270
|
+
function M({ title: t, children: o }) {
|
|
271
|
+
return /* @__PURE__ */ s("div", { className: "rounded-lg border border-border bg-card px-5 py-6", children: [
|
|
239
272
|
/* @__PURE__ */ r("p", { className: "text-[14px] font-semibold text-foreground", children: t }),
|
|
240
|
-
/* @__PURE__ */ r("div", { className: "mt-1 max-w-[70ch] text-[12.5px] text-muted-foreground", children:
|
|
273
|
+
/* @__PURE__ */ r("div", { className: "mt-1 max-w-[70ch] text-[12.5px] text-muted-foreground", children: o })
|
|
241
274
|
] });
|
|
242
275
|
}
|
|
243
|
-
function
|
|
276
|
+
function at({ onOpenRecord: t }) {
|
|
244
277
|
var V, z, G, J, Q, Z;
|
|
245
|
-
const [
|
|
278
|
+
const [o, i] = g(""), [a, d] = g(""), [c, m] = g(""), [u, h] = g(""), [f, b] = g(""), [U, I] = g(""), [R, A] = g(!1), [k, $] = g(null), v = Te(U.trim(), 350), Y = Oe(), [j, pe] = g([]), B = j.filter((e) => e.can_list), W = o ? B.filter((e) => e.direction === o) : B, me = a || (o && W.length === 1 ? W[0].id : ""), l = Re({
|
|
246
279
|
provider: me,
|
|
247
|
-
status:
|
|
248
|
-
partner:
|
|
249
|
-
caller:
|
|
250
|
-
record:
|
|
251
|
-
includePeople:
|
|
280
|
+
status: c,
|
|
281
|
+
partner: u || void 0,
|
|
282
|
+
caller: o === "in" && f ? f : void 0,
|
|
283
|
+
record: v || void 0,
|
|
284
|
+
includePeople: o === "in" && R
|
|
252
285
|
}), [fe, X] = g(!1), [, ge] = g(0);
|
|
253
|
-
|
|
254
|
-
const e = setInterval(() => ge((
|
|
286
|
+
L(() => {
|
|
287
|
+
const e = setInterval(() => ge((n) => n + 1), 3e4);
|
|
255
288
|
return () => clearInterval(e);
|
|
256
289
|
}, []);
|
|
257
|
-
const P = (z = (V =
|
|
258
|
-
|
|
290
|
+
const P = (z = (V = l.data) == null ? void 0 : V.pages[0]) == null ? void 0 : z.providers;
|
|
291
|
+
L(() => {
|
|
259
292
|
P && pe(P);
|
|
260
293
|
}, [P]);
|
|
261
|
-
const
|
|
294
|
+
const F = P ?? j, E = F.filter((e) => e.can_list), q = S(() => {
|
|
262
295
|
const e = /* @__PURE__ */ new Map();
|
|
263
|
-
for (const
|
|
296
|
+
for (const n of F) n.direction && e.set(n.id, n.direction);
|
|
264
297
|
return e;
|
|
265
|
-
}, [
|
|
298
|
+
}, [F]), H = (e) => e.direction ?? q.get(O(e)) ?? null, y = ((J = (G = l.data) == null ? void 0 : G.pages[0]) == null ? void 0 : J.record) ?? null, N = S(() => {
|
|
266
299
|
var p;
|
|
267
|
-
const e = /* @__PURE__ */ new Set(),
|
|
268
|
-
for (const
|
|
269
|
-
for (const ee of
|
|
270
|
-
const te =
|
|
271
|
-
e.has(te) || (e.add(te),
|
|
300
|
+
const e = /* @__PURE__ */ new Set(), n = [];
|
|
301
|
+
for (const x of ((p = l.data) == null ? void 0 : p.pages) ?? [])
|
|
302
|
+
for (const ee of x.entries) {
|
|
303
|
+
const te = T(ee);
|
|
304
|
+
e.has(te) || (e.add(te), n.push(ee));
|
|
272
305
|
}
|
|
273
|
-
return
|
|
274
|
-
}, [
|
|
275
|
-
() =>
|
|
276
|
-
[
|
|
277
|
-
), he =
|
|
306
|
+
return n;
|
|
307
|
+
}, [l.data]), _ = S(
|
|
308
|
+
() => o && !a ? N.filter((e) => H(e) === o) : N,
|
|
309
|
+
[N, o, a, q]
|
|
310
|
+
), he = S(() => {
|
|
278
311
|
const e = /* @__PURE__ */ new Set();
|
|
279
|
-
for (const
|
|
280
|
-
return
|
|
312
|
+
for (const n of N) n.partner && e.add(n.partner);
|
|
313
|
+
return u && e.add(u), [
|
|
281
314
|
{ value: "", label: "All partners" },
|
|
282
|
-
...[...e].sort((
|
|
315
|
+
...[...e].sort((n, p) => n.localeCompare(p)).map((n) => ({ value: n, label: n }))
|
|
283
316
|
];
|
|
284
|
-
}, [
|
|
317
|
+
}, [N, u]), be = S(() => {
|
|
285
318
|
const e = /* @__PURE__ */ new Map();
|
|
286
|
-
for (const
|
|
287
|
-
return
|
|
319
|
+
for (const n of N) n.caller && !e.has(n.caller) && e.set(n.caller, n.label);
|
|
320
|
+
return f && !e.has(f) && e.set(f, "Selected caller"), [
|
|
288
321
|
{ value: "", label: "All callers" },
|
|
289
|
-
...[...e.entries()].sort((
|
|
322
|
+
...[...e.entries()].sort((n, p) => n[1].localeCompare(p[1])).map(([n, p]) => ({ value: n, label: p }))
|
|
290
323
|
];
|
|
291
|
-
}, [
|
|
324
|
+
}, [N, f]), xe = S(() => {
|
|
292
325
|
const e = [];
|
|
293
|
-
for (const
|
|
294
|
-
const p =
|
|
295
|
-
|
|
326
|
+
for (const n of _) {
|
|
327
|
+
const p = We(n.created_at), x = e[e.length - 1];
|
|
328
|
+
x && x.key === p ? x.items.push(n) : e.push({ key: p, label: Be(n.created_at), items: [n] });
|
|
296
329
|
}
|
|
297
|
-
return e;
|
|
298
|
-
}, [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}, [
|
|
330
|
+
return e.map((n) => ({ ...n, rows: Ye(n.items) }));
|
|
331
|
+
}, [_]), ve = o !== "" || a !== "" || c !== "" || u !== "" || f !== "" || v !== "" || R, D = l.dataUpdatedAt ? new Date(l.dataUpdatedAt).toISOString() : null, ye = l.isRefetching && fe && !l.isFetchingNextPage;
|
|
332
|
+
L(() => {
|
|
333
|
+
l.isRefetching || X(!1);
|
|
334
|
+
}, [l.isRefetching]);
|
|
302
335
|
const Ne = () => {
|
|
303
|
-
|
|
336
|
+
i(""), d(""), m(""), h(""), b(""), I(""), A(!1);
|
|
304
337
|
}, we = (e) => {
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
e &&
|
|
338
|
+
i(e);
|
|
339
|
+
const n = E.find((p) => p.id === a);
|
|
340
|
+
e && n && n.direction !== e && d(""), e !== "in" && (b(""), A(!1));
|
|
308
341
|
}, ke = [
|
|
309
|
-
{ value: "", label:
|
|
310
|
-
...(
|
|
342
|
+
{ value: "", label: o ? "Every source" : "All sources" },
|
|
343
|
+
...(o ? E.filter((e) => e.direction === o) : E).map((e) => ({
|
|
311
344
|
value: e.id,
|
|
312
345
|
label: e.label
|
|
313
346
|
}))
|
|
314
|
-
], Ce = /* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
347
|
+
], Ce = /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
348
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-2", children: [
|
|
316
349
|
/* @__PURE__ */ r("p", { className: "min-w-0 text-[13px] text-muted-foreground", "data-ic-events-summary": !0, children: "What each partner reported, newest first, across every record. Open an event to see everything it set off." }),
|
|
317
|
-
/* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ s(
|
|
318
351
|
"button",
|
|
319
352
|
{
|
|
320
353
|
type: "button",
|
|
321
354
|
"data-ic-events-refresh": !0,
|
|
322
|
-
disabled:
|
|
355
|
+
disabled: l.isFetching,
|
|
323
356
|
onClick: () => {
|
|
324
|
-
X(!0),
|
|
357
|
+
X(!0), l.refetch();
|
|
325
358
|
},
|
|
326
359
|
"data-tip": D ? `Updated ${ce(D)}` : void 0,
|
|
327
360
|
className: "inline-flex h-8 items-center gap-1.5 rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
328
361
|
children: [
|
|
329
|
-
/* @__PURE__ */ r(ie, { className:
|
|
362
|
+
/* @__PURE__ */ r(ie, { className: w("h-3.5 w-3.5", ye && "animate-spin") }),
|
|
330
363
|
D ? `Updated ${le(D)}` : "Refresh"
|
|
331
364
|
]
|
|
332
365
|
}
|
|
333
366
|
)
|
|
334
367
|
] }),
|
|
335
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
336
369
|
/* @__PURE__ */ r(
|
|
337
370
|
se,
|
|
338
371
|
{
|
|
339
|
-
value:
|
|
372
|
+
value: o,
|
|
340
373
|
options: Me,
|
|
341
374
|
onChange: we,
|
|
342
375
|
label: "Direction",
|
|
@@ -344,9 +377,9 @@ function ot({ onOpenRecord: t }) {
|
|
|
344
377
|
}
|
|
345
378
|
),
|
|
346
379
|
/* @__PURE__ */ r("div", { "data-ic-events-source": !0, children: /* @__PURE__ */ r(
|
|
347
|
-
|
|
380
|
+
K,
|
|
348
381
|
{
|
|
349
|
-
value:
|
|
382
|
+
value: a,
|
|
350
383
|
onChange: d,
|
|
351
384
|
options: ke,
|
|
352
385
|
ariaLabel: "Source",
|
|
@@ -354,20 +387,20 @@ function ot({ onOpenRecord: t }) {
|
|
|
354
387
|
}
|
|
355
388
|
) }),
|
|
356
389
|
/* @__PURE__ */ r("div", { "data-ic-events-partner": !0, children: /* @__PURE__ */ r(
|
|
357
|
-
|
|
390
|
+
K,
|
|
358
391
|
{
|
|
359
|
-
value:
|
|
392
|
+
value: u,
|
|
360
393
|
onChange: h,
|
|
361
394
|
options: he,
|
|
362
395
|
ariaLabel: "Partner",
|
|
363
396
|
className: "h-8 w-[150px] border-border bg-card text-[12.5px]"
|
|
364
397
|
}
|
|
365
398
|
) }),
|
|
366
|
-
|
|
367
|
-
|
|
399
|
+
o === "in" && /* @__PURE__ */ r("div", { "data-ic-events-caller": !0, children: /* @__PURE__ */ r(
|
|
400
|
+
K,
|
|
368
401
|
{
|
|
369
|
-
value:
|
|
370
|
-
onChange:
|
|
402
|
+
value: f,
|
|
403
|
+
onChange: b,
|
|
371
404
|
options: be,
|
|
372
405
|
ariaLabel: "Caller",
|
|
373
406
|
className: "h-8 w-[170px] border-border bg-card text-[12.5px]"
|
|
@@ -376,17 +409,17 @@ function ot({ onOpenRecord: t }) {
|
|
|
376
409
|
/* @__PURE__ */ r(
|
|
377
410
|
se,
|
|
378
411
|
{
|
|
379
|
-
value:
|
|
380
|
-
options:
|
|
381
|
-
onChange:
|
|
412
|
+
value: c,
|
|
413
|
+
options: je,
|
|
414
|
+
onChange: m,
|
|
382
415
|
label: "Status",
|
|
383
416
|
"data-ic-events-status": !0
|
|
384
417
|
}
|
|
385
418
|
),
|
|
386
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ s("label", { className: "relative inline-flex h-8 items-center", children: [
|
|
387
420
|
/* @__PURE__ */ r("span", { className: "sr-only", children: "Find events that touched a record" }),
|
|
388
421
|
/* @__PURE__ */ r(
|
|
389
|
-
|
|
422
|
+
Se,
|
|
390
423
|
{
|
|
391
424
|
className: "pointer-events-none absolute left-2.5 h-3.5 w-3.5 text-muted-foreground",
|
|
392
425
|
"aria-hidden": !0
|
|
@@ -404,7 +437,7 @@ function ot({ onOpenRecord: t }) {
|
|
|
404
437
|
}
|
|
405
438
|
)
|
|
406
439
|
] }),
|
|
407
|
-
|
|
440
|
+
o === "in" && /* @__PURE__ */ s(
|
|
408
441
|
"div",
|
|
409
442
|
{
|
|
410
443
|
className: "inline-flex h-8 items-center gap-2 text-[12.5px] text-foreground",
|
|
@@ -412,11 +445,11 @@ function ot({ onOpenRecord: t }) {
|
|
|
412
445
|
"data-tip": "Also list calls made with people's own tokens, not only integration accounts",
|
|
413
446
|
children: [
|
|
414
447
|
/* @__PURE__ */ r(
|
|
415
|
-
|
|
448
|
+
Ie,
|
|
416
449
|
{
|
|
417
450
|
id: Y,
|
|
418
|
-
checked:
|
|
419
|
-
onCheckedChange: (e) =>
|
|
451
|
+
checked: R,
|
|
452
|
+
onCheckedChange: (e) => A(e === !0)
|
|
420
453
|
}
|
|
421
454
|
),
|
|
422
455
|
/* @__PURE__ */ r("label", { htmlFor: Y, className: "cursor-pointer", children: "Include people's tokens" })
|
|
@@ -424,28 +457,28 @@ function ot({ onOpenRecord: t }) {
|
|
|
424
457
|
}
|
|
425
458
|
)
|
|
426
459
|
] }),
|
|
427
|
-
|
|
460
|
+
v && !l.isPlaceholderData && !l.isLoading && !l.isError && /* @__PURE__ */ s(
|
|
428
461
|
"p",
|
|
429
462
|
{
|
|
430
463
|
className: "flex flex-wrap items-center gap-2 text-[12.5px] text-muted-foreground",
|
|
431
|
-
"data-ic-events-record":
|
|
464
|
+
"data-ic-events-record": y ? `${y.collection}:${y.item}` : "none",
|
|
432
465
|
children: [
|
|
433
|
-
|
|
466
|
+
y ? /* @__PURE__ */ s(re, { children: [
|
|
434
467
|
"Events that touched ",
|
|
435
|
-
/* @__PURE__ */ r("span", { className: "font-medium text-foreground", children:
|
|
436
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: v }),
|
|
469
|
+
/* @__PURE__ */ s("span", { className: "text-[12px]", children: [
|
|
437
470
|
"(",
|
|
438
|
-
|
|
471
|
+
y.collection.replace(/_/g, " "),
|
|
439
472
|
" ",
|
|
440
|
-
|
|
473
|
+
y.item,
|
|
441
474
|
")"
|
|
442
475
|
] })
|
|
443
|
-
] }) : /* @__PURE__ */
|
|
476
|
+
] }) : /* @__PURE__ */ s(re, { children: [
|
|
444
477
|
"No record matches “",
|
|
445
|
-
|
|
478
|
+
v,
|
|
446
479
|
"”"
|
|
447
480
|
] }),
|
|
448
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ s(
|
|
449
482
|
"button",
|
|
450
483
|
{
|
|
451
484
|
type: "button",
|
|
@@ -453,7 +486,7 @@ function ot({ onOpenRecord: t }) {
|
|
|
453
486
|
onClick: () => I(""),
|
|
454
487
|
className: "inline-flex h-6 items-center gap-1 rounded px-1.5 font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
455
488
|
children: [
|
|
456
|
-
/* @__PURE__ */ r(
|
|
489
|
+
/* @__PURE__ */ r(Pe, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
457
490
|
"Clear"
|
|
458
491
|
]
|
|
459
492
|
}
|
|
@@ -462,9 +495,9 @@ function ot({ onOpenRecord: t }) {
|
|
|
462
495
|
}
|
|
463
496
|
)
|
|
464
497
|
] });
|
|
465
|
-
let
|
|
466
|
-
if (
|
|
467
|
-
|
|
498
|
+
let C;
|
|
499
|
+
if (l.isLoading)
|
|
500
|
+
C = /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-lg border border-border bg-card", "aria-busy": !0, children: [0, 1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ s(
|
|
468
501
|
"div",
|
|
469
502
|
{
|
|
470
503
|
className: "flex items-center gap-3 border-t border-border px-4 py-3 first:border-t-0",
|
|
@@ -476,12 +509,12 @@ function ot({ onOpenRecord: t }) {
|
|
|
476
509
|
},
|
|
477
510
|
e
|
|
478
511
|
)) });
|
|
479
|
-
else if (
|
|
480
|
-
const e = ((Z = (Q =
|
|
481
|
-
|
|
512
|
+
else if (l.isError) {
|
|
513
|
+
const e = ((Z = (Q = l.error) == null ? void 0 : Q.response) == null ? void 0 : Z.error) ?? (l.error instanceof Error ? l.error.message : null);
|
|
514
|
+
C = /* @__PURE__ */ s(
|
|
482
515
|
"p",
|
|
483
516
|
{
|
|
484
|
-
className:
|
|
517
|
+
className: w(
|
|
485
518
|
"rounded-lg border px-4 py-3 text-[12.5px]",
|
|
486
519
|
$e.negative,
|
|
487
520
|
ue.negative,
|
|
@@ -494,15 +527,15 @@ function ot({ onOpenRecord: t }) {
|
|
|
494
527
|
]
|
|
495
528
|
}
|
|
496
529
|
);
|
|
497
|
-
} else
|
|
530
|
+
} else E.length === 0 ? C = /* @__PURE__ */ s(M, { title: "No integration reports events yet", children: [
|
|
498
531
|
"An extension adds a source with",
|
|
499
532
|
" ",
|
|
500
533
|
/* @__PURE__ */ r("code", { className: "font-mono text-[12px] text-foreground", children: "ctx.notes.registerSource" }),
|
|
501
534
|
" and a ",
|
|
502
535
|
/* @__PURE__ */ r("code", { className: "font-mono text-[12px] text-foreground", children: "list" }),
|
|
503
536
|
" function; its events then appear here, newest first, with Replay where the source can re-apply one."
|
|
504
|
-
] }) :
|
|
505
|
-
|
|
537
|
+
] }) : _.length === 0 ? C = ve ? /* @__PURE__ */ s(M, { title: "Nothing matches", children: [
|
|
538
|
+
v && !y ? `No record matches “${v}”. ` : "No events match these filters. ",
|
|
506
539
|
/* @__PURE__ */ r(
|
|
507
540
|
"button",
|
|
508
541
|
{
|
|
@@ -513,69 +546,71 @@ function ot({ onOpenRecord: t }) {
|
|
|
513
546
|
children: "Clear the filters"
|
|
514
547
|
}
|
|
515
548
|
)
|
|
516
|
-
] }) : /* @__PURE__ */ r(
|
|
549
|
+
] }) : /* @__PURE__ */ r(M, { title: "No events yet", children: "The sources are connected but have not reported anything. Events appear here as partners send them." }) : C = /* @__PURE__ */ s(
|
|
517
550
|
"div",
|
|
518
551
|
{
|
|
519
|
-
className:
|
|
520
|
-
"aria-busy":
|
|
552
|
+
className: w("space-y-5 transition-opacity", l.isPlaceholderData && "opacity-60"),
|
|
553
|
+
"aria-busy": l.isPlaceholderData || void 0,
|
|
521
554
|
children: [
|
|
522
|
-
xe.map((e) => /* @__PURE__ */
|
|
523
|
-
/* @__PURE__ */
|
|
555
|
+
xe.map((e) => /* @__PURE__ */ s("section", { "data-ic-events-day": e.key, "aria-label": e.label, children: [
|
|
556
|
+
/* @__PURE__ */ s("h3", { className: "mb-2 flex items-baseline gap-2 text-[12.5px] font-semibold text-foreground", children: [
|
|
524
557
|
e.label,
|
|
525
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ s("span", { className: "text-[12px] font-normal tabular-nums text-muted-foreground", children: [
|
|
526
559
|
e.items.length,
|
|
527
560
|
" event",
|
|
528
561
|
e.items.length === 1 ? "" : "s"
|
|
529
562
|
] })
|
|
530
563
|
] }),
|
|
531
|
-
/* @__PURE__ */ r("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: e.
|
|
532
|
-
|
|
564
|
+
/* @__PURE__ */ r("ul", { className: "divide-y divide-border overflow-hidden rounded-lg border border-border bg-card", children: e.rows.map(({ event: n, repeats: p }) => /* @__PURE__ */ r(
|
|
565
|
+
He,
|
|
533
566
|
{
|
|
534
|
-
event:
|
|
535
|
-
|
|
567
|
+
event: n,
|
|
568
|
+
repeats: p,
|
|
569
|
+
direction: H(n),
|
|
536
570
|
onOpenRecord: t,
|
|
537
|
-
onSelect: (
|
|
571
|
+
onSelect: (x) => $({ target: { source: O(x), id: String(x.id) }, event: x })
|
|
538
572
|
},
|
|
539
|
-
|
|
573
|
+
T(n)
|
|
540
574
|
)) })
|
|
541
575
|
] }, e.key)),
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
|
|
576
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
|
|
577
|
+
l.hasNextPage ? /* @__PURE__ */ r(
|
|
544
578
|
"button",
|
|
545
579
|
{
|
|
546
580
|
type: "button",
|
|
547
581
|
"data-ic-events-older": !0,
|
|
548
|
-
disabled:
|
|
549
|
-
onClick: () => void
|
|
582
|
+
disabled: l.isFetchingNextPage,
|
|
583
|
+
onClick: () => void l.fetchNextPage(),
|
|
550
584
|
className: "inline-flex h-8 items-center rounded-md border border-border bg-card px-3 text-[12.5px] font-medium text-foreground transition-colors hover:bg-muted disabled:opacity-70 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
551
|
-
children:
|
|
585
|
+
children: l.isFetchingNextPage ? "Loading older…" : "Show older"
|
|
552
586
|
}
|
|
553
587
|
) : /* @__PURE__ */ r("p", { className: "text-[12px] text-muted-foreground", "data-ic-events-end": !0, children: "That is as far back as the sources keep." }),
|
|
554
|
-
/* @__PURE__ */
|
|
555
|
-
|
|
588
|
+
/* @__PURE__ */ s("span", { className: "text-[12px] tabular-nums text-muted-foreground", children: [
|
|
589
|
+
_.length,
|
|
556
590
|
" shown"
|
|
557
591
|
] })
|
|
558
592
|
] })
|
|
559
593
|
]
|
|
560
594
|
}
|
|
561
595
|
);
|
|
562
|
-
return /* @__PURE__ */
|
|
596
|
+
return /* @__PURE__ */ s("div", { className: "space-y-4", "data-ic-events": !0, children: [
|
|
563
597
|
Ce,
|
|
564
|
-
|
|
598
|
+
C,
|
|
565
599
|
/* @__PURE__ */ r(
|
|
566
600
|
Le,
|
|
567
601
|
{
|
|
568
|
-
target: (
|
|
569
|
-
event:
|
|
570
|
-
onClose: () =>
|
|
602
|
+
target: (k == null ? void 0 : k.target) ?? null,
|
|
603
|
+
event: k == null ? void 0 : k.event,
|
|
604
|
+
onClose: () => $(null),
|
|
571
605
|
onOpenRecord: t,
|
|
572
|
-
onOpenEvent: (e) =>
|
|
606
|
+
onOpenEvent: (e) => $({ target: e, event: null })
|
|
573
607
|
}
|
|
574
608
|
)
|
|
575
609
|
] });
|
|
576
610
|
}
|
|
577
611
|
export {
|
|
578
|
-
|
|
612
|
+
at as EventsView,
|
|
579
613
|
se as Segment,
|
|
580
|
-
|
|
614
|
+
Ye as collapseRepeats,
|
|
615
|
+
Be as dayHeading
|
|
581
616
|
};
|