@nivaro/react 0.3.116 → 0.3.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,107 +1,111 @@
|
|
|
1
|
-
import { useQueryClient as
|
|
2
|
-
import { useMemo as L, useState as
|
|
3
|
-
import { parseRollupSources as
|
|
1
|
+
import { useQueryClient as z } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo as L, useState as b, useRef as g, useEffect as T } from "react";
|
|
3
|
+
import { parseRollupSources as I } from "../components/item-edit/live-rollups.js";
|
|
4
4
|
import { useLiveRecordEvent as D } from "./live.js";
|
|
5
5
|
import { onWriteCommand as K } from "./own-writes.js";
|
|
6
|
-
const P = 15e3,
|
|
7
|
-
function
|
|
6
|
+
const P = 15e3, $ = 350, N = 1400;
|
|
7
|
+
function Q(l) {
|
|
8
8
|
const u = /* @__PURE__ */ new Map(), f = l ?? [];
|
|
9
|
-
for (const
|
|
10
|
-
if (!(
|
|
11
|
-
for (const
|
|
12
|
-
const c = u.get(
|
|
13
|
-
c.add(
|
|
9
|
+
for (const n of f)
|
|
10
|
+
if (!(n.computed_type !== "rollup" || !n.computed_formula))
|
|
11
|
+
for (const r of I(n.computed_formula)) {
|
|
12
|
+
const c = u.get(r.related_collection) ?? /* @__PURE__ */ new Set();
|
|
13
|
+
c.add(n.field), u.set(r.related_collection, c);
|
|
14
|
+
}
|
|
15
|
+
const d = (n, r) => n.includes(`{{${r}}}`) || new RegExp(`\\bitem\\.${r}\\b`).test(n);
|
|
16
|
+
for (const n of u.values())
|
|
17
|
+
for (let r = !0; r; ) {
|
|
18
|
+
r = !1;
|
|
19
|
+
for (const c of f) {
|
|
20
|
+
if (c.computed_type === "rollup" || n.has(c.field) || !c.computed_formula) continue;
|
|
21
|
+
const m = typeof c.computed_formula == "string" ? c.computed_formula : JSON.stringify(c.computed_formula);
|
|
22
|
+
[...n].some((h) => d(m, h)) && (n.add(c.field), r = !0);
|
|
14
23
|
}
|
|
15
|
-
for (const o of u.values())
|
|
16
|
-
for (const n of f) {
|
|
17
|
-
if (n.computed_type === "rollup" || o.has(n.field) || !n.computed_formula) continue;
|
|
18
|
-
const c = typeof n.computed_formula == "string" ? n.computed_formula : JSON.stringify(n.computed_formula);
|
|
19
|
-
[...o].some((m) => c.includes(`{{${m}}}`)) && o.add(n.field);
|
|
20
24
|
}
|
|
21
25
|
return u;
|
|
22
26
|
}
|
|
23
|
-
function
|
|
27
|
+
function U(l) {
|
|
24
28
|
const [u, f] = l.split("?");
|
|
25
29
|
if (!f) return null;
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
28
|
-
const n = new URLSearchParams(f),
|
|
29
|
-
return !
|
|
30
|
+
const d = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/[^/?#]+)?$/.exec(u);
|
|
31
|
+
if (!d) return null;
|
|
32
|
+
const n = new URLSearchParams(f), r = n.get("parent_collection"), c = n.get("parent_id");
|
|
33
|
+
return !r || !c ? null : { collection: d[1], parentCollection: r, parentId: c };
|
|
30
34
|
}
|
|
31
35
|
const a = /* @__PURE__ */ new Set();
|
|
32
36
|
function Y(l) {
|
|
33
|
-
const { collection: u, fields: f, dataUpdatedAt:
|
|
37
|
+
const { collection: u, fields: f, dataUpdatedAt: d, enabled: n = !0 } = l, r = l.itemId == null || l.itemId === "new" ? null : String(l.itemId), c = z(), m = L(() => Q(f), [f]), h = L(() => {
|
|
34
38
|
const e = /* @__PURE__ */ new Set();
|
|
35
|
-
for (const t of
|
|
39
|
+
for (const t of m.values()) for (const s of t) e.add(s);
|
|
36
40
|
return e;
|
|
37
|
-
}, [
|
|
41
|
+
}, [m]), [q, w] = b(a), [k, y] = b(a), p = g({
|
|
38
42
|
inflight: 0,
|
|
39
43
|
serverOpen: !1,
|
|
40
44
|
/** When the burst's last write / the server's `done` ended: a re-read after it settles. */
|
|
41
45
|
endedAt: 0,
|
|
42
46
|
fields: /* @__PURE__ */ new Set()
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const t =
|
|
47
|
-
t.fields.clear(), t.inflight = 0, t.serverOpen = !1, t.endedAt = 0,
|
|
48
|
-
}, R =
|
|
49
|
-
R.current =
|
|
47
|
+
}), x = g(l.queryKey);
|
|
48
|
+
x.current = l.queryKey;
|
|
49
|
+
const o = g({}), _ = n && !!r && h.size > 0, C = (e) => {
|
|
50
|
+
const t = p.current, s = new Set(t.fields);
|
|
51
|
+
t.fields.clear(), t.inflight = 0, t.serverOpen = !1, t.endedAt = 0, o.current.max && clearTimeout(o.current.max), o.current.reread && clearTimeout(o.current.reread), w(a), e && s.size > 0 && (y(s), o.current.landed && clearTimeout(o.current.landed), o.current.landed = setTimeout(() => y(a), N));
|
|
52
|
+
}, R = g(C);
|
|
53
|
+
R.current = C;
|
|
50
54
|
const O = (e) => {
|
|
51
|
-
const t =
|
|
55
|
+
const t = p.current;
|
|
52
56
|
let s = !1;
|
|
53
57
|
for (const i of e)
|
|
54
|
-
|
|
55
|
-
t.endedAt = 0,
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
+
h.has(i) && !t.fields.has(i) && (t.fields.add(i), s = !0);
|
|
59
|
+
t.endedAt = 0, o.current.reread && clearTimeout(o.current.reread), s && w(new Set(t.fields)), o.current.max && clearTimeout(o.current.max), o.current.max = setTimeout(() => R.current(!1), P);
|
|
60
|
+
}, S = g(O);
|
|
61
|
+
S.current = O;
|
|
58
62
|
const M = () => {
|
|
59
|
-
const e =
|
|
60
|
-
e.fields.size === 0 || e.inflight > 0 || e.serverOpen || (e.endedAt = Date.now(),
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
return
|
|
63
|
+
const e = p.current;
|
|
64
|
+
e.fields.size === 0 || e.inflight > 0 || e.serverOpen || (e.endedAt = Date.now(), o.current.reread && clearTimeout(o.current.reread), o.current.reread = setTimeout(() => {
|
|
65
|
+
c.invalidateQueries({ queryKey: x.current });
|
|
66
|
+
}, $));
|
|
67
|
+
}, v = g(M);
|
|
68
|
+
return v.current = M, T(() => {
|
|
65
69
|
if (_)
|
|
66
70
|
return K((e) => {
|
|
67
|
-
const t =
|
|
68
|
-
if (!t || t.parentCollection !== u || t.parentId !==
|
|
69
|
-
const s =
|
|
71
|
+
const t = U(e.path);
|
|
72
|
+
if (!t || t.parentCollection !== u || t.parentId !== r) return;
|
|
73
|
+
const s = m.get(t.collection);
|
|
70
74
|
if (!s) return;
|
|
71
|
-
const i =
|
|
72
|
-
e.phase === "start" ? (i.inflight++,
|
|
75
|
+
const i = p.current;
|
|
76
|
+
e.phase === "start" ? (i.inflight++, S.current(s)) : (i.inflight = Math.max(0, i.inflight - 1), v.current());
|
|
73
77
|
});
|
|
74
|
-
}, [_, u,
|
|
78
|
+
}, [_, u, r, m]), D(
|
|
75
79
|
"record:recalc",
|
|
76
80
|
u,
|
|
77
|
-
|
|
81
|
+
r,
|
|
78
82
|
(e) => {
|
|
79
|
-
const t = Array.isArray(e == null ? void 0 : e.fields) ? e.fields.map(String) : [], s =
|
|
83
|
+
const t = Array.isArray(e == null ? void 0 : e.fields) ? e.fields.map(String) : [], s = p.current;
|
|
80
84
|
if ((e == null ? void 0 : e.phase) === "start") {
|
|
81
|
-
const i = t.filter((
|
|
82
|
-
for (const
|
|
83
|
-
if (i.some((E) =>
|
|
85
|
+
const i = t.filter((A) => h.has(A));
|
|
86
|
+
for (const A of m.values())
|
|
87
|
+
if (i.some((E) => A.has(E))) for (const E of A) i.push(E);
|
|
84
88
|
if (i.length === 0) return;
|
|
85
|
-
s.serverOpen = !0,
|
|
86
|
-
} else (e == null ? void 0 : e.phase) === "done" && (s.serverOpen = !1,
|
|
89
|
+
s.serverOpen = !0, S.current(i);
|
|
90
|
+
} else (e == null ? void 0 : e.phase) === "done" && (s.serverOpen = !1, v.current());
|
|
87
91
|
},
|
|
88
92
|
{ includeOwn: !0, enabled: _ }
|
|
89
93
|
), T(() => {
|
|
90
|
-
const e =
|
|
91
|
-
e.endedAt > 0 &&
|
|
92
|
-
}, [
|
|
93
|
-
const e =
|
|
94
|
+
const e = p.current;
|
|
95
|
+
e.endedAt > 0 && d >= e.endedAt && R.current(!0);
|
|
96
|
+
}, [d]), T(() => {
|
|
97
|
+
const e = o.current;
|
|
94
98
|
return () => {
|
|
95
99
|
for (const t of ["reread", "max", "landed"]) e[t] && clearTimeout(e[t]);
|
|
96
|
-
|
|
100
|
+
p.current = { inflight: 0, serverOpen: !1, endedAt: 0, fields: /* @__PURE__ */ new Set() }, w(a), y(a);
|
|
97
101
|
};
|
|
98
|
-
}, [u,
|
|
102
|
+
}, [u, r]), { pending: _ ? q : a, landed: _ ? k : a };
|
|
99
103
|
}
|
|
100
104
|
export {
|
|
101
|
-
|
|
105
|
+
N as RECALC_LANDED_MS,
|
|
102
106
|
P as RECALC_MAX_MS,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
$ as RECALC_REREAD_MS,
|
|
108
|
+
U as childWriteOf,
|
|
109
|
+
Q as recalcFeeds,
|
|
106
110
|
Y as useRollupRecalc
|
|
107
111
|
};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { useRef as C, useEffect as T, useSyncExternalStore as
|
|
2
|
-
import { getLiveMode as
|
|
3
|
-
import { forgetSettledReads as
|
|
4
|
-
const
|
|
1
|
+
import { useRef as C, useEffect as T, useSyncExternalStore as P } from "react";
|
|
2
|
+
import { getLiveMode as M } from "./live-preference.js";
|
|
3
|
+
import { forgetSettledReads as y } from "./request-gate.js";
|
|
4
|
+
const D = 1600, L = 6e4, A = 1e3, b = 2e4;
|
|
5
5
|
let p = null;
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
const
|
|
6
|
+
const m = /* @__PURE__ */ new Map();
|
|
7
|
+
let B = 1, f = null, g = 0, S = null, E = { phase: "idle", at: 0, reason: null };
|
|
8
|
+
const w = /* @__PURE__ */ new Set();
|
|
9
9
|
let i = null;
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
for (const t of [...
|
|
10
|
+
function R(e) {
|
|
11
|
+
E = e;
|
|
12
|
+
for (const t of [...w]) t();
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function G(e) {
|
|
15
15
|
p = e;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function U() {
|
|
18
18
|
return p;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const t =
|
|
22
|
-
return
|
|
23
|
-
|
|
20
|
+
function N(e) {
|
|
21
|
+
const t = B++;
|
|
22
|
+
return m.set(t, e), () => {
|
|
23
|
+
m.delete(t);
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function k(e, t = !0) {
|
|
27
27
|
const n = C(e);
|
|
28
28
|
n.current = e, T(() => {
|
|
29
29
|
if (t)
|
|
30
|
-
return
|
|
30
|
+
return N(() => n.current());
|
|
31
31
|
}, [t]);
|
|
32
32
|
}
|
|
33
33
|
function v(e) {
|
|
@@ -36,21 +36,21 @@ function v(e) {
|
|
|
36
36
|
}
|
|
37
37
|
function O(e, t) {
|
|
38
38
|
return new Promise((n, s) => {
|
|
39
|
-
const
|
|
39
|
+
const a = setTimeout(() => s(new Error("timeout")), t);
|
|
40
40
|
Promise.resolve(e).then(
|
|
41
41
|
(o) => {
|
|
42
|
-
clearTimeout(
|
|
42
|
+
clearTimeout(a), n(o);
|
|
43
43
|
},
|
|
44
44
|
(o) => {
|
|
45
|
-
clearTimeout(
|
|
45
|
+
clearTimeout(a), s(o);
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
async function q(e, t) {
|
|
51
51
|
const n = Date.now();
|
|
52
|
-
|
|
53
|
-
let s = 0,
|
|
52
|
+
y();
|
|
53
|
+
let s = 0, a = 0;
|
|
54
54
|
const o = [];
|
|
55
55
|
if (e) {
|
|
56
56
|
for (const r of e.getQueryCache().getAll())
|
|
@@ -64,10 +64,10 @@ async function q(e, t) {
|
|
|
64
64
|
}), await e.refetchQueries(
|
|
65
65
|
{ predicate: (r) => l.has(r) },
|
|
66
66
|
{ cancelRefetch: !1, throwOnError: !1 }
|
|
67
|
-
),
|
|
67
|
+
), a += o.filter((r) => r.state.status === "error").length;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
70
|
-
|
|
69
|
+
const u = [...m.values()], c = await Promise.allSettled(
|
|
70
|
+
u.map((l) => {
|
|
71
71
|
try {
|
|
72
72
|
return O(l(), b);
|
|
73
73
|
} catch (r) {
|
|
@@ -75,50 +75,55 @@ async function q(e, t) {
|
|
|
75
75
|
}
|
|
76
76
|
})
|
|
77
77
|
);
|
|
78
|
-
if (
|
|
78
|
+
if (a += c.filter((l) => l.status === "rejected").length, typeof window < "u")
|
|
79
79
|
try {
|
|
80
80
|
window.dispatchEvent(new CustomEvent("nvr:screen-refresh", { detail: { reason: t } }));
|
|
81
81
|
} catch {
|
|
82
82
|
}
|
|
83
|
-
return { queries: s, loaders:
|
|
83
|
+
return { queries: s, loaders: u.length, failed: a, ms: Date.now() - n };
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function z(e = {}) {
|
|
86
86
|
const t = e.reason ?? "button";
|
|
87
|
-
if (f) return f.then((
|
|
87
|
+
if (f) return f.then((u) => ({ ...u, coalesced: !0 }));
|
|
88
88
|
const n = e.now ?? Date.now, s = t === "button" || t === "palette" || t === "shortcut";
|
|
89
|
-
if (!s &&
|
|
89
|
+
if (!s && M() === "off")
|
|
90
90
|
return Promise.resolve({ queries: 0, loaders: 0, failed: 0, ms: 0, coalesced: !0 });
|
|
91
|
-
if (!s &&
|
|
92
|
-
return Promise.resolve({ ...
|
|
93
|
-
const
|
|
94
|
-
i && clearTimeout(i),
|
|
95
|
-
const o = q(
|
|
91
|
+
if (!s && S && n() - g < A)
|
|
92
|
+
return Promise.resolve({ ...S, coalesced: !0 });
|
|
93
|
+
const a = e.qc === void 0 ? p : e.qc;
|
|
94
|
+
i && clearTimeout(i), R({ phase: "running", at: n(), reason: t });
|
|
95
|
+
const o = q(a, t).catch(() => ({ queries: 0, loaders: 0, failed: 1, ms: 0 })).then((u) => {
|
|
96
96
|
var c;
|
|
97
|
-
return f = null,
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
return f = null, g = n(), S = u, R(
|
|
98
|
+
u.failed > 0 ? { phase: "partial", at: n(), reason: t, failed: u.failed } : { phase: "done", at: n(), reason: t }
|
|
99
|
+
), i = setTimeout(
|
|
100
|
+
() => {
|
|
101
|
+
i = null, E.phase !== "running" && R({ phase: "idle", at: Date.now(), reason: t });
|
|
102
|
+
},
|
|
103
|
+
u.failed > 0 ? L : D
|
|
104
|
+
), (c = i.unref) == null || c.call(i), u;
|
|
100
105
|
});
|
|
101
106
|
return f = o, o;
|
|
102
107
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
108
|
+
function _() {
|
|
109
|
+
return E;
|
|
105
110
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
108
|
-
|
|
111
|
+
function x(e) {
|
|
112
|
+
return w.add(e), () => {
|
|
113
|
+
w.delete(e);
|
|
109
114
|
};
|
|
110
115
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
116
|
+
function J() {
|
|
117
|
+
return P(x, _, _);
|
|
113
118
|
}
|
|
114
|
-
const
|
|
115
|
-
function
|
|
119
|
+
const F = ["refresh", "reload", "update", "data", "fresh", "stale"];
|
|
120
|
+
function K(e) {
|
|
116
121
|
const t = e.trim().toLowerCase();
|
|
117
|
-
return t.length < 2 ? !1 : t.split(/\s+/).every((s) =>
|
|
122
|
+
return t.length < 2 ? !1 : t.split(/\s+/).every((s) => F.some((a) => a.startsWith(s)) || "this page".includes(s));
|
|
118
123
|
}
|
|
119
124
|
let d = 0;
|
|
120
125
|
const h = /* @__PURE__ */ new Set();
|
|
121
|
-
function
|
|
126
|
+
function V() {
|
|
122
127
|
d++;
|
|
123
128
|
for (const t of [...h]) t();
|
|
124
129
|
let e = !1;
|
|
@@ -129,32 +134,33 @@ function K() {
|
|
|
129
134
|
}
|
|
130
135
|
};
|
|
131
136
|
}
|
|
132
|
-
function
|
|
137
|
+
function I() {
|
|
133
138
|
return d > 0;
|
|
134
139
|
}
|
|
135
|
-
function
|
|
140
|
+
function H(e) {
|
|
136
141
|
return h.add(e), () => {
|
|
137
142
|
h.delete(e);
|
|
138
143
|
};
|
|
139
144
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
145
|
+
function X() {
|
|
146
|
+
return P(H, I, () => !1);
|
|
142
147
|
}
|
|
143
148
|
export {
|
|
144
149
|
b as SCREEN_LOADER_TIMEOUT_MS,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
D as SCREEN_REFRESH_DONE_MS,
|
|
151
|
+
A as SCREEN_REFRESH_MIN_GAP_MS,
|
|
152
|
+
L as SCREEN_REFRESH_PARTIAL_MS,
|
|
153
|
+
I as pageRefreshButtonShown,
|
|
154
|
+
z as refreshScreenData,
|
|
155
|
+
V as registerPageRefreshButton,
|
|
156
|
+
N as registerScreenLoader,
|
|
151
157
|
v as screenRefreshAllowed,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
U as screenRefreshClient,
|
|
159
|
+
K as screenRefreshMatches,
|
|
160
|
+
_ as screenRefreshState,
|
|
161
|
+
G as setScreenRefreshClient,
|
|
162
|
+
x as subscribeScreenRefresh,
|
|
163
|
+
X as usePageRefreshButtonShown,
|
|
164
|
+
k as useScreenLoader,
|
|
165
|
+
J as useScreenRefreshState
|
|
160
166
|
};
|