@nivaro/react 0.3.65 → 0.3.67
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 +21 -5
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +2432 -2592
- package/dist/shared/components/ItemEditForm.js +3912 -3773
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/CatalogPickerField.js +240 -238
- package/dist/shared/components/item-edit/FieldRow.js +193 -193
- package/dist/shared/components/item-edit/GroupSection.js +559 -542
- package/dist/shared/components/item-edit/M2MCombobox.js +414 -349
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +211 -187
- package/dist/shared/components/item-edit/RecordInsights.js +46 -45
- package/dist/shared/components/item-edit/RelationCombobox.js +327 -311
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +23 -19
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +73 -47
- package/dist/shared/components/item-edit/picker-search.js +25 -21
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +72 -72
- package/dist/shared/components/panels/PipelinePanel.js +261 -261
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +220 -220
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +1007 -979
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +19 -18
- package/dist/shared/lib/obligation-reason-text.js +1 -1
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/utils.js +59 -57
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
import { toast as
|
|
3
|
-
const p = m(null),
|
|
1
|
+
import { useRef as s, useEffect as f, useCallback as d, createContext as m, useContext as h } from "react";
|
|
2
|
+
import { toast as C } from "sonner";
|
|
3
|
+
const p = m(null), E = () => h(p);
|
|
4
4
|
function w(n) {
|
|
5
5
|
const e = [...new Set(n.filter(Boolean))];
|
|
6
6
|
return e.length <= 1 ? e[0] ?? "" : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`;
|
|
@@ -9,44 +9,48 @@ function T(n, e) {
|
|
|
9
9
|
const r = w(n);
|
|
10
10
|
return e ? `${r} cleared — not available for the ${e} you picked` : `${r} cleared — no longer available for what you picked`;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const r = new Set(n.map((t) => t.field)),
|
|
14
|
-
return
|
|
12
|
+
function x(n, e) {
|
|
13
|
+
const r = new Set(n.map((t) => t.field)), o = [...new Set(n.flatMap((t) => t.parents))].filter((t) => !r.has(t));
|
|
14
|
+
return o.length === 0 ? null : o.reduce((t, c) => e(c) > e(t) ? c : t, o[0]);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
16
|
+
const S = 4e3, g = 500, R = "nvr-cascade-clear";
|
|
17
17
|
function N(n) {
|
|
18
|
-
const e =
|
|
18
|
+
const e = s(n);
|
|
19
19
|
e.current = n;
|
|
20
|
-
const r =
|
|
20
|
+
const r = s([]), o = s(0), t = s(null);
|
|
21
21
|
return f(
|
|
22
22
|
() => () => {
|
|
23
23
|
t.current && clearTimeout(t.current);
|
|
24
24
|
},
|
|
25
25
|
[]
|
|
26
|
-
), d((
|
|
27
|
-
const
|
|
28
|
-
|
|
26
|
+
), d((c) => {
|
|
27
|
+
const l = Date.now();
|
|
28
|
+
l - o.current > S && (r.current = []), o.current = l, r.current.some((a) => a.field === c.field) || r.current.push(c), t.current && clearTimeout(t.current), t.current = setTimeout(() => {
|
|
29
29
|
const a = r.current;
|
|
30
30
|
if (a.length === 0) return;
|
|
31
|
-
const
|
|
32
|
-
|
|
31
|
+
const u = x(a, e.current.editSeq);
|
|
32
|
+
C.info(
|
|
33
33
|
T(
|
|
34
|
-
a.map((
|
|
35
|
-
|
|
34
|
+
a.map((i) => i.label),
|
|
35
|
+
u ? e.current.labelOf(u) : null
|
|
36
36
|
),
|
|
37
37
|
{
|
|
38
38
|
id: R,
|
|
39
39
|
description: "Pick them again from the narrowed lists."
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
},
|
|
42
|
+
}, g);
|
|
43
43
|
}, []);
|
|
44
44
|
}
|
|
45
|
+
function P(n, e, r) {
|
|
46
|
+
return r.crossFill > 0 || r.notPerson > 0 ? !1 : (n.touched.add(e), n.seq.set(e, n.next()), !0);
|
|
47
|
+
}
|
|
45
48
|
export {
|
|
46
49
|
p as CascadeClearNoticeContext,
|
|
47
50
|
T as cascadeClearText,
|
|
48
|
-
|
|
51
|
+
x as cascadeRootParent,
|
|
49
52
|
w as joinLabels,
|
|
53
|
+
P as notePersonLinkEdit,
|
|
50
54
|
N as useCascadeClearNotices,
|
|
51
|
-
|
|
55
|
+
E as useCascadeClearNotifier
|
|
52
56
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useQueries as p } from "@tanstack/react-query";
|
|
2
|
+
import { useMemo as m } from "react";
|
|
3
|
+
import { useNivaroClient as h } from "../../context.js";
|
|
4
|
+
import { get as w } from "../../lib/commands.js";
|
|
5
|
+
function v(n, f, c, a) {
|
|
6
|
+
const d = [];
|
|
7
|
+
for (const l of n) {
|
|
8
|
+
const r = l.split(".");
|
|
9
|
+
if (r.length !== 2 || !r[0] || !r[1]) continue;
|
|
10
|
+
const [t, o] = r, e = f[t], i = e != null && typeof e == "object" ? e.id : e;
|
|
11
|
+
if (i == null || i === "") continue;
|
|
12
|
+
const s = c[t], u = s != null && typeof s == "object" ? s.id : s;
|
|
13
|
+
!a && String(u ?? "") === String(i) || d.push({ path: l, hop: t, rest: o, id: String(i) });
|
|
14
|
+
}
|
|
15
|
+
return d;
|
|
16
|
+
}
|
|
17
|
+
function _(n) {
|
|
18
|
+
const f = h(), c = v(n.paths, n.draft, n.saved, n.isNew).map((t) => {
|
|
19
|
+
const o = n.relations.find(
|
|
20
|
+
(e) => e.many_collection === n.collection && e.many_field === t.hop && !e.junction_field
|
|
21
|
+
);
|
|
22
|
+
return o != null && o.one_collection ? { ...t, target: o.one_collection } : null;
|
|
23
|
+
}).filter((t) => !!t), a = /* @__PURE__ */ new Map();
|
|
24
|
+
for (const t of c) {
|
|
25
|
+
const o = `${t.target}:${t.id}`, e = a.get(o) ?? { target: t.target, id: t.id, fields: /* @__PURE__ */ new Set() };
|
|
26
|
+
e.fields.add(t.rest), a.set(o, e);
|
|
27
|
+
}
|
|
28
|
+
const d = [...a.values()], l = p({
|
|
29
|
+
queries: d.map((t) => ({
|
|
30
|
+
queryKey: ["header-path-preview", t.target, t.id, [...t.fields].sort().join(",")],
|
|
31
|
+
queryFn: () => f.request(
|
|
32
|
+
w(`/items/${t.target}/${encodeURIComponent(t.id)}`, {
|
|
33
|
+
fields: [...t.fields].join(",")
|
|
34
|
+
})
|
|
35
|
+
).then((o) => o.data ?? null).catch(() => null),
|
|
36
|
+
staleTime: 3e4
|
|
37
|
+
}))
|
|
38
|
+
}), r = l.map((t) => t.dataUpdatedAt).join(",");
|
|
39
|
+
return m(() => {
|
|
40
|
+
var o;
|
|
41
|
+
const t = {};
|
|
42
|
+
for (const e of c) {
|
|
43
|
+
const i = d.findIndex((u) => u.target === e.target && u.id === e.id), s = (o = l[i]) == null ? void 0 : o.data;
|
|
44
|
+
s && (t[e.path] = s[e.rest] ?? null);
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
}, [r, c.map((t) => `${t.path}=${t.id}`).join("|")]);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
v as pathsToPreview,
|
|
51
|
+
_ as useHeaderPathPreview
|
|
52
|
+
};
|
|
@@ -1,58 +1,84 @@
|
|
|
1
|
-
import { evaluateNumeric as
|
|
2
|
-
import { sameStoredValue as
|
|
3
|
-
import { lineConflictKey as
|
|
4
|
-
function m(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { evaluateNumeric as u } from "../../lib/expression.js";
|
|
2
|
+
import { sameStoredValue as a } from "../../lib/write-formula.js";
|
|
3
|
+
import { lineConflictKey as l } from "./line-midair.js";
|
|
4
|
+
function m(e, n) {
|
|
5
|
+
return e.key != null && e.rowId != null ? l({ key: e.key, rowId: e.rowId }, n) : n;
|
|
6
|
+
}
|
|
7
|
+
function k(e) {
|
|
8
|
+
const n = new Set((e.derived ?? []).map((t) => t.field));
|
|
9
|
+
return e.conflicts.map((t) => {
|
|
10
|
+
const i = e.mine[t.field], c = n.has(t.field) ? "derived" : a(t.current_value, i) ? "same" : "conflict";
|
|
8
11
|
return {
|
|
9
|
-
key:
|
|
10
|
-
field:
|
|
11
|
-
theirs:
|
|
12
|
-
mine:
|
|
13
|
-
kind:
|
|
12
|
+
key: m(e, t.field),
|
|
13
|
+
field: t.field,
|
|
14
|
+
theirs: t.current_value,
|
|
15
|
+
mine: i,
|
|
16
|
+
kind: c
|
|
14
17
|
};
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
20
|
+
function b(e, n) {
|
|
21
|
+
return e.every((t) => t.kind !== "conflict" || n.has(t.key));
|
|
19
22
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
for (const
|
|
23
|
-
return
|
|
23
|
+
function g(e, n) {
|
|
24
|
+
const t = /* @__PURE__ */ new Set();
|
|
25
|
+
for (const i of e) (i.kind !== "conflict" || n.get(i.key) !== "mine") && t.add(i.key);
|
|
26
|
+
return t;
|
|
24
27
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!(
|
|
27
|
-
const
|
|
28
|
-
for (const
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
function y(e, n) {
|
|
29
|
+
if (!(n != null && n.length)) return e;
|
|
30
|
+
const t = { ...e };
|
|
31
|
+
for (const i of n) {
|
|
32
|
+
const c = u(i.formula, t);
|
|
33
|
+
c !== null && Number.isFinite(c) && (t[i.field] = Math.round(c * 1e6) / 1e6);
|
|
31
34
|
}
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
for (const [
|
|
37
|
-
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
|
|
35
|
+
return t;
|
|
36
|
+
}
|
|
37
|
+
function w(e, n) {
|
|
38
|
+
const t = k(e), i = new Set(t.map((r) => r.field)), c = new Set((e.derived ?? []).map((r) => r.field)), o = { ...e.current ?? {} };
|
|
39
|
+
for (const [r, d] of Object.entries(e.edit ?? e.mine))
|
|
40
|
+
r.startsWith("_") || r === "id" || i.has(r) || c.has(r) || (o[r] = d);
|
|
41
|
+
for (const r of t)
|
|
42
|
+
r.kind !== "derived" && (o[r.field] = r.kind === "conflict" && n.get(r.key) === "mine" ? r.mine : r.theirs);
|
|
43
|
+
return y(o, e.derived);
|
|
44
|
+
}
|
|
45
|
+
function S(e, n) {
|
|
46
|
+
const t = [], i = e.edit ?? e.mine, c = (o) => {
|
|
47
|
+
if (t.includes(o) || o === "id" || o.startsWith("_") || /_id$/.test(o)) return;
|
|
48
|
+
const r = i[o];
|
|
49
|
+
r !== null && typeof r == "object" || n != null && n(o) || t.push(o);
|
|
45
50
|
};
|
|
46
|
-
for (const
|
|
47
|
-
for (const
|
|
48
|
-
for (const
|
|
49
|
-
return
|
|
51
|
+
for (const o of Object.keys(e.edit ?? e.mine)) c(o);
|
|
52
|
+
for (const o of e.conflicts) c(o.field);
|
|
53
|
+
for (const o of e.derived ?? []) c(o.field);
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
function O(e) {
|
|
57
|
+
const n = {};
|
|
58
|
+
for (const [t, i] of Object.entries(e ?? {}))
|
|
59
|
+
t !== "id" && !t.startsWith("_") && (n[t] = i);
|
|
60
|
+
return n;
|
|
61
|
+
}
|
|
62
|
+
const v = /^(date_created|date_updated|created|changed|user_created|user_updated|creator|modified_by|modified_on)$/i;
|
|
63
|
+
function j(e, n, t) {
|
|
64
|
+
const i = t.filter((f) => Number(f.id) > n);
|
|
65
|
+
if (i.length === 0) return null;
|
|
66
|
+
const c = i.reduce((f, s) => Number(s.id) > Number(f.id) ? s : f), o = /* @__PURE__ */ new Set();
|
|
67
|
+
for (const f of i)
|
|
68
|
+
for (const s of Object.keys(f.delta ?? {})) v.test(s) || o.add(s);
|
|
69
|
+
const r = c.data ?? null, d = [];
|
|
70
|
+
for (const f of Object.keys(e))
|
|
71
|
+
f === "id" || f.startsWith("_") || !o.has(f) || d.push({ field: f, current_value: r ? r[f] : null });
|
|
72
|
+
return { conflicts: d, latest: Number(c.id), current: r };
|
|
50
73
|
}
|
|
51
74
|
export {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
g as
|
|
57
|
-
|
|
75
|
+
k as classifyLineConflicts,
|
|
76
|
+
O as mergeEditOf,
|
|
77
|
+
m as mergeKeyOf,
|
|
78
|
+
b as mergeReady,
|
|
79
|
+
g as mergeTheirsKeys,
|
|
80
|
+
w as mergedLinePreview,
|
|
81
|
+
S as previewFields,
|
|
82
|
+
y as recomputeDerived,
|
|
83
|
+
j as restoredLineConflicts
|
|
58
84
|
};
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { useState as i, useRef as
|
|
1
|
+
import { useState as i, useRef as l, useEffect as s } from "react";
|
|
2
2
|
import { matchesAllTokens as f } from "../../lib/utils.js";
|
|
3
|
-
function
|
|
4
|
-
const [r,
|
|
5
|
-
return
|
|
3
|
+
function g(t, e, n = 300) {
|
|
4
|
+
const [r, u] = i(t), c = l(!1);
|
|
5
|
+
return s(() => {
|
|
6
6
|
if (t === r) {
|
|
7
|
-
|
|
7
|
+
c.current = !1;
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
10
|
if (!t) {
|
|
11
|
-
|
|
11
|
+
u("");
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (e) {
|
|
15
|
+
c.current = !0;
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
return () => clearTimeout(
|
|
20
|
-
}, [t, r,
|
|
18
|
+
const o = setTimeout(() => u(t), c.current ? 0 : n);
|
|
19
|
+
return () => clearTimeout(o);
|
|
20
|
+
}, [t, r, e, n]), r;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return r || !
|
|
22
|
+
function p(t, e, n, r) {
|
|
23
|
+
return r || !n.trim() ? t : t.filter((u) => f(e(u), n));
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
const r =
|
|
28
|
-
return !r || t.length >=
|
|
25
|
+
const a = 200;
|
|
26
|
+
function E(t, e, n) {
|
|
27
|
+
const r = n.replace(/[-_/]+/g, " ").trim();
|
|
28
|
+
return !r || t.length >= a ? [] : t.filter((u) => f(e(u), r));
|
|
29
|
+
}
|
|
30
|
+
function S(t) {
|
|
31
|
+
return !!t && t.length > 0 && t.every((e) => e.fuzzy === !0);
|
|
29
32
|
}
|
|
30
33
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
a as PICKER_PAGE,
|
|
35
|
+
E as labelOnlyMatches,
|
|
36
|
+
p as narrowLocally,
|
|
37
|
+
S as onlyCloseMatches,
|
|
38
|
+
g as useLatestSearch
|
|
35
39
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { GitBranch as N, Check as _, GitMerge as j } from "lucide-react";
|
|
3
3
|
import { serverNow as $ } from "../../lib/server-clock.js";
|
|
4
|
-
import { formatRelative as w,
|
|
5
|
-
import { OwnerAvatars as
|
|
4
|
+
import { formatRelative as w, formatDateTime as v, humanHours as C } from "../../lib/utils.js";
|
|
5
|
+
import { OwnerAvatars as T } from "../queue/OwnerAvatars.js";
|
|
6
6
|
function k(e, l) {
|
|
7
7
|
if (!e) return null;
|
|
8
8
|
const n = (l ? new Date(l).getTime() : $()) - new Date(e).getTime();
|
|
9
9
|
if (!Number.isFinite(n) || n < 0) return null;
|
|
10
10
|
const i = Math.floor(n / 6e4);
|
|
11
|
-
return i < 60 ? `${Math.max(1, i)}m` :
|
|
11
|
+
return i < 60 ? `${Math.max(1, i)}m` : C(n / 36e5);
|
|
12
12
|
}
|
|
13
13
|
function y({
|
|
14
14
|
color: e,
|
|
@@ -29,7 +29,7 @@ function y({
|
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function J({ data: e }) {
|
|
33
33
|
var i, d, m, p;
|
|
34
34
|
if (e.lanes.length === 0) return null;
|
|
35
35
|
const l = ((i = e.split_state) == null ? void 0 : i.color) ?? "#94a3b8", o = ((d = e.join_state) == null ? void 0 : d.color) ?? "#94a3b8", n = e.lanes.filter((t) => e.waiting_on.includes(t.instance_id));
|
|
@@ -91,7 +91,7 @@ function B({ data: e }) {
|
|
|
91
91
|
backgroundColor: !g || t.terminal ? s.state.color ?? "#94a3b8" : "transparent",
|
|
92
92
|
border: `1.5px solid ${s.state.color ?? "#94a3b8"}`
|
|
93
93
|
},
|
|
94
|
-
"data-tip": `${s.state.label} · entered ${
|
|
94
|
+
"data-tip": `${s.state.label} · entered ${v(s.entered_at)}${s.by ? ` by ${s.by}` : ""}`,
|
|
95
95
|
children: (!g || t.terminal) && /* @__PURE__ */ r(_, { className: "h-2.5 w-2.5 text-white", strokeWidth: 3 })
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -110,7 +110,7 @@ function B({ data: e }) {
|
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
112
|
c && /* @__PURE__ */ r("span", { className: "text-[11px] tabular-nums text-slate-500 dark:text-slate-400", children: t.terminal ? `done in ${c}` : `${c} in this state` }),
|
|
113
|
-
!t.terminal && /* @__PURE__ */ r("span", { className: "ml-auto", children: /* @__PURE__ */ r(
|
|
113
|
+
!t.terminal && /* @__PURE__ */ r("span", { className: "ml-auto", children: /* @__PURE__ */ r(T, { owners: t.owners ?? [], max: 3, emptyLabel: "No owners" }) })
|
|
114
114
|
]
|
|
115
115
|
},
|
|
116
116
|
t.instance_id
|
|
@@ -137,5 +137,5 @@ function B({ data: e }) {
|
|
|
137
137
|
);
|
|
138
138
|
}
|
|
139
139
|
export {
|
|
140
|
-
|
|
140
|
+
J as BranchLanes
|
|
141
141
|
};
|