@nivaro/react 0.3.98 → 0.3.100
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/useFormSchema.js +82 -85
- package/dist/hooks/useSessionRecorder.js +206 -175
- package/dist/index.d.ts +38 -13
- package/dist/index.js +182 -180
- package/dist/lib/commands.js +15 -11
- package/dist/shared/components/CollectionBrowserView.js +516 -503
- package/dist/shared/components/ItemEditForm.js +3021 -3019
- package/dist/shared/components/JobsTray.js +20 -16
- package/dist/shared/components/MyWorkView.js +133 -126
- package/dist/shared/components/NotificationBell.js +314 -288
- package/dist/shared/components/RecordCompare.js +38 -40
- package/dist/shared/components/RecordReadView.js +119 -119
- package/dist/shared/components/cbv/FoundElsewhere.js +61 -0
- package/dist/shared/components/item-edit/InlineGridField.js +45 -45
- package/dist/shared/components/item-edit/InlineTableField.js +750 -749
- package/dist/shared/components/item-edit/QuickPickerDialog.js +44 -44
- package/dist/shared/components/item-edit/RawEditSheet.js +122 -114
- package/dist/shared/components/item-edit/RelationCombobox.js +454 -378
- package/dist/shared/components/item-edit/SummaryPanel.js +56 -48
- package/dist/shared/components/item-edit/related-missing.js +75 -19
- package/dist/shared/components/notifications/NotificationCenterView.js +249 -226
- package/dist/shared/components/panels/AccessDeniedPanel.js +31 -28
- package/dist/shared/components/panels/BackgroundMove.js +175 -0
- package/dist/shared/components/panels/MoveAdvisory.js +204 -0
- package/dist/shared/components/panels/PipelinePanel.js +1450 -1219
- package/dist/shared/components/panels/RecordIntegrityBanner.js +113 -112
- package/dist/shared/lib/commands.js +18 -14
- package/dist/shared/lib/error-hints.js +1 -1
- package/dist/shared/lib/job-failure-text.js +12 -0
- package/dist/shared/lib/move-failure.js +9 -0
- package/dist/shared/lib/obligation-banner.js +15 -14
- package/dist/shared/lib/partner-failure.js +71 -0
- package/dist/shared/lib/prefetch.js +73 -73
- package/dist/shared/lib/replay-checkout.js +18 -13
- package/dist/shared/lib/replay-context.js +90 -77
- package/dist/shared/lib/replay-idle.js +21 -0
- package/dist/shared/lib/replay-socket.js +21 -17
- package/dist/shared/lib/rum.js +56 -51
- package/dist/shared/lib/safe-error.js +17 -13
- package/dist/shared/lib/stale-chunk.js +69 -26
- package/dist/shared/lib/system-collections.js +20 -0
- package/package.json +1 -1
|
@@ -1,131 +1,128 @@
|
|
|
1
|
-
import { useState as S, useRef as
|
|
2
|
-
import { get as
|
|
3
|
-
import { UNGROUPED_POS_SENTINEL as
|
|
4
|
-
import { normalizeFieldType as
|
|
1
|
+
import { useState as S, useRef as M, useEffect as A } from "react";
|
|
2
|
+
import { get as h, getActiveLayout as L } from "../lib/commands.js";
|
|
3
|
+
import { UNGROUPED_POS_SENTINEL as x, toBool as p, buildSchema as R } from "./schemaBuilder.js";
|
|
4
|
+
import { normalizeFieldType as D } from "./schemaBuilder.js";
|
|
5
5
|
const E = /* @__PURE__ */ new Set(["__pipeline__", "__comments__", "__tasks__"]);
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
function q(t, e) {
|
|
7
|
+
t.tabMode = (e == null ? void 0 : e.tab_mode) === "steps" ? "steps" : (e == null ? void 0 : e.tab_mode) === "tabs" ? "tabs" : null, t.aiEnabled = p(e == null ? void 0 : e.ai_enabled), t.summaryEnabled = p(e == null ? void 0 : e.summary_enabled), t.validateBeforeNext = p(e == null ? void 0 : e.validate_before_next);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function w(t) {
|
|
10
|
+
return t.filter((e) => E.has(e.field)).map((e) => ({
|
|
11
11
|
slot: e.field,
|
|
12
12
|
groupKey: e.group_key ?? null,
|
|
13
13
|
sort: e.sort,
|
|
14
14
|
labelOverride: e.label_override ?? null,
|
|
15
|
-
isVisible: e.is_visible == null ? !0 :
|
|
16
|
-
defaultExpanded:
|
|
15
|
+
isVisible: e.is_visible == null ? !0 : p(e.is_visible),
|
|
16
|
+
defaultExpanded: p(e.default_expanded)
|
|
17
17
|
}));
|
|
18
18
|
}
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
return u ? `${
|
|
19
|
+
const l = /* @__PURE__ */ new Map();
|
|
20
|
+
function F(t, e, o, r, u) {
|
|
21
|
+
return u ? `${t}::${e}::${o ? "h" : ""}::slug=${u}` : `${t}::${e}::${o ? "h" : ""}::${r ?? "active"}`;
|
|
22
22
|
}
|
|
23
|
-
async function
|
|
23
|
+
async function N(t, e, o, r, u) {
|
|
24
24
|
if (r != null) {
|
|
25
|
-
const [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const [s, b, v, m] = await Promise.all([
|
|
26
|
+
t.request(h(`/collections/${e}`)),
|
|
27
|
+
t.request(h(`/collection-layouts/${r}`)).catch(() => ({ data: void 0 })),
|
|
28
|
+
t.request(
|
|
29
|
+
h(`/field-groups/${e}`, { layout_id: r })
|
|
30
30
|
),
|
|
31
|
-
|
|
32
|
-
]),
|
|
33
|
-
let
|
|
34
|
-
const
|
|
35
|
-
for (const n of
|
|
36
|
-
if (n.field ===
|
|
37
|
-
|
|
31
|
+
t.request(h(`/collection-layouts/${r}/assignments`))
|
|
32
|
+
]), c = /* @__PURE__ */ new Map();
|
|
33
|
+
let f = null;
|
|
34
|
+
const k = m.data ?? [];
|
|
35
|
+
for (const n of k) {
|
|
36
|
+
if (n.field === x) {
|
|
37
|
+
f = n.sort;
|
|
38
38
|
continue;
|
|
39
39
|
}
|
|
40
|
-
E.has(n.field) ||
|
|
40
|
+
E.has(n.field) || c.set(n.field, {
|
|
41
41
|
group_key: n.group_key,
|
|
42
42
|
sort: n.sort,
|
|
43
|
-
is_visible: n.is_visible == null ? !0 :
|
|
43
|
+
is_visible: n.is_visible == null ? !0 : p(n.is_visible),
|
|
44
44
|
label_override: n.label_override ?? null,
|
|
45
45
|
default_expanded: n.default_expanded
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const $ = R(
|
|
49
49
|
e,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
s.data,
|
|
51
|
+
v.data ?? [],
|
|
52
52
|
o,
|
|
53
|
-
|
|
53
|
+
c
|
|
54
54
|
);
|
|
55
|
-
return
|
|
55
|
+
return $.ungroupedSort = f, q($, b.data), $.slotAssignments = w(k), $;
|
|
56
56
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (const t of l.data.assignments ?? []) {
|
|
74
|
-
if (t.field === k) {
|
|
75
|
-
m = t.sort;
|
|
57
|
+
const a = () => ({
|
|
58
|
+
data: {
|
|
59
|
+
groups: [],
|
|
60
|
+
assignments: [],
|
|
61
|
+
ungrouped_sort: null
|
|
62
|
+
}
|
|
63
|
+
}), [y, i] = await Promise.all([
|
|
64
|
+
t.request(h(`/collections/${e}`)),
|
|
65
|
+
t.request(
|
|
66
|
+
L(u ? { collection: e, slug: u } : { collection: e })
|
|
67
|
+
).then((s) => s.data ? { data: s.data } : a()).catch(a)
|
|
68
|
+
]), g = /* @__PURE__ */ new Map();
|
|
69
|
+
let d = i.data.ungrouped_sort ?? null;
|
|
70
|
+
for (const s of i.data.assignments ?? []) {
|
|
71
|
+
if (s.field === x) {
|
|
72
|
+
d = s.sort;
|
|
76
73
|
continue;
|
|
77
74
|
}
|
|
78
|
-
E.has(
|
|
79
|
-
group_key:
|
|
80
|
-
sort:
|
|
81
|
-
label_override:
|
|
75
|
+
E.has(s.field) || g.set(s.field, {
|
|
76
|
+
group_key: s.group_key,
|
|
77
|
+
sort: s.sort,
|
|
78
|
+
label_override: s.label_override ?? null
|
|
82
79
|
});
|
|
83
80
|
}
|
|
84
|
-
const
|
|
81
|
+
const _ = R(
|
|
85
82
|
e,
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
y.data,
|
|
84
|
+
i.data.groups ?? [],
|
|
88
85
|
o,
|
|
89
|
-
|
|
86
|
+
g.size > 0 ? g : void 0
|
|
90
87
|
);
|
|
91
|
-
return
|
|
88
|
+
return _.ungroupedSort = d, q(_, i.data.layout), _.slotAssignments = w(i.data.assignments ?? []), _;
|
|
92
89
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
() =>
|
|
96
|
-
), [
|
|
97
|
-
return
|
|
98
|
-
if (!
|
|
99
|
-
|
|
90
|
+
function T(t, e, o = !1, r, u) {
|
|
91
|
+
const a = t ? F(t.url, e, o, r, u) : null, [y, i] = S(
|
|
92
|
+
() => a ? l.get(a) ?? null : null
|
|
93
|
+
), [g, d] = S(() => !(a && l.has(a))), [_, s] = S(null), b = M(0);
|
|
94
|
+
return A(() => {
|
|
95
|
+
if (!t || !e) {
|
|
96
|
+
d(!1);
|
|
100
97
|
return;
|
|
101
98
|
}
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
|
|
99
|
+
const v = l.get(a);
|
|
100
|
+
if (v) {
|
|
101
|
+
s(null), i(v), d(!1);
|
|
105
102
|
return;
|
|
106
103
|
}
|
|
107
|
-
const
|
|
104
|
+
const m = ++b.current;
|
|
108
105
|
let c = !0;
|
|
109
|
-
return
|
|
110
|
-
!c ||
|
|
106
|
+
return s(null), i(null), d(!0), N(t, e, o, r, u).then((f) => {
|
|
107
|
+
!c || m !== b.current || (l.set(a, f), i(f), d(!1));
|
|
111
108
|
}).catch((f) => {
|
|
112
|
-
!c ||
|
|
109
|
+
!c || m !== b.current || (s(f instanceof Error ? f : new Error(String(f))), d(!1));
|
|
113
110
|
}), () => {
|
|
114
111
|
c = !1;
|
|
115
112
|
};
|
|
116
|
-
}, [
|
|
113
|
+
}, [t, e, o, a, r, u]), { schema: y, loading: g, error: _ };
|
|
117
114
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!
|
|
120
|
-
|
|
115
|
+
function z(t) {
|
|
116
|
+
if (!t) {
|
|
117
|
+
l.clear();
|
|
121
118
|
return;
|
|
122
119
|
}
|
|
123
|
-
for (const e of Array.from(
|
|
124
|
-
e.includes(`::${
|
|
120
|
+
for (const e of Array.from(l.keys()))
|
|
121
|
+
e.includes(`::${t}::`) && l.delete(e);
|
|
125
122
|
}
|
|
126
123
|
export {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
z as clearFormSchemaCache,
|
|
125
|
+
N as fetchSchema,
|
|
126
|
+
D as normalizeFieldType,
|
|
127
|
+
T as useFormSchema
|
|
131
128
|
};
|