@nivaro/react 0.3.10 → 0.3.12
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/useNivaroForm.js +1 -1
- package/dist/hooks/useSessionRecorder.js +109 -102
- package/dist/index.d.ts +34 -3
- package/dist/shared/components/CollectionBrowserView.js +1546 -1477
- package/dist/shared/components/ItemEditForm.js +4332 -4195
- package/dist/shared/components/PageRenderer.js +512 -465
- package/dist/shared/components/ProfileView.js +115 -109
- package/dist/shared/components/QueryStatStrip.js +74 -70
- package/dist/shared/components/ReportView.js +818 -827
- package/dist/shared/components/SheetHeaderBody.js +16 -14
- package/dist/shared/components/chat/ChatPanel.js +492 -472
- package/dist/shared/components/item-edit/CatalogPickerField.js +1029 -933
- package/dist/shared/components/item-edit/FieldRenderer.js +161 -156
- package/dist/shared/components/item-edit/FieldRow.js +20 -19
- package/dist/shared/components/item-edit/FilePickerField.js +52 -40
- package/dist/shared/components/item-edit/GroupSection.js +221 -221
- package/dist/shared/components/item-edit/InlineGridField.js +41 -41
- package/dist/shared/components/item-edit/InlineTableField.js +2249 -2238
- package/dist/shared/components/item-edit/M2MCombobox.js +46 -44
- package/dist/shared/components/item-edit/NestedRelationEditor.js +11 -11
- package/dist/shared/components/item-edit/QuickPicker.js +263 -216
- package/dist/shared/components/item-edit/RelationCombobox.js +285 -245
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +42 -32
- package/dist/shared/components/item-edit/RowHistorySheet.js +130 -134
- package/dist/shared/components/item-edit/SummaryPanel.js +305 -279
- package/dist/shared/components/item-edit/UserChip.js +301 -233
- package/dist/shared/components/item-edit/helpers.js +133 -134
- package/dist/shared/components/item-edit/line-qty.js +57 -0
- package/dist/shared/components/item-edit/option-disambiguate.js +53 -0
- package/dist/shared/components/panels/AddendumLinesDiff.js +87 -90
- package/dist/shared/components/panels/CommentPanel.js +350 -315
- package/dist/shared/components/panels/ItemLockBanner.js +297 -230
- package/dist/shared/components/panels/PipelinePanel.js +719 -701
- package/dist/shared/components/profile/PersonAdminTools.js +168 -144
- package/dist/shared/components/profile/PersonProfile.js +42 -41
- package/dist/shared/components/profile/session-actions.js +52 -0
- package/dist/shared/components/queue/QueueQuickFilters.js +43 -41
- package/dist/shared/components/queue/QueueWorklist.js +1005 -935
- package/dist/shared/components/widgets/ReviewListWidget.js +99 -93
- package/dist/shared/lib/obligation-banner.js +14 -13
- package/dist/shared/lib/obligation-reason-text.js +13 -0
- package/dist/shared/lib/query-filter-seed.js +34 -11
- package/dist/shared/lib/replay-checkout.js +20 -0
- package/dist/shared/lib/sanitize-html.js +24 -15
- package/dist/shared/lib/sheet-def.js +38 -22
- package/dist/shared/lib/unique-options.js +10 -0
- package/dist/shared/lib/utils.js +57 -43
- package/dist/shared/lib/validation-rules.js +58 -34
- package/package.json +1 -1
|
@@ -197,7 +197,7 @@ function ke(r, c, l) {
|
|
|
197
197
|
e.required && ye(s) && (t[e.field] == null && (t[e.field] = []), t[e.field].push(`${e.label} is required`));
|
|
198
198
|
for (const i of e.validationRules ?? []) {
|
|
199
199
|
if (i.soft) continue;
|
|
200
|
-
const m = pe(i, s, e.label);
|
|
200
|
+
const m = pe(i, s, e.label, f);
|
|
201
201
|
m && (t[e.field] == null && (t[e.field] = []), t[e.field].push(m));
|
|
202
202
|
}
|
|
203
203
|
const n = F == null ? void 0 : F[e.field];
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as
|
|
1
|
+
import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as L } from "@nivaro/sdk";
|
|
2
2
|
import { useRef as de, useEffect as fe } from "react";
|
|
3
|
-
import { sessionStore as pe, sharedChunkStore as he, ReplayUploader as me, clearResume as P, ORPHAN_TTL_MS as we, readResume as
|
|
4
|
-
import { useAutoRecord as
|
|
5
|
-
import { useOptionalNivaroClient as
|
|
3
|
+
import { sessionStore as pe, sharedChunkStore as he, ReplayUploader as me, clearResume as P, ORPHAN_TTL_MS as we, readResume as ye, isResumable as ge, splitBySize as Z, writeResume as ve, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se, errorStatus as ke, clipChunkFailure as Ce } from "./replayUploadQueue.js";
|
|
4
|
+
import { useAutoRecord as Ee } from "./useAutoRecord.js";
|
|
5
|
+
import { useOptionalNivaroClient as Ae } from "../shared/context.js";
|
|
6
6
|
import { normalizeReplayMasking as B, buildReplayMaskingOptions as z } from "../shared/lib/replay-masking.js";
|
|
7
|
-
import { normalizeReplaySampling as x, replaySampleDraw as Ie, currentReplayRoute as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
import { normalizeReplaySampling as x, replaySampleDraw as Ie, currentReplayRoute as D, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
|
|
8
|
+
import { noteReplayEvent as _e, createReplayCheckoutState as De } from "../shared/lib/replay-checkout.js";
|
|
9
|
+
import { emitReplayTap as Te, setReplayRecorderMode as N, registerReplayCapture as qe, clipEndOffset as Le, withClipKind as Pe } from "../shared/lib/replay-capture.js";
|
|
10
|
+
import { instrumentConsole as Ne, instrumentRequests as Fe, redactSecrets as Me } from "../shared/lib/replay-context.js";
|
|
11
|
+
import { instrumentSocket as Oe } from "../shared/lib/replay-socket.js";
|
|
12
|
+
const Ue = "nivaro-react@0.3.12", j = 1e4, We = 150, He = 3e3, Ke = 600, $e = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
13
|
+
function Be(n) {
|
|
13
14
|
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
14
15
|
const u = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
|
15
16
|
return u && (d.Authorization = `Bearer ${u}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
|
|
@@ -21,32 +22,32 @@ function Ke(n) {
|
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
24
|
}
|
|
24
|
-
async function
|
|
25
|
-
const l = Z(u), { routes:
|
|
25
|
+
async function ze(n, f, a, u, d) {
|
|
26
|
+
const l = Z(u), { routes: R } = ee(l, d.startRoute);
|
|
26
27
|
for (const [c, e] of l.entries()) {
|
|
27
28
|
const g = a();
|
|
28
29
|
try {
|
|
29
30
|
await n.request(
|
|
30
31
|
X(f, g, e, {
|
|
31
|
-
route:
|
|
32
|
+
route: R[c],
|
|
32
33
|
...d.build ? { build: d.build } : {}
|
|
33
34
|
})
|
|
34
35
|
);
|
|
35
36
|
} catch (v) {
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
|
|
37
|
+
const b = ke(v);
|
|
38
|
+
if (Ce(b) === "stop") return "closed";
|
|
39
|
+
b === 413 && console.warn(`[session-recorder] chunk ${g} too large — dropped`);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
return "ok";
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
-
let J = !1,
|
|
45
|
-
async function
|
|
46
|
-
if (!
|
|
44
|
+
const xe = 3e4, Ye = 3e4;
|
|
45
|
+
let J = !1, y = null, k = null;
|
|
46
|
+
async function je(n = "error") {
|
|
47
|
+
if (!k) return null;
|
|
47
48
|
try {
|
|
48
49
|
return await Promise.race([
|
|
49
|
-
|
|
50
|
+
k(n),
|
|
50
51
|
new Promise((f) => setTimeout(() => f(null), 4e3))
|
|
51
52
|
]);
|
|
52
53
|
} catch {
|
|
@@ -63,27 +64,27 @@ async function Q() {
|
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
function V(n, f) {
|
|
66
|
-
const a =
|
|
67
|
+
const a = Ne(n), u = Fe(n), d = Oe(n), l = () => {
|
|
67
68
|
f == null || f();
|
|
68
69
|
try {
|
|
69
70
|
n("route", {
|
|
70
|
-
path:
|
|
71
|
+
path: Me(window.location.pathname + window.location.search)
|
|
71
72
|
});
|
|
72
73
|
} catch {
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
+
}, R = history.pushState.bind(history), c = history.replaceState.bind(history);
|
|
75
76
|
return history.pushState = (...e) => {
|
|
76
|
-
|
|
77
|
+
R(...e), l();
|
|
77
78
|
}, history.replaceState = (...e) => {
|
|
78
79
|
c(...e), l();
|
|
79
80
|
}, window.addEventListener("popstate", l), l(), () => {
|
|
80
|
-
a(), u(), d(), history.pushState =
|
|
81
|
+
a(), u(), d(), history.pushState = R, history.replaceState = c, window.removeEventListener("popstate", l);
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
const f =
|
|
85
|
-
|
|
86
|
-
const
|
|
84
|
+
function st(n = {}) {
|
|
85
|
+
const f = Ae(), a = n.client ?? f, u = n.app, d = n.disabled ?? !1, l = n.build ?? Ue;
|
|
86
|
+
Ee({ client: a, disabled: d });
|
|
87
|
+
const R = de({
|
|
87
88
|
buffer: [],
|
|
88
89
|
stop: null,
|
|
89
90
|
uninstrument: null,
|
|
@@ -102,94 +103,94 @@ function nt(n = {}) {
|
|
|
102
103
|
fe(() => {
|
|
103
104
|
if (!a || d || typeof window > "u") return;
|
|
104
105
|
let c = !1;
|
|
105
|
-
const e =
|
|
106
|
+
const e = R.current;
|
|
106
107
|
e.dead = !1;
|
|
107
|
-
const g = a, v = pe(),
|
|
108
|
+
const g = a, v = pe(), b = $e(u), C = he(), E = Be(g), te = async (t, r, i, h, w = {}) => {
|
|
108
109
|
if (!h || !E) {
|
|
109
|
-
await g.request(X(t, r, i,
|
|
110
|
+
await g.request(X(t, r, i, w));
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
const
|
|
113
|
-
if (!
|
|
114
|
-
}, o = new me({ store:
|
|
115
|
-
let
|
|
116
|
-
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >=
|
|
117
|
-
function
|
|
118
|
-
o.recordingId &&
|
|
113
|
+
const s = await E(t, JSON.stringify({ seq: r, events: i, ...w }));
|
|
114
|
+
if (!s.ok) throw Object.assign(new Error(`HTTP ${s.status}`), { status: s.status });
|
|
115
|
+
}, o = new me({ store: C, send: te, online: G });
|
|
116
|
+
let S = null, A = 0;
|
|
117
|
+
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= He;
|
|
118
|
+
function I() {
|
|
119
|
+
o.recordingId && ve(v, b, {
|
|
119
120
|
recordingId: o.recordingId,
|
|
120
121
|
nextSeq: o.nextSeq,
|
|
121
122
|
startedAt: e.startedAt,
|
|
122
123
|
lastActivityAt: Date.now()
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
126
|
+
function _() {
|
|
127
|
+
S && clearTimeout(S), S = null, A = 0;
|
|
127
128
|
}
|
|
128
129
|
function ne() {
|
|
129
|
-
|
|
130
|
+
_();
|
|
130
131
|
const t = Se(o.attempt);
|
|
131
|
-
A = Date.now() + t,
|
|
132
|
-
|
|
132
|
+
A = Date.now() + t, S = setTimeout(() => {
|
|
133
|
+
S = null, A = 0, m(!0);
|
|
133
134
|
}, t);
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
+
function F() {
|
|
136
137
|
var t;
|
|
137
|
-
e.dead = !0, (t = e.stop) == null || t.call(e), e.stop = null, e.buffer = [],
|
|
138
|
+
e.dead = !0, (t = e.stop) == null || t.call(e), e.stop = null, e.buffer = [], _(), o.discard(), o.stopped = !0, P(v, b);
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
+
function M(t) {
|
|
140
141
|
if (e.buffer.length === 0 || !o.recordingId) return;
|
|
141
142
|
const r = e.buffer;
|
|
142
143
|
e.buffer = [];
|
|
143
144
|
const i = Z(r, t ? be : Re), { routes: h } = ee(i, e.bufferRoute);
|
|
144
|
-
for (const [
|
|
145
|
-
o.enqueue(
|
|
146
|
-
|
|
145
|
+
for (const [w, s] of i.entries())
|
|
146
|
+
o.enqueue(s, { route: h[w], ...l ? { build: l } : {} });
|
|
147
|
+
I();
|
|
147
148
|
}
|
|
148
149
|
async function oe(t) {
|
|
149
150
|
if (!c) {
|
|
150
151
|
if (t === "retry") ne();
|
|
151
|
-
else if (t === "closed" || t === "abandoned")
|
|
152
|
+
else if (t === "closed" || t === "abandoned") F();
|
|
152
153
|
else if (t === "stale")
|
|
153
154
|
try {
|
|
154
|
-
const r = await g.request(
|
|
155
|
+
const r = await g.request(L(u));
|
|
155
156
|
if (c) return;
|
|
156
|
-
o.rebase(r.data.id), e.startedAt = Date.now(),
|
|
157
|
+
o.rebase(r.data.id), e.startedAt = Date.now(), I(), e.flushAfter = !0;
|
|
157
158
|
} catch {
|
|
158
|
-
|
|
159
|
+
F();
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
function m(t = !1, r = !1) {
|
|
163
|
-
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length <
|
|
164
|
+
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Ke || (M(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
|
|
164
165
|
}).finally(() => {
|
|
165
166
|
e.inFlight = null, e.flushAfter && (e.flushAfter = !1, m(!0));
|
|
166
167
|
}), e.inFlight);
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function O() {
|
|
169
170
|
const t = window.requestIdleCallback;
|
|
170
171
|
t ? t(() => void m(), { timeout: j }) : m();
|
|
171
172
|
}
|
|
172
173
|
async function ie() {
|
|
173
174
|
const t = await Q();
|
|
174
175
|
if (c || !t) return;
|
|
175
|
-
|
|
176
|
-
const r =
|
|
177
|
-
if (r &&
|
|
178
|
-
const s = await
|
|
176
|
+
C.prune(Date.now() - we);
|
|
177
|
+
const r = ye(v, b);
|
|
178
|
+
if (r && ge(r, Date.now())) {
|
|
179
|
+
const s = await C.list(r.recordingId);
|
|
179
180
|
if (c) return;
|
|
180
181
|
o.begin(r.recordingId, r.nextSeq, { trusted: !1, restored: s }), e.startedAt = r.startedAt;
|
|
181
182
|
} else {
|
|
182
|
-
r && (
|
|
183
|
-
const s = await g.request(
|
|
183
|
+
r && (C.clear(r.recordingId), P(v, b));
|
|
184
|
+
const s = await g.request(L(u));
|
|
184
185
|
if (c) return;
|
|
185
186
|
o.begin(s.data.id), e.startedAt = Date.now();
|
|
186
187
|
}
|
|
187
|
-
|
|
188
|
+
I(), e.lastNavAt = Date.now();
|
|
188
189
|
const i = Ie(v);
|
|
189
|
-
e.route =
|
|
190
|
+
e.route = D(), e.bufferRoute = e.route, e.sampled = Y(q, e.route, i);
|
|
190
191
|
const h = () => {
|
|
191
192
|
var p;
|
|
192
|
-
e.route =
|
|
193
|
+
e.route = D();
|
|
193
194
|
const s = e.sampled;
|
|
194
195
|
if (e.sampled = Y(q, e.route, i), e.sampled && !s)
|
|
195
196
|
try {
|
|
@@ -199,13 +200,19 @@ function nt(n = {}) {
|
|
|
199
200
|
);
|
|
200
201
|
} catch {
|
|
201
202
|
}
|
|
202
|
-
};
|
|
203
|
+
}, w = De();
|
|
203
204
|
e.stop = t({
|
|
204
205
|
emit(s) {
|
|
205
|
-
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >=
|
|
206
|
+
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= We && O(), _e(w, s) && setTimeout(() => {
|
|
207
|
+
var p;
|
|
208
|
+
try {
|
|
209
|
+
(p = t.takeFullSnapshot) == null || p.call(t, !0);
|
|
210
|
+
} catch {
|
|
211
|
+
w.pending = !1;
|
|
212
|
+
}
|
|
213
|
+
}, 0));
|
|
206
214
|
},
|
|
207
|
-
...z(() =>
|
|
208
|
-
checkoutEveryNms: 6e4
|
|
215
|
+
...z(() => T)
|
|
209
216
|
}) ?? null, e.uninstrument = V(
|
|
210
217
|
(s, p) => t.addCustomEvent(
|
|
211
218
|
s,
|
|
@@ -214,12 +221,12 @@ function nt(n = {}) {
|
|
|
214
221
|
() => {
|
|
215
222
|
e.lastNavAt = Date.now(), h();
|
|
216
223
|
}
|
|
217
|
-
),
|
|
224
|
+
), k = async () => {
|
|
218
225
|
if (!o.recordingId) return null;
|
|
219
226
|
const s = Date.now() - e.startedAt;
|
|
220
227
|
return await m(!0).catch(() => {
|
|
221
228
|
}), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null;
|
|
222
|
-
}, N("full"),
|
|
229
|
+
}, N("full"), y = () => {
|
|
223
230
|
if (!o.recordingId) return null;
|
|
224
231
|
const s = Date.now() - e.startedAt;
|
|
225
232
|
return async () => (await m(!0).catch(() => {
|
|
@@ -228,67 +235,67 @@ function nt(n = {}) {
|
|
|
228
235
|
}
|
|
229
236
|
async function se() {
|
|
230
237
|
const t = await Q();
|
|
231
|
-
c || !t || (e.buffer = [], e.prevWindow = [], e.route =
|
|
238
|
+
c || !t || (e.buffer = [], e.prevWindow = [], e.route = D(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
|
|
232
239
|
emit(r, i) {
|
|
233
|
-
|
|
240
|
+
Te(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
|
|
234
241
|
},
|
|
235
|
-
...z(() =>
|
|
236
|
-
checkoutEveryNms:
|
|
242
|
+
...z(() => T),
|
|
243
|
+
checkoutEveryNms: xe
|
|
237
244
|
}) ?? null, e.uninstrument = V(
|
|
238
245
|
(r, i) => t.addCustomEvent(
|
|
239
246
|
r,
|
|
240
247
|
i
|
|
241
248
|
),
|
|
242
249
|
() => {
|
|
243
|
-
e.route =
|
|
250
|
+
e.route = D();
|
|
244
251
|
}
|
|
245
|
-
), N("clip"),
|
|
252
|
+
), N("clip"), y = (r) => {
|
|
246
253
|
const i = [...e.prevWindow, ...e.buffer], h = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
|
|
247
254
|
if (i.length === 0 || !a) return null;
|
|
248
|
-
const
|
|
255
|
+
const w = Le(i, r);
|
|
249
256
|
return async () => {
|
|
250
|
-
const
|
|
251
|
-
|
|
257
|
+
const p = (await a.request(
|
|
258
|
+
Pe(L(u ?? "error-clip", void 0, !0), r)
|
|
252
259
|
)).data.id;
|
|
253
260
|
let le = 0;
|
|
254
|
-
return await
|
|
261
|
+
return await ze(a, p, () => le++, i, {
|
|
255
262
|
startRoute: h,
|
|
256
263
|
build: l
|
|
257
|
-
}) === "ok" && await a.request($(
|
|
258
|
-
}), { recording_id:
|
|
264
|
+
}) === "ok" && await a.request($(p)).catch(() => {
|
|
265
|
+
}), { recording_id: p, offset_ms: w };
|
|
259
266
|
};
|
|
260
|
-
},
|
|
267
|
+
}, k = async (r) => {
|
|
261
268
|
if (r === "error") {
|
|
262
|
-
if (e.lastClip && Date.now() - e.lastClip.at <
|
|
269
|
+
if (e.lastClip && Date.now() - e.lastClip.at < Ye)
|
|
263
270
|
return e.lastClip.link;
|
|
264
271
|
e.lastClip = { at: Date.now(), link: null };
|
|
265
272
|
}
|
|
266
|
-
const i =
|
|
273
|
+
const i = y == null ? void 0 : y(r);
|
|
267
274
|
if (!i) return null;
|
|
268
275
|
const h = await i();
|
|
269
276
|
return r === "error" && (e.lastClip = { at: Date.now(), link: h }), h;
|
|
270
277
|
});
|
|
271
278
|
}
|
|
272
|
-
let
|
|
279
|
+
let U = !1, T = B(null), q = x(null);
|
|
273
280
|
async function ae() {
|
|
274
281
|
try {
|
|
275
282
|
const t = await a.request(ce());
|
|
276
283
|
if (c) return;
|
|
277
|
-
|
|
284
|
+
T = B(t.data.masking), q = x(t.data.sampling);
|
|
278
285
|
const r = t.data.cap_reached === !0;
|
|
279
|
-
|
|
286
|
+
U = t.data.enabled === !0 && !r;
|
|
280
287
|
const i = t.data.enabled !== !0 && t.data.error_replay === !0 && !r;
|
|
281
|
-
|
|
288
|
+
U ? await ie() : i && await se();
|
|
282
289
|
} catch {
|
|
283
290
|
}
|
|
284
291
|
}
|
|
285
292
|
ae();
|
|
286
|
-
const ue = setInterval(
|
|
293
|
+
const ue = setInterval(O, j), W = () => {
|
|
287
294
|
document.visibilityState === "hidden" && m(!0, !0);
|
|
288
295
|
};
|
|
289
|
-
document.addEventListener("visibilitychange",
|
|
296
|
+
document.addEventListener("visibilitychange", W);
|
|
290
297
|
const H = () => {
|
|
291
|
-
if (!(e.dead || !o.recordingId) && (
|
|
298
|
+
if (!(e.dead || !o.recordingId) && (M(!0), I(), !(!G() || !E)))
|
|
292
299
|
for (const { chunk: t, body: r } of o.keepaliveBatch())
|
|
293
300
|
try {
|
|
294
301
|
E(t.recordingId, r).catch(() => {
|
|
@@ -298,23 +305,23 @@ function nt(n = {}) {
|
|
|
298
305
|
};
|
|
299
306
|
window.addEventListener("pagehide", H);
|
|
300
307
|
const K = () => {
|
|
301
|
-
|
|
308
|
+
_(), m(!0);
|
|
302
309
|
};
|
|
303
310
|
return window.addEventListener("online", K), () => {
|
|
304
311
|
var t, r;
|
|
305
|
-
c = !0,
|
|
312
|
+
c = !0, k = null, y = null, N(null), document.removeEventListener("visibilitychange", W), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), _(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], m(!0).then(() => {
|
|
306
313
|
const i = o.recordingId;
|
|
307
314
|
i && (e.dead || g.request($(i)).catch(() => {
|
|
308
|
-
}), o.discard(), o.recordingId = null, P(v,
|
|
315
|
+
}), o.discard(), o.recordingId = null, P(v, b));
|
|
309
316
|
});
|
|
310
317
|
};
|
|
311
318
|
}, [a, d, u, l]);
|
|
312
319
|
}
|
|
313
|
-
|
|
314
|
-
(n) =>
|
|
315
|
-
(n) => (
|
|
320
|
+
qe(
|
|
321
|
+
(n) => je(n),
|
|
322
|
+
(n) => (y == null ? void 0 : y(n)) ?? null
|
|
316
323
|
);
|
|
317
324
|
export {
|
|
318
|
-
|
|
319
|
-
|
|
325
|
+
je as captureErrorClip,
|
|
326
|
+
st as useSessionRecorder
|
|
320
327
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -4924,6 +4924,9 @@ export declare interface ItemEditFormProps {
|
|
|
4924
4924
|
/** false = skip the document.title side effect — a workspace-tab host keeps
|
|
4925
4925
|
* several forms mounted and only the ACTIVE one may own the browser tab. */
|
|
4926
4926
|
documentTitle?: boolean;
|
|
4927
|
+
/** false = mounted but not on screen (a background workspace tab): the form
|
|
4928
|
+
* lets its edit lock go after a while and takes it back when shown. */
|
|
4929
|
+
active?: boolean;
|
|
4927
4930
|
/** Hands the host a stable save trigger (workspace "Save all"); called with
|
|
4928
4931
|
* null on unmount. The trigger runs the same handleSave the button does —
|
|
4929
4932
|
* validation and dialogs included. */
|
|
@@ -5563,6 +5566,9 @@ declare interface LockHolder {
|
|
|
5563
5566
|
note?: string | null;
|
|
5564
5567
|
/** Minutes since the holder last did anything (presence), when known. */
|
|
5565
5568
|
idle_minutes?: number | null;
|
|
5569
|
+
/** Whether THIS viewer may force-take the lock (server verdict; absent =
|
|
5570
|
+
* unknown, the button shows and the server's 403 explains). */
|
|
5571
|
+
may_take_over?: boolean;
|
|
5566
5572
|
}
|
|
5567
5573
|
|
|
5568
5574
|
declare interface LockQueueEntry {
|
|
@@ -7255,6 +7261,8 @@ declare interface QuerySheetDef {
|
|
|
7255
7261
|
stats: QueryWidgetStat[];
|
|
7256
7262
|
/** "As of" line under the tiles: label + the latest value of field. */
|
|
7257
7263
|
as_of?: SheetHeaderAsOf;
|
|
7264
|
+
/** What the tiles cover, under them ("Project lifetime"); `{{param}}` tokens. */
|
|
7265
|
+
note?: string;
|
|
7258
7266
|
};
|
|
7259
7267
|
/** Zero-based tab to open first (clamped into range). */
|
|
7260
7268
|
initial_tab?: number;
|
|
@@ -7263,6 +7271,8 @@ declare interface QuerySheetDef {
|
|
|
7263
7271
|
* fields render as fixed context, not pickers. */
|
|
7264
7272
|
tabs?: Array<{
|
|
7265
7273
|
label: string;
|
|
7274
|
+
/** What the tab's view covers, above it ("Spend dated in {{funding_years}}"). */
|
|
7275
|
+
note?: string;
|
|
7266
7276
|
config?: QueryWidgetConfig;
|
|
7267
7277
|
matrix?: {
|
|
7268
7278
|
config: MatrixEditorConfig;
|
|
@@ -7486,8 +7496,13 @@ declare type QueryWidgetFilter = {
|
|
|
7486
7496
|
/** Query-string key that pre-selects this filter when the page URL carries
|
|
7487
7497
|
* it (`?fy=2026`, a comma list for several values, compared on
|
|
7488
7498
|
* value_field). Beats default_values and the user-scope seeding; when the
|
|
7489
|
-
* URL lacks it, those apply as before.
|
|
7499
|
+
* URL lacks it, those apply as before. A change made on the page is
|
|
7500
|
+
* written back to the address (an emptied filter as `?fy=`, "All"), so a
|
|
7501
|
+
* reload or a shared link keeps it. */
|
|
7490
7502
|
url_param?: string;
|
|
7503
|
+
/** One value at a time: picking another replaces it (a per-year query that
|
|
7504
|
+
* would silently sum two years). */
|
|
7505
|
+
single?: boolean;
|
|
7491
7506
|
};
|
|
7492
7507
|
|
|
7493
7508
|
declare interface QueryWidgetStat {
|
|
@@ -7535,6 +7550,12 @@ declare interface QueryWidgetStat {
|
|
|
7535
7550
|
* the table the number covers; when NO row does, the tile shows its
|
|
7536
7551
|
* empty_label instead of a summed zero. */
|
|
7537
7552
|
coverage?: string;
|
|
7553
|
+
/** A context tile that only means something when the main rows carry this
|
|
7554
|
+
* field — e.g. "Fusion figures as of" over rows whose fusion_synced_at is
|
|
7555
|
+
* null: when no row has a value, the tile shows `requires_label` instead
|
|
7556
|
+
* of its own value (an import date over all-empty Fusion columns misleads). */
|
|
7557
|
+
requires_field?: string;
|
|
7558
|
+
requires_label?: string;
|
|
7538
7559
|
}
|
|
7539
7560
|
|
|
7540
7561
|
/** The full query-widget surface (filters, stats, table, row actions, drill
|
|
@@ -8565,7 +8586,8 @@ declare interface ReviewListConfig {
|
|
|
8565
8586
|
empty_color?: string | null;
|
|
8566
8587
|
stamp_user_field?: string | null;
|
|
8567
8588
|
stamp_date_field?: string | null;
|
|
8568
|
-
/** POST this endpoint with {ids, status, note, workflow_id}
|
|
8589
|
+
/** POST this endpoint with {ids, status, note, workflow_id, expected}
|
|
8590
|
+
* (`expected` = each row's status as the list showed it) instead of
|
|
8569
8591
|
* per-row PATCHes — lets a deployment route decisions through an
|
|
8570
8592
|
* endpoint that owns stamping, authorization, notes and notifications
|
|
8571
8593
|
* (e.g. an extension's /decide route). */
|
|
@@ -10321,7 +10343,15 @@ export declare function useIsRecordingSelf(userId: string | number | null | unde
|
|
|
10321
10343
|
|
|
10322
10344
|
export declare function useItemEditAuth(): ItemEditAuthContextValue;
|
|
10323
10345
|
|
|
10324
|
-
export declare function useItemLock(collection: string | undefined, item: string | undefined, enabled: boolean
|
|
10346
|
+
export declare function useItemLock(collection: string | undefined, item: string | undefined, enabled: boolean, opts?: {
|
|
10347
|
+
/** Take the lock on the first real edit (`claim`), not on open — opening
|
|
10348
|
+
* a record only learns whether someone else holds it. A reader who never
|
|
10349
|
+
* edits (an approver re-opening what they sent back) never blocks the
|
|
10350
|
+
* person who has to fix it. */
|
|
10351
|
+
lazy?: boolean;
|
|
10352
|
+
/** False = mounted but not on screen (a background workspace tab). */
|
|
10353
|
+
active?: boolean;
|
|
10354
|
+
}): {
|
|
10325
10355
|
lockHolder: LockHolder | null;
|
|
10326
10356
|
acquired: boolean;
|
|
10327
10357
|
isReadOnly: boolean;
|
|
@@ -10341,6 +10371,7 @@ export declare function useItemLock(collection: string | undefined, item: string
|
|
|
10341
10371
|
releasing: boolean;
|
|
10342
10372
|
released: boolean;
|
|
10343
10373
|
relock: () => Promise<boolean>;
|
|
10374
|
+
claim: () => Promise<void>;
|
|
10344
10375
|
};
|
|
10345
10376
|
|
|
10346
10377
|
/** Resolved item-link helpers honoring the host's itemUrl/openItem overrides. */
|