@nivaro/react 0.3.15 → 0.3.16
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 +127 -6
- package/dist/index.js +736 -734
- package/dist/shared/components/CollectionBrowserView.js +2344 -2309
- package/dist/shared/components/ItemEditForm.js +3773 -3604
- package/dist/shared/components/RecordGridEditor.js +319 -282
- package/dist/shared/components/RecordReadView.js +202 -200
- package/dist/shared/components/cbv/unknown-fields.js +18 -8
- package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
- package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
- package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
- package/dist/shared/components/item-edit/FieldRow.js +198 -184
- package/dist/shared/components/item-edit/HeaderTools.js +107 -99
- package/dist/shared/components/item-edit/InlineTableField.js +138 -136
- package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
- package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
- package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
- package/dist/shared/components/item-edit/column-length.js +12 -0
- package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
- package/dist/shared/components/panels/ItemLockBanner.js +307 -285
- package/dist/shared/components/panels/PipelinePanel.js +486 -465
- package/dist/shared/components/panels/RevisionsPanel.js +210 -204
- package/dist/shared/components/profile/DelegationCard.js +178 -121
- package/dist/shared/components/profile/PersonActivity.js +152 -139
- package/dist/shared/components/queue/QueueWorklist.js +668 -659
- package/dist/shared/components/queue/transition-note.js +90 -0
- package/dist/shared/components/support/SupportRequestDialog.js +100 -89
- package/dist/shared/components/support/TicketDetailSheet.js +104 -91
- package/dist/shared/lib/autofill-runs.js +33 -26
- package/dist/shared/lib/draft-store.js +40 -24
- package/dist/shared/lib/live-queries.js +10 -9
- package/dist/shared/lib/restore-skipped.js +10 -0
- package/package.json +1 -1
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const u = "nivaro-drafts", l = "drafts";
|
|
2
|
+
function g(e) {
|
|
3
|
+
if (e == null) return null;
|
|
4
|
+
const t = JSON.stringify(
|
|
5
|
+
e,
|
|
6
|
+
(o, r) => r && typeof r == "object" && !Array.isArray(r) ? Object.fromEntries(Object.entries(r).sort(([a], [c]) => a < c ? -1 : a > c ? 1 : 0)) : r
|
|
7
|
+
);
|
|
8
|
+
if (!t || t === "{}" || t === "[]") return null;
|
|
9
|
+
let n = 5381;
|
|
10
|
+
for (let o = 0; o < t.length; o++) n = (n << 5) + n + t.charCodeAt(o) | 0;
|
|
11
|
+
return `p${(n >>> 0).toString(36)}:${t.length}`;
|
|
12
|
+
}
|
|
13
|
+
function m(e, t) {
|
|
14
|
+
return (e.prefill_sig ?? null) === t;
|
|
15
|
+
}
|
|
16
|
+
function y(e, t, n) {
|
|
3
17
|
return `${e}:${t && t !== "new" ? t : "new"}:${n || "anon"}`;
|
|
4
18
|
}
|
|
5
19
|
function f() {
|
|
6
20
|
return new Promise((e) => {
|
|
7
21
|
try {
|
|
8
22
|
if (typeof indexedDB > "u") return e(null);
|
|
9
|
-
const t = indexedDB.open(
|
|
23
|
+
const t = indexedDB.open(u, 1);
|
|
10
24
|
t.onupgradeneeded = () => {
|
|
11
25
|
const n = t.result;
|
|
12
|
-
n.objectStoreNames.contains(
|
|
26
|
+
n.objectStoreNames.contains(l) || n.createObjectStore(l, { keyPath: "key" });
|
|
13
27
|
}, t.onsuccess = () => e(t.result), t.onerror = () => e(null), t.onblocked = () => e(null);
|
|
14
28
|
} catch {
|
|
15
29
|
e(null);
|
|
16
30
|
}
|
|
17
31
|
});
|
|
18
32
|
}
|
|
19
|
-
async function
|
|
33
|
+
async function i(e, t) {
|
|
20
34
|
const n = await f();
|
|
21
35
|
return n ? new Promise((o) => {
|
|
22
36
|
try {
|
|
23
|
-
const r = n.transaction(
|
|
37
|
+
const r = n.transaction(l, e), a = t(r.objectStore(l));
|
|
24
38
|
a.onsuccess = () => o(a.result), a.onerror = () => o(null), r.oncomplete = () => n.close(), r.onerror = () => {
|
|
25
39
|
n.close(), o(null);
|
|
26
40
|
};
|
|
@@ -29,18 +43,18 @@ async function l(e, t) {
|
|
|
29
43
|
}
|
|
30
44
|
}) : null;
|
|
31
45
|
}
|
|
32
|
-
async function g(e) {
|
|
33
|
-
return await l("readwrite", (n) => n.put(e)) != null;
|
|
34
|
-
}
|
|
35
46
|
async function b(e) {
|
|
36
|
-
|
|
47
|
+
return await i("readwrite", (n) => n.put(e)) != null;
|
|
48
|
+
}
|
|
49
|
+
async function p(e) {
|
|
50
|
+
const t = await i("readonly", (n) => n.get(e));
|
|
37
51
|
return t && typeof t == "object" && t.key === e ? t : null;
|
|
38
52
|
}
|
|
39
|
-
async function
|
|
40
|
-
await
|
|
53
|
+
async function h(e) {
|
|
54
|
+
await i("readwrite", (t) => t.delete(e));
|
|
41
55
|
}
|
|
42
56
|
const s = "nvr:draft-created:", d = 7 * 864e5;
|
|
43
|
-
function
|
|
57
|
+
function O(e, t, n = /* @__PURE__ */ new Date()) {
|
|
44
58
|
try {
|
|
45
59
|
localStorage.setItem(
|
|
46
60
|
s + e,
|
|
@@ -49,7 +63,7 @@ function p(e, t, n = /* @__PURE__ */ new Date()) {
|
|
|
49
63
|
} catch {
|
|
50
64
|
}
|
|
51
65
|
}
|
|
52
|
-
function
|
|
66
|
+
function S(e, t, n = /* @__PURE__ */ new Date()) {
|
|
53
67
|
try {
|
|
54
68
|
const o = localStorage.getItem(s + e);
|
|
55
69
|
if (!o) return null;
|
|
@@ -58,21 +72,23 @@ function w(e, t, n = /* @__PURE__ */ new Date()) {
|
|
|
58
72
|
const a = Date.parse(r.at);
|
|
59
73
|
if (!Number.isFinite(a) || n.getTime() - a > d)
|
|
60
74
|
return localStorage.removeItem(s + e), null;
|
|
61
|
-
const
|
|
62
|
-
return !Number.isFinite(
|
|
75
|
+
const c = t ? Date.parse(t) : Number.NaN;
|
|
76
|
+
return !Number.isFinite(c) || c > a ? null : { id: r.id, at: r.at };
|
|
63
77
|
} catch {
|
|
64
78
|
return null;
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
|
-
function
|
|
81
|
+
function w(e) {
|
|
68
82
|
return Object.keys(e.fields ?? {}).length > 0 || Object.values(e.pending_rows ?? {}).some((t) => t.length > 0) || Object.values(e.pending_edits ?? {}).some((t) => Object.keys(t).length > 0) || Object.values(e.pending_deletes ?? {}).some((t) => t.length > 0) || Object.values(e.m2m_links ?? {}).some((t) => t.length > 0) || Object.values(e.m2m_unlinks ?? {}).some((t) => t.length > 0);
|
|
69
83
|
}
|
|
70
84
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
p as
|
|
77
|
-
|
|
85
|
+
h as deleteDraft,
|
|
86
|
+
S as draftCreatedAs,
|
|
87
|
+
w as draftHasContent,
|
|
88
|
+
y as draftKey,
|
|
89
|
+
m as draftMatchesPrefill,
|
|
90
|
+
p as loadDraft,
|
|
91
|
+
O as markDraftCreated,
|
|
92
|
+
g as prefillSignature,
|
|
93
|
+
b as saveDraft
|
|
78
94
|
};
|
|
@@ -18,6 +18,7 @@ const he = [
|
|
|
18
18
|
"tasks",
|
|
19
19
|
"addendums",
|
|
20
20
|
"pipeline-instance",
|
|
21
|
+
"pipeline-instance-lock",
|
|
21
22
|
"pipeline-all-owners",
|
|
22
23
|
"pipeline-instance-owners",
|
|
23
24
|
"pipeline-owners-resolved",
|
|
@@ -123,7 +124,7 @@ function we(t, s, o = {}) {
|
|
|
123
124
|
}));
|
|
124
125
|
}, se = L.subscribe((e) => {
|
|
125
126
|
(e.type === "added" || e.type === "removed" || e.type === "observerAdded" || e.type === "observerRemoved" || e.type === "observerOptionsUpdated") && te();
|
|
126
|
-
}), F = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Map(),
|
|
127
|
+
}), F = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Set(), oe = (e, n) => {
|
|
127
128
|
if (e.length === 0) return;
|
|
128
129
|
const i = new Set(e), r = d();
|
|
129
130
|
for (const f of e) F.set(f, r);
|
|
@@ -134,7 +135,7 @@ function we(t, s, o = {}) {
|
|
|
134
135
|
}, q = (e, n = !0) => {
|
|
135
136
|
const i = [], r = [];
|
|
136
137
|
for (const u of e)
|
|
137
|
-
u.getObserversCount() === 0 ? r.push(u) : c != null && c.hidden ? (r.push(u),
|
|
138
|
+
u.getObserversCount() === 0 ? r.push(u) : c != null && c.hidden ? (r.push(u), k.add(u)) : i.push(u);
|
|
138
139
|
if (r.length) {
|
|
139
140
|
const u = new Set(r);
|
|
140
141
|
S.deferred += r.length, t.invalidateQueries({ predicate: (g) => u.has(g), refetchType: "none" });
|
|
@@ -172,7 +173,7 @@ function we(t, s, o = {}) {
|
|
|
172
173
|
const n = [];
|
|
173
174
|
for (const r of L.getAll())
|
|
174
175
|
I(r) && n.push(r);
|
|
175
|
-
|
|
176
|
+
k.clear();
|
|
176
177
|
const i = new Set(n);
|
|
177
178
|
t.invalidateQueries(
|
|
178
179
|
{
|
|
@@ -196,20 +197,20 @@ function we(t, s, o = {}) {
|
|
|
196
197
|
n && !H && (e.resumed === "unverified" || e.resumed === void 0) && V(), H = n;
|
|
197
198
|
}), K = () => V(), b = o.reconcileOnCatchupFull === !1 ? null : p;
|
|
198
199
|
b == null || b.addEventListener("nvr:catchup-full", K);
|
|
199
|
-
let
|
|
200
|
+
let A = c != null && c.hidden ? d() : null;
|
|
200
201
|
const P = () => {
|
|
201
202
|
if (!c) return;
|
|
202
203
|
if (c.hidden) {
|
|
203
|
-
|
|
204
|
+
A ?? (A = d());
|
|
204
205
|
return;
|
|
205
206
|
}
|
|
206
|
-
const e =
|
|
207
|
-
if (
|
|
207
|
+
const e = A == null ? 0 : d() - A;
|
|
208
|
+
if (A = null, e >= M) {
|
|
208
209
|
x();
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
211
|
-
const n = [...
|
|
212
|
-
|
|
212
|
+
const n = [...k].filter((i) => i.getObserversCount() > 0);
|
|
213
|
+
k.clear(), q(n, !1);
|
|
213
214
|
};
|
|
214
215
|
return c == null || c.addEventListener("visibilitychange", P), z(t, 1), B(), {
|
|
215
216
|
reconcile: x,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function c(r) {
|
|
2
|
+
var o;
|
|
3
|
+
const e = r, n = ((o = e == null ? void 0 : e.data) == null ? void 0 : o.skipped_fields) ?? (e == null ? void 0 : e.skipped_fields);
|
|
4
|
+
if (!Array.isArray(n) || n.length === 0) return null;
|
|
5
|
+
const t = [...new Set(n.map((a) => String(a).replace(/_/g, " ")))], s = t.slice(0, 5).join(", "), i = t.length > 5 ? ` and ${t.length - 5} more` : "";
|
|
6
|
+
return `Not restored (you can't change ${t.length === 1 ? "it" : "them"}): ${s}${i}`;
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
c as restoreSkippedNote
|
|
10
|
+
};
|