@nivaro/react 0.3.40 → 0.3.42
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/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,51 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, Fragment as g, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { PauseCircle as T, RotateCw as C } from "lucide-react";
|
|
3
|
-
import { useState as p, useRef as b, useEffect as
|
|
4
|
-
import { markReloadFor as
|
|
5
|
-
import { shouldObeyForceReload as D, thisTabForReload as
|
|
6
|
-
import { subscribeUnsavedWork as
|
|
3
|
+
import { useState as p, useRef as b, useEffect as k } from "react";
|
|
4
|
+
import { markReloadFor as E } from "../lib/client-version.js";
|
|
5
|
+
import { shouldObeyForceReload as D, thisTabForReload as I } from "../lib/force-reload.js";
|
|
6
|
+
import { subscribeUnsavedWork as M, prepareForReload as y, beginReloadForUpdate as L, unsavedWorkLabels as O } from "../lib/unsaved-work.js";
|
|
7
|
+
import { IdleReloadWatcher as S } from "./IdleReloadWatcher.js";
|
|
7
8
|
const F = "nvr:force-refresh";
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function V({ idleReload: r = !0 } = {}) {
|
|
10
|
+
return /* @__PURE__ */ l(g, { children: [
|
|
11
|
+
r && /* @__PURE__ */ n(S, {}),
|
|
12
|
+
/* @__PURE__ */ n(U, {})
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
function U() {
|
|
16
|
+
const [r, N] = p(null), [j, w] = p(() => Date.now()), [v, c] = p([]), a = b(!1), m = b(!1), x = b(/* @__PURE__ */ new Set());
|
|
17
|
+
k(() => {
|
|
18
|
+
const s = (i) => {
|
|
19
|
+
const e = i.detail ?? {}, t = typeof e.id == "string" && e.id ? e.id : null;
|
|
20
|
+
if (t && x.current.has(t) || !D(e, I())) return;
|
|
21
|
+
t && x.current.add(t), m.current = !1, c([]);
|
|
22
|
+
const h = Math.max(5, Number(e.seconds) || 30), d = Date.now();
|
|
23
|
+
N({ deadline: d + h * 1e3, message: String(e.message ?? ""), id: t }), w(d);
|
|
17
24
|
};
|
|
18
|
-
return window.addEventListener(F,
|
|
19
|
-
}, []),
|
|
25
|
+
return window.addEventListener(F, s), () => window.removeEventListener(F, s);
|
|
26
|
+
}, []), k(() => {
|
|
20
27
|
if (!r) return;
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
const s = () => {
|
|
29
|
+
a.current || (a.current = !0, r.id && E(r.id), window.location.reload(), setTimeout(() => {
|
|
30
|
+
a.current = !1, m.current = !0, c(["unsaved changes on this page"]);
|
|
24
31
|
}, 1500));
|
|
25
32
|
};
|
|
26
|
-
let
|
|
33
|
+
let i = !1;
|
|
27
34
|
const e = () => {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
|
|
35
|
+
const d = Date.now();
|
|
36
|
+
if (w(d), !(d < r.deadline || a.current || m.current || i)) {
|
|
37
|
+
if (O().length === 0) {
|
|
38
|
+
c((o) => o.length ? [] : o), s();
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
i = !0, y().then((o) => {
|
|
42
|
+
c((R) => R.join("|") === o.join("|") ? R : o), o.length === 0 && (L(), s());
|
|
36
43
|
}).finally(() => {
|
|
37
|
-
|
|
44
|
+
i = !1;
|
|
38
45
|
});
|
|
39
46
|
}
|
|
40
47
|
}, t = setInterval(e, 1e3);
|
|
41
48
|
document.addEventListener("visibilitychange", e), window.addEventListener("focus", e), window.addEventListener("pageshow", e);
|
|
42
|
-
const h =
|
|
49
|
+
const h = M(() => setTimeout(e, 0));
|
|
43
50
|
return () => {
|
|
44
51
|
clearInterval(t), document.removeEventListener("visibilitychange", e), window.removeEventListener("focus", e), window.removeEventListener("pageshow", e), h();
|
|
45
52
|
};
|
|
46
53
|
}, [r]);
|
|
47
|
-
const u = r ? Math.max(0, Math.ceil((r.deadline - j) / 1e3)) : 0, f = u === 0 &&
|
|
48
|
-
return r ? /* @__PURE__ */
|
|
54
|
+
const u = r ? Math.max(0, Math.ceil((r.deadline - j) / 1e3)) : 0, f = u === 0 && v.length > 0;
|
|
55
|
+
return r ? /* @__PURE__ */ l(
|
|
49
56
|
"div",
|
|
50
57
|
{
|
|
51
58
|
role: "alert",
|
|
@@ -54,27 +61,27 @@ function B() {
|
|
|
54
61
|
"data-nvr-recording-hide": !0,
|
|
55
62
|
className: "fixed inset-x-0 top-0 z-[150] flex items-center justify-center gap-3 border-b border-amber-300 bg-amber-50 px-4 py-2.5 text-[13px] text-amber-900 dark:border-amber-500/40 dark:bg-[#3a2e10] dark:text-amber-200",
|
|
56
63
|
children: [
|
|
57
|
-
f ? /* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
64
|
+
f ? /* @__PURE__ */ n(T, { className: "h-4 w-4 shrink-0" }) : /* @__PURE__ */ n(C, { className: "h-4 w-4 shrink-0 animate-spin" }),
|
|
65
|
+
/* @__PURE__ */ n("span", { children: f ? /* @__PURE__ */ l(g, { children: [
|
|
66
|
+
/* @__PURE__ */ n("span", { className: "font-semibold", children: "A reload is waiting" }),
|
|
60
67
|
" — save or discard your changes (",
|
|
61
|
-
|
|
68
|
+
v.join(", ").toLowerCase(),
|
|
62
69
|
") and the page reloads."
|
|
63
|
-
] }) : /* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
70
|
+
] }) : /* @__PURE__ */ l(g, { children: [
|
|
71
|
+
/* @__PURE__ */ l("span", { className: "font-semibold", children: [
|
|
65
72
|
"This page will reload in ",
|
|
66
73
|
u,
|
|
67
74
|
"s"
|
|
68
75
|
] }),
|
|
69
76
|
r.message ? ` — ${r.message}` : " — an administrator pushed an update."
|
|
70
77
|
] }) }),
|
|
71
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ n(
|
|
72
79
|
"button",
|
|
73
80
|
{
|
|
74
81
|
type: "button",
|
|
75
82
|
onClick: async () => {
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
a.current = !0, r.id && E(r.id), (await y()).length === 0 && L(), window.location.reload(), setTimeout(() => {
|
|
84
|
+
a.current = !1;
|
|
78
85
|
}, 1500);
|
|
79
86
|
},
|
|
80
87
|
className: "shrink-0 rounded-md border border-amber-400 bg-white px-2.5 py-1 text-[12px] font-medium text-amber-800 hover:bg-amber-100 dark:bg-transparent dark:text-amber-200",
|
|
@@ -87,5 +94,5 @@ function B() {
|
|
|
87
94
|
}
|
|
88
95
|
export {
|
|
89
96
|
F as FORCE_RELOAD_EVENT,
|
|
90
|
-
|
|
97
|
+
V as ForceReloadBanner
|
|
91
98
|
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { useEffect as f } from "react";
|
|
2
|
+
import { useOptionalNivaroClient as w } from "../context.js";
|
|
3
|
+
import { markReloadFor as b, reloadCountFor as h, clientVersion as g } from "../lib/client-version.js";
|
|
4
|
+
import { get as I } from "../lib/commands.js";
|
|
5
|
+
import { trackIdleReloadInput as k, restoreScrollAfterReload as R, decideIdleReload as L, saveScrollForReload as y, lastIdleReloadInput as E } from "../lib/idle-reload.js";
|
|
6
|
+
import { reloadHoldLabels as S } from "../lib/reload-holds.js";
|
|
7
|
+
import { subscribeUnsavedWork as _, unsavedWorkLabels as F } from "../lib/unsaved-work.js";
|
|
8
|
+
const C = 1e4;
|
|
9
|
+
function x() {
|
|
10
|
+
const r = w();
|
|
11
|
+
return f(() => (k(), R()), []), f(() => {
|
|
12
|
+
if (typeof window > "u") return;
|
|
13
|
+
let a = null, s = 0, n = !1, d = !1, i = !1, u = !0;
|
|
14
|
+
const m = async () => {
|
|
15
|
+
const e = g(), o = { tab: e.tab, loaded: String(e.loaded) };
|
|
16
|
+
e.build && (o.build = e.build), e.api && (o.api = e.api);
|
|
17
|
+
let l = null;
|
|
18
|
+
try {
|
|
19
|
+
if (r)
|
|
20
|
+
l = (await r.request(I("/realtime/build-status", o))).data;
|
|
21
|
+
else {
|
|
22
|
+
const c = await fetch(`/api/realtime/build-status?${new URLSearchParams(o)}`, {
|
|
23
|
+
credentials: "same-origin",
|
|
24
|
+
headers: { accept: "application/json" }
|
|
25
|
+
});
|
|
26
|
+
c.ok && (l = (await c.json()).data);
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
l = null;
|
|
30
|
+
}
|
|
31
|
+
a = l ?? {
|
|
32
|
+
older: null,
|
|
33
|
+
target: null,
|
|
34
|
+
id: null,
|
|
35
|
+
reason: "unanswered",
|
|
36
|
+
auto_reload: { enabled: !0, idle_seconds: (a == null ? void 0 : a.auto_reload.idle_seconds) ?? 60 }
|
|
37
|
+
}, s = Date.now();
|
|
38
|
+
}, t = () => {
|
|
39
|
+
if (!u || n || i) return;
|
|
40
|
+
const e = L({
|
|
41
|
+
now: Date.now(),
|
|
42
|
+
lastInput: E(),
|
|
43
|
+
unsaved: F(),
|
|
44
|
+
holds: S(),
|
|
45
|
+
status: a,
|
|
46
|
+
statusAt: s,
|
|
47
|
+
reloadedFor: h,
|
|
48
|
+
declined: d
|
|
49
|
+
});
|
|
50
|
+
if (e.action === "check") {
|
|
51
|
+
n = !0, m().finally(() => {
|
|
52
|
+
n = !1, t();
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
e.action === "reload" && (i = !0, b(e.id), y(), window.location.reload(), setTimeout(() => {
|
|
57
|
+
i = !1, d = !0;
|
|
58
|
+
}, 1500));
|
|
59
|
+
}, p = setInterval(t, C);
|
|
60
|
+
document.addEventListener("visibilitychange", t), window.addEventListener("pageshow", t);
|
|
61
|
+
const v = _(() => setTimeout(t, 0));
|
|
62
|
+
return () => {
|
|
63
|
+
u = !1, clearInterval(p), document.removeEventListener("visibilitychange", t), window.removeEventListener("pageshow", t), v();
|
|
64
|
+
};
|
|
65
|
+
}, [r]), null;
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
x as IdleReloadWatcher
|
|
69
|
+
};
|