@nivaro/react 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/fields/FileField.js +20 -19
- package/dist/full.css +1 -1
- package/dist/hooks/useNivaroForm.js +129 -126
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +512 -501
- package/dist/shared/components/CollectionBrowserView.js +1000 -1001
- package/dist/shared/components/ConformanceView.js +36 -35
- package/dist/shared/components/ForceReloadBanner.js +58 -34
- package/dist/shared/components/ItemEditForm.js +3687 -3580
- package/dist/shared/components/JsonMapEditor.js +18 -17
- package/dist/shared/components/MatrixEditor.js +8 -7
- package/dist/shared/components/MyWorkView.js +32 -31
- package/dist/shared/components/PageRenderer.js +146 -145
- package/dist/shared/components/RecordGridEditor.js +76 -75
- package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
- package/dist/shared/components/ai/AskPanel.js +55 -54
- package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
- package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
- package/dist/shared/components/chat/SlashCommands.js +30 -29
- package/dist/shared/components/chat/chat-outbox.js +76 -75
- package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
- package/dist/shared/components/integrations/console/SignalCard.js +124 -123
- package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
- package/dist/shared/components/item-edit/CloneDialog.js +85 -78
- package/dist/shared/components/item-edit/InlineTableField.js +301 -300
- package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
- package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
- package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
- package/dist/shared/components/item-edit/staged-links.js +86 -0
- package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
- package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
- package/dist/shared/components/profile/AiMemoryCard.js +15 -14
- package/dist/shared/components/profile/PersonAdminTools.js +70 -67
- package/dist/shared/components/queue/QueueItemSheet.js +36 -35
- package/dist/shared/components/queue/QueueWorklist.js +597 -598
- package/dist/shared/lib/client-version.js +63 -0
- package/dist/shared/lib/force-reload.js +36 -0
- package/dist/shared/lib/load-error.js +11 -10
- package/dist/shared/lib/presence-live.js +54 -35
- package/dist/shared/lib/record-outbox.js +76 -75
- package/dist/shared/lib/safe-error.js +39 -0
- package/dist/shared/lib/server-clock.js +11 -7
- package/dist/shared/lib/unsaved-work.js +62 -0
- package/package.json +1 -1
|
@@ -3,19 +3,23 @@ const i = 1e3;
|
|
|
3
3
|
function o() {
|
|
4
4
|
return Date.now() + s;
|
|
5
5
|
}
|
|
6
|
-
function f(
|
|
7
|
-
s
|
|
6
|
+
function f() {
|
|
7
|
+
return s;
|
|
8
8
|
}
|
|
9
9
|
function u(t) {
|
|
10
|
+
s = Number.isFinite(t) && Math.abs(t) >= i ? Math.round(t) : 0;
|
|
11
|
+
}
|
|
12
|
+
function c(t) {
|
|
10
13
|
let e = null;
|
|
11
|
-
for (const
|
|
12
|
-
const
|
|
13
|
-
!Number.isFinite(
|
|
14
|
+
for (const r of t) {
|
|
15
|
+
const n = r.received - r.sent;
|
|
16
|
+
!Number.isFinite(n) || n < 0 || !Number.isFinite(r.server) || (!e || n < e.received - e.sent) && (e = r);
|
|
14
17
|
}
|
|
15
18
|
return e ? e.server - (e.sent + (e.received - e.sent) / 2) : null;
|
|
16
19
|
}
|
|
17
20
|
export {
|
|
18
|
-
|
|
21
|
+
c as measureClockOffset,
|
|
22
|
+
f as serverClockOffset,
|
|
19
23
|
o as serverNow,
|
|
20
|
-
|
|
24
|
+
u as setServerClockOffset
|
|
21
25
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useEffect as c } from "react";
|
|
2
|
+
import { subscribeRecordOutbox as f, getRecordOutbox as i } from "./record-outbox.js";
|
|
3
|
+
const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
|
|
4
|
+
let a = 0;
|
|
5
|
+
function u() {
|
|
6
|
+
for (const e of [...s])
|
|
7
|
+
try {
|
|
8
|
+
e();
|
|
9
|
+
} catch {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function d(e, t) {
|
|
13
|
+
const n = ++a;
|
|
14
|
+
return r.set(n, { label: e, dirty: t }), u(), () => {
|
|
15
|
+
r.delete(n) && u();
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function l() {
|
|
19
|
+
try {
|
|
20
|
+
return i().length;
|
|
21
|
+
} catch {
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function b() {
|
|
26
|
+
const e = [];
|
|
27
|
+
for (const n of r.values()) {
|
|
28
|
+
let o = !1;
|
|
29
|
+
try {
|
|
30
|
+
o = n.dirty();
|
|
31
|
+
} catch {
|
|
32
|
+
o = !1;
|
|
33
|
+
}
|
|
34
|
+
o && !e.includes(n.label) && e.push(n.label);
|
|
35
|
+
}
|
|
36
|
+
const t = l();
|
|
37
|
+
return t && e.push(`${t} save${t === 1 ? "" : "s"} waiting to be sent`), e;
|
|
38
|
+
}
|
|
39
|
+
function g() {
|
|
40
|
+
return b().length > 0;
|
|
41
|
+
}
|
|
42
|
+
function k(e) {
|
|
43
|
+
s.add(e);
|
|
44
|
+
const t = f(e);
|
|
45
|
+
return () => {
|
|
46
|
+
s.delete(e), t();
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function p(e, t = "Unsaved changes") {
|
|
50
|
+
c(() => {
|
|
51
|
+
if (e)
|
|
52
|
+
return d(t, () => !0);
|
|
53
|
+
}, [e, t]);
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
g as hasUnsavedWork,
|
|
57
|
+
u as notifyUnsavedWorkChanged,
|
|
58
|
+
d as registerUnsavedWork,
|
|
59
|
+
k as subscribeUnsavedWork,
|
|
60
|
+
b as unsavedWorkLabels,
|
|
61
|
+
p as useUnsavedWork
|
|
62
|
+
};
|