@nivaro/react 0.2.54 → 0.2.55
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 +99 -98
- package/dist/index.d.ts +339 -2
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TABLE_FORM_GROUP_KEYS as Z } from "../../../lib/layout-ops.js";
|
|
2
2
|
import { parseVisibleWhen as oe, matchesVisibleWhen as le } from "../../../lib/visible-when.js";
|
|
3
3
|
import { SYSTEM_FIELDS as K } from "../../item-edit/helpers.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { deferredSections as re } from "../../item-edit/lazy-sections.js";
|
|
5
|
+
import { fieldAccessForRole as de } from "../preview/preview-model.js";
|
|
6
|
+
const H = 5, we = 40;
|
|
7
|
+
function L(t) {
|
|
7
8
|
let n = t;
|
|
8
9
|
if (typeof n == "string")
|
|
9
10
|
try {
|
|
@@ -13,79 +14,79 @@ function q(t) {
|
|
|
13
14
|
}
|
|
14
15
|
return n && typeof n == "object" && !Array.isArray(n) ? n : null;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
+
function Se(t) {
|
|
17
18
|
var a;
|
|
18
|
-
const n =
|
|
19
|
+
const n = L((a = L(t)) == null ? void 0 : a.testing), r = [];
|
|
19
20
|
if (Array.isArray(n == null ? void 0 : n.records))
|
|
20
|
-
for (const
|
|
21
|
-
if ((
|
|
22
|
-
const d = { item: String(
|
|
23
|
-
|
|
21
|
+
for (const l of n.records) {
|
|
22
|
+
if ((l == null ? void 0 : l.item) == null || l.item === "") continue;
|
|
23
|
+
const d = { item: String(l.item), role_id: l.role_id ? String(l.role_id) : null };
|
|
24
|
+
r.some((u) => ae(u, d)) || r.push(d);
|
|
24
25
|
}
|
|
25
26
|
const s = Number(n == null ? void 0 : n.cost_limit);
|
|
26
27
|
return {
|
|
27
|
-
records:
|
|
28
|
+
records: r.slice(0, H),
|
|
28
29
|
cost_limit: Number.isFinite(s) && s > 0 ? Math.round(s) : null
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
const
|
|
32
|
-
function X(t, n,
|
|
33
|
-
const s = { ...
|
|
34
|
-
return
|
|
32
|
+
const ae = (t, n) => t.item === n.item && (t.role_id ?? "").toUpperCase() === (n.role_id ?? "").toUpperCase();
|
|
33
|
+
function X(t, n, r) {
|
|
34
|
+
const s = { ...L(t) ?? {} };
|
|
35
|
+
return r == null ? delete s[n] : s[n] = r, Object.keys(s).length > 0 ? s : null;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
37
|
+
function $e(t, n) {
|
|
38
|
+
const r = n.records.length === 0 && n.cost_limit == null;
|
|
38
39
|
return {
|
|
39
40
|
conditions: X(
|
|
40
41
|
t,
|
|
41
42
|
"testing",
|
|
42
|
-
|
|
43
|
+
r ? null : {
|
|
43
44
|
records: n.records.slice(0, H),
|
|
44
45
|
...n.cost_limit != null ? { cost_limit: n.cost_limit } : {}
|
|
45
46
|
}
|
|
46
47
|
)
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function Ae(t, n) {
|
|
50
51
|
return { conditions: X(t, "role_ids", n.length ? n : null) };
|
|
51
52
|
}
|
|
52
|
-
const
|
|
53
|
+
const N = (t) => new Map(t.groups.map((n) => [n.key, n]));
|
|
53
54
|
function Q(t, n) {
|
|
54
55
|
if (!n || t == null || t === "") return !1;
|
|
55
56
|
try {
|
|
56
|
-
const
|
|
57
|
-
return Array.isArray(
|
|
57
|
+
const r = typeof t == "string" ? JSON.parse(t) : t;
|
|
58
|
+
return Array.isArray(r) && r.some((s) => String(s).toUpperCase() === n.toUpperCase());
|
|
58
59
|
} catch {
|
|
59
60
|
return !1;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
const Y = (t, n) => t == null ? void 0 : t[n];
|
|
63
|
-
function
|
|
64
|
+
function M(t, n, r) {
|
|
64
65
|
const s = new Map(n.groups.map((d) => [d.id, d]));
|
|
65
66
|
let a = t;
|
|
66
|
-
const
|
|
67
|
+
const l = /* @__PURE__ */ new Set();
|
|
67
68
|
for (; a; ) {
|
|
68
69
|
if (a.type === "tab" && a.container_id == null)
|
|
69
|
-
return le(a.visible_when,
|
|
70
|
-
if (a.container_id == null ||
|
|
71
|
-
|
|
70
|
+
return le(a.visible_when, r);
|
|
71
|
+
if (a.container_id == null || l.has(a.id)) return !0;
|
|
72
|
+
l.add(a.id), a = s.get(a.container_id);
|
|
72
73
|
}
|
|
73
74
|
return !0;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
const s =
|
|
76
|
+
function Oe(t, n, r) {
|
|
77
|
+
const s = N(t), a = r && !r.role.admin_access ? de(r, t) : null, l = /* @__PURE__ */ new Map();
|
|
77
78
|
for (const d of t.assignments) {
|
|
78
79
|
if (d.field.startsWith("__") || d.is_visible === !1 || d.is_visible === 0 || ee(d.overrides)) continue;
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
if (Z.includes(
|
|
82
|
-
const
|
|
83
|
-
if (!
|
|
80
|
+
const u = d.group_key ?? null;
|
|
81
|
+
if (u != null && u !== "__header__") {
|
|
82
|
+
if (Z.includes(u)) continue;
|
|
83
|
+
const _ = s.get(u);
|
|
84
|
+
if (!_ || !M(_, t, n)) continue;
|
|
84
85
|
}
|
|
85
|
-
let
|
|
86
|
-
|
|
86
|
+
let p = "editable";
|
|
87
|
+
r && !r.role.admin_access && (p = (a == null ? void 0 : a.get(d.field)) ?? "hidden"), p !== "hidden" && l.get(d.field) !== "editable" && l.set(d.field, p);
|
|
87
88
|
}
|
|
88
|
-
return
|
|
89
|
+
return l;
|
|
89
90
|
}
|
|
90
91
|
function ee(t) {
|
|
91
92
|
if (t == null || t === "") return !1;
|
|
@@ -96,67 +97,67 @@ function ee(t) {
|
|
|
96
97
|
return !1;
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function Te(...t) {
|
|
100
101
|
const n = /* @__PURE__ */ new Set();
|
|
101
|
-
for (const
|
|
102
|
-
for (const s of (
|
|
102
|
+
for (const r of t)
|
|
103
|
+
for (const s of (r == null ? void 0 : r.groups) ?? [])
|
|
103
104
|
if (s.type === "tab" && s.container_id == null)
|
|
104
105
|
for (const a of oe(s.visible_when))
|
|
105
106
|
a.field && /^[A-Za-z_][A-Za-z0-9_]*$/.test(a.field) && n.add(a.field);
|
|
106
107
|
return [...n];
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
+
function fe(t, n = 3) {
|
|
109
110
|
return t.length <= 1 ? t[0] ?? "" : t.length <= n ? `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}` : `${t.slice(0, n).join(", ")} and ${t.length - n} more`;
|
|
110
111
|
}
|
|
111
|
-
const
|
|
112
|
-
function
|
|
113
|
-
var
|
|
114
|
-
const s = [], a = ((
|
|
115
|
-
if (a !==
|
|
116
|
-
return t.view && !n.view ? s.push({ kind: "form", text: `lands on another form: ${
|
|
112
|
+
const T = (t) => t ? `“${t.name}”` : "no form";
|
|
113
|
+
function Ee(t, n, r) {
|
|
114
|
+
var o, h;
|
|
115
|
+
const s = [], a = ((o = t.form) == null ? void 0 : o.layout_id) ?? null, l = ((h = n.form) == null ? void 0 : h.layout_id) ?? null;
|
|
116
|
+
if (a !== l)
|
|
117
|
+
return t.view && !n.view ? s.push({ kind: "form", text: `lands on another form: ${T(n.form)}` }) : !t.view && n.view ? s.push({ kind: "form", text: `now opens on this form (was ${T(t.form)})` }) : s.push({
|
|
117
118
|
kind: "form",
|
|
118
|
-
text: `moves from ${
|
|
119
|
+
text: `moves from ${T(t.form)} to ${T(n.form)}`
|
|
119
120
|
}), s;
|
|
120
121
|
if (!t.view || !n.view) return s;
|
|
121
|
-
const d = [],
|
|
122
|
-
for (const [
|
|
123
|
-
const k = n.view.get(
|
|
124
|
-
k ?
|
|
122
|
+
const d = [], u = [], p = [], _ = [];
|
|
123
|
+
for (const [c, m] of t.view) {
|
|
124
|
+
const k = n.view.get(c);
|
|
125
|
+
k ? m === "editable" && k === "readonly" ? p.push(c) : m === "readonly" && k === "editable" && _.push(c) : d.push(c);
|
|
125
126
|
}
|
|
126
|
-
for (const
|
|
127
|
-
const
|
|
127
|
+
for (const c of n.view.keys()) t.view.has(c) || u.push(c);
|
|
128
|
+
const y = (c) => fe(c.map(r));
|
|
128
129
|
return d.length && s.push({
|
|
129
130
|
kind: "lost",
|
|
130
131
|
fields: d,
|
|
131
|
-
text: d.length === 1 ? `loses the ${
|
|
132
|
-
}),
|
|
132
|
+
text: d.length === 1 ? `loses the ${y(d)} field` : `loses ${y(d)} fields`
|
|
133
|
+
}), u.length && s.push({
|
|
133
134
|
kind: "gained",
|
|
134
|
-
fields:
|
|
135
|
-
text:
|
|
136
|
-
}),
|
|
135
|
+
fields: u,
|
|
136
|
+
text: u.length === 1 ? `gains the ${y(u)} field` : `gains ${y(u)} fields`
|
|
137
|
+
}), p.length && s.push({
|
|
137
138
|
kind: "readonly",
|
|
138
|
-
fields:
|
|
139
|
-
text: `can no longer edit ${
|
|
140
|
-
}),
|
|
139
|
+
fields: p,
|
|
140
|
+
text: `can no longer edit ${y(p)}`
|
|
141
|
+
}), _.length && s.push({ kind: "editable", fields: _, text: `can now edit ${y(_)}` }), s;
|
|
141
142
|
}
|
|
142
|
-
const
|
|
143
|
-
function
|
|
143
|
+
const ce = (t) => t != null && t !== "" && !(Array.isArray(t) && t.length === 0);
|
|
144
|
+
function qe(t) {
|
|
144
145
|
var D, x, B;
|
|
145
|
-
const { layout: n, rows:
|
|
146
|
+
const { layout: n, rows: r, access: s, thisLayoutId: a } = t, l = n.layout, d = s.role && !s.role.admin_access ? s.role.id : null, u = [], p = [], _ = [], y = (e) => {
|
|
146
147
|
var f;
|
|
147
|
-
const
|
|
148
|
-
return (
|
|
149
|
-
},
|
|
150
|
-
for (const [e,
|
|
151
|
-
for (const [e,
|
|
152
|
-
const
|
|
153
|
-
if (s.new_record_form && s.new_record_form.layout_id !== a &&
|
|
148
|
+
const i = r.find((g) => g.field === e);
|
|
149
|
+
return (i == null ? void 0 : i.label) || ((f = t.label) == null ? void 0 : f.call(t, e)) || e;
|
|
150
|
+
}, o = {}, h = l == null ? void 0 : l.default_values;
|
|
151
|
+
for (const [e, i] of Object.entries(h ?? {})) o[e] = i;
|
|
152
|
+
for (const [e, i] of Object.entries(t.values ?? {})) o[e] = i;
|
|
153
|
+
const c = (e) => ce(o[e.field]) || !!e.default_formula || s.column_defaults.some((i) => i.toLowerCase() === e.field.toLowerCase());
|
|
154
|
+
if (s.new_record_form && s.new_record_form.layout_id !== a && u.push(
|
|
154
155
|
`New records open on “${s.new_record_form.name}” for ${((D = s.role) == null ? void 0 : D.name) ?? "administrators"} unless they pick this form.`
|
|
155
156
|
), !s.role_may_open)
|
|
156
157
|
return {
|
|
157
|
-
steps:
|
|
158
|
-
skipped:
|
|
159
|
-
notes:
|
|
158
|
+
steps: _,
|
|
159
|
+
skipped: p,
|
|
160
|
+
notes: u,
|
|
160
161
|
blocker: {
|
|
161
162
|
step: -1,
|
|
162
163
|
where: "Opening the form",
|
|
@@ -165,35 +166,35 @@ function Te(t) {
|
|
|
165
166
|
};
|
|
166
167
|
if (!s.can_create)
|
|
167
168
|
return {
|
|
168
|
-
steps:
|
|
169
|
-
skipped:
|
|
170
|
-
notes:
|
|
169
|
+
steps: _,
|
|
170
|
+
skipped: p,
|
|
171
|
+
notes: u,
|
|
171
172
|
blocker: {
|
|
172
173
|
step: -1,
|
|
173
174
|
where: "Opening the form",
|
|
174
175
|
reason: `${((B = s.role) == null ? void 0 : B.name) ?? "This role"} may not create records in this collection.`
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
|
-
const
|
|
178
|
-
(e) => n.groups.filter((
|
|
179
|
-
), R =
|
|
180
|
-
let
|
|
178
|
+
const m = N(n), k = new Set(s.hidden_fields), w = s.create_fields ? new Set(s.create_fields) : null, v = (e, i) => e.sort - i.sort, E = new Map(n.groups.map((e) => [e.id, e])), b = n.groups.filter((e) => e.type === "tab" && e.container_id == null).sort(v), S = n.groups.filter((e) => e.type === "container").sort(v).flatMap(
|
|
179
|
+
(e) => n.groups.filter((i) => i.type === "tab" && i.container_id === e.id).sort(v)
|
|
180
|
+
), R = b.length > 0 && (l == null ? void 0 : l.tab_mode) === "steps", C = R && !!(l != null && l.validate_before_next), te = (e) => {
|
|
181
|
+
let i = e ? m.get(e) : void 0;
|
|
181
182
|
const f = /* @__PURE__ */ new Set();
|
|
182
|
-
for (;
|
|
183
|
-
if (
|
|
184
|
-
if (
|
|
185
|
-
f.add(
|
|
183
|
+
for (; i; ) {
|
|
184
|
+
if (i.type === "tab") return i.key;
|
|
185
|
+
if (i.container_id == null || f.has(i.id)) return null;
|
|
186
|
+
f.add(i.id), i = E.get(i.container_id);
|
|
186
187
|
}
|
|
187
188
|
return null;
|
|
188
|
-
}, j =
|
|
189
|
+
}, j = b.length + S.length > 0, ne = j ? [
|
|
189
190
|
{ key: "__general__", label: "General", group: null, validates: C },
|
|
190
|
-
...
|
|
191
|
+
...S.map((e) => ({
|
|
191
192
|
key: e.key,
|
|
192
193
|
label: e.label || e.key,
|
|
193
194
|
group: e,
|
|
194
195
|
validates: !1
|
|
195
196
|
})),
|
|
196
|
-
...
|
|
197
|
+
...b.map((e) => ({
|
|
197
198
|
key: e.key,
|
|
198
199
|
label: e.label || e.key,
|
|
199
200
|
group: e,
|
|
@@ -201,120 +202,120 @@ function Te(t) {
|
|
|
201
202
|
}))
|
|
202
203
|
] : [{ key: "__form__", label: "The form", group: null, validates: !1 }], U = "__float__", I = (e) => {
|
|
203
204
|
if (!j) return "__form__";
|
|
204
|
-
const
|
|
205
|
-
return
|
|
206
|
-
},
|
|
207
|
-
var
|
|
205
|
+
const i = te(e);
|
|
206
|
+
return i || (!e || e === "__header__" ? "__general__" : R ? U : "__general__");
|
|
207
|
+
}, q = [], W = /* @__PURE__ */ new Set(), se = (e) => {
|
|
208
|
+
var O, z, J, G;
|
|
208
209
|
if (!e.required || K.has(e.field) || e.field.startsWith("__")) return null;
|
|
209
|
-
const
|
|
210
|
-
if (e.hidden) return { ...
|
|
210
|
+
const i = { field: e.field, label: y(e.field) }, f = e.group_key ? m.get(e.group_key) : void 0;
|
|
211
|
+
if (e.hidden) return { ...i, status: "skipped", reason: "hidden on this form" };
|
|
211
212
|
if (k.has(e.field) || Q(Y(f, "hidden_for_roles"), d))
|
|
212
213
|
return {
|
|
213
|
-
...
|
|
214
|
+
...i,
|
|
214
215
|
status: "skipped",
|
|
215
|
-
reason: `${((
|
|
216
|
+
reason: `${((O = s.role) == null ? void 0 : O.name) ?? "the role"} cannot see it`
|
|
216
217
|
};
|
|
217
|
-
if (f && !
|
|
218
|
+
if (f && !M(f, n, o))
|
|
218
219
|
return {
|
|
219
|
-
...
|
|
220
|
+
...i,
|
|
220
221
|
status: "blocked",
|
|
221
222
|
reason: `its section “${f.label || f.key}” is hidden for these values`
|
|
222
223
|
};
|
|
223
|
-
if (
|
|
224
|
-
if (
|
|
225
|
-
return { ...
|
|
224
|
+
if (c(e)) return { ...i, status: "prefilled" };
|
|
225
|
+
if (w && !w.has(e.field))
|
|
226
|
+
return { ...i, status: "blocked", reason: `${(z = s.role) == null ? void 0 : z.name} may not write it` };
|
|
226
227
|
if (Q(Y(f, "locked_for_roles"), d))
|
|
227
228
|
return {
|
|
228
|
-
...
|
|
229
|
+
...i,
|
|
229
230
|
status: "blocked",
|
|
230
|
-
reason: `its section is locked for ${(
|
|
231
|
+
reason: `its section is locked for ${(J = s.role) == null ? void 0 : J.name}`
|
|
231
232
|
};
|
|
232
|
-
const
|
|
233
|
-
(
|
|
233
|
+
const g = n.assignments.find(
|
|
234
|
+
(V) => V.field === e.field && (V.group_key ?? null) === (e.group_key ?? null)
|
|
234
235
|
);
|
|
235
|
-
return d &&
|
|
236
|
+
return d && ue(g == null ? void 0 : g.lock_conditions).includes(d.toUpperCase()) ? { ...i, status: "blocked", reason: `it is locked for ${(G = s.role) == null ? void 0 : G.name}` } : e.readonly ? { ...i, status: "blocked", reason: "it is read-only on this form" } : { ...i, status: "fill" };
|
|
236
237
|
}, $ = /* @__PURE__ */ new Map();
|
|
237
|
-
for (const e of
|
|
238
|
+
for (const e of r) {
|
|
238
239
|
if (e.layout_assigned === !1) {
|
|
239
|
-
e.required && !e.hidden && !K.has(e.field) && !e.field.startsWith("__") &&
|
|
240
|
+
e.required && !e.hidden && !K.has(e.field) && !e.field.startsWith("__") && p.push({
|
|
240
241
|
field: e.field,
|
|
241
|
-
label:
|
|
242
|
+
label: y(e.field),
|
|
242
243
|
status: "skipped",
|
|
243
244
|
reason: "not on this form"
|
|
244
245
|
});
|
|
245
246
|
continue;
|
|
246
247
|
}
|
|
247
|
-
const
|
|
248
|
-
if (W.has(
|
|
249
|
-
W.add(
|
|
248
|
+
const i = `${e.field}\0${e.group_key ?? ""}`;
|
|
249
|
+
if (W.has(i)) continue;
|
|
250
|
+
W.add(i);
|
|
250
251
|
const f = se(e);
|
|
251
252
|
if (!f) continue;
|
|
252
253
|
if (f.status === "skipped") {
|
|
253
|
-
|
|
254
|
+
p.some((O) => O.field === f.field) || p.push(f);
|
|
254
255
|
continue;
|
|
255
256
|
}
|
|
256
|
-
const
|
|
257
|
-
|
|
257
|
+
const g = I(e.group_key);
|
|
258
|
+
g === U ? q.push(f) : $.set(g, [...$.get(g) ?? [], f]);
|
|
258
259
|
}
|
|
259
260
|
const F = new Set(
|
|
260
|
-
[...$.values(),
|
|
261
|
+
[...$.values(), q].flat().filter((e) => e.status !== "blocked").map((e) => e.field)
|
|
261
262
|
), ie = new Set(
|
|
262
263
|
n.assignments.filter((e) => !e.field.startsWith("__") && e.is_visible !== !1 && e.is_visible !== 0).map((e) => I(e.group_key))
|
|
263
264
|
), P = /* @__PURE__ */ new Set();
|
|
264
265
|
for (const e of ne) {
|
|
265
|
-
const
|
|
266
|
-
(
|
|
267
|
-
...
|
|
266
|
+
const i = e.group ? !M(e.group, n, o) : !1, f = ($.get(e.key) ?? []).map(
|
|
267
|
+
(g) => g.status === "blocked" && F.has(g.field) ? { ...g, status: "fill", reason: void 0 } : i && g.status !== "prefilled" ? {
|
|
268
|
+
...g,
|
|
268
269
|
status: "blocked",
|
|
269
270
|
reason: `its step “${e.label}” is hidden for these values`
|
|
270
|
-
} :
|
|
271
|
+
} : g
|
|
271
272
|
);
|
|
272
|
-
e.key === "__general__" && !ie.has(e.key) || (
|
|
273
|
+
e.key === "__general__" && !ie.has(e.key) || (_.push({ key: e.key, label: e.label, hidden: i, fields: f }), e.validates && P.add(e.key));
|
|
273
274
|
}
|
|
274
|
-
for (let e = 0; e <
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
277
|
-
const f =
|
|
278
|
-
if (f && P.has(
|
|
275
|
+
for (let e = 0; e < _.length; e++) {
|
|
276
|
+
const i = _[e];
|
|
277
|
+
if (i.hidden) continue;
|
|
278
|
+
const f = i.fields.find((g) => g.status === "blocked");
|
|
279
|
+
if (f && P.has(i.key) && e < _.length - 1)
|
|
279
280
|
return {
|
|
280
|
-
steps:
|
|
281
|
-
skipped:
|
|
282
|
-
notes:
|
|
281
|
+
steps: _,
|
|
282
|
+
skipped: p,
|
|
283
|
+
notes: u,
|
|
283
284
|
blocker: {
|
|
284
285
|
step: e,
|
|
285
|
-
where: `Next on “${
|
|
286
|
+
where: `Next on “${i.label}”`,
|
|
286
287
|
field: f.field,
|
|
287
288
|
reason: `${f.label} is required, but ${f.reason}.`
|
|
288
289
|
}
|
|
289
290
|
};
|
|
290
291
|
}
|
|
291
|
-
const
|
|
292
|
+
const A = [..._.flatMap((e) => e.fields), ...q].find(
|
|
292
293
|
(e) => e.status === "blocked" && !F.has(e.field)
|
|
293
294
|
) ?? null;
|
|
294
|
-
return
|
|
295
|
-
steps:
|
|
296
|
-
skipped:
|
|
297
|
-
notes:
|
|
295
|
+
return A ? {
|
|
296
|
+
steps: _,
|
|
297
|
+
skipped: p,
|
|
298
|
+
notes: u,
|
|
298
299
|
blocker: {
|
|
299
|
-
step:
|
|
300
|
+
step: _.length,
|
|
300
301
|
where: "Save",
|
|
301
|
-
field:
|
|
302
|
-
reason: `${
|
|
302
|
+
field: A.field,
|
|
303
|
+
reason: `${A.label} is required, but ${A.reason}.`
|
|
303
304
|
}
|
|
304
|
-
} : { steps:
|
|
305
|
+
} : { steps: _, skipped: p, notes: u, blocker: null };
|
|
305
306
|
}
|
|
306
|
-
function
|
|
307
|
+
function ue(t) {
|
|
307
308
|
if (t == null || t === "") return [];
|
|
308
309
|
try {
|
|
309
310
|
const n = typeof t == "string" ? JSON.parse(t) : t;
|
|
310
311
|
return Array.isArray(n) ? n.flatMap(
|
|
311
|
-
(
|
|
312
|
+
(r) => (r == null ? void 0 : r.type) === "role" && Array.isArray(r.role_ids) ? r.role_ids.map((s) => String(s).toUpperCase()) : []
|
|
312
313
|
) : [];
|
|
313
314
|
} catch {
|
|
314
315
|
return [];
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
|
-
const
|
|
318
|
+
const _e = 5, pe = /* @__PURE__ */ new Set(["inline-table", "inline-grid", "list-o2m", "relation-list"]), he = {
|
|
318
319
|
__pipeline__: 2,
|
|
319
320
|
__tasks__: 1,
|
|
320
321
|
__comments__: 1,
|
|
@@ -323,7 +324,7 @@ const ue = 5, _e = /* @__PURE__ */ new Set(["inline-table", "inline-grid", "list
|
|
|
323
324
|
__related_records__: 1,
|
|
324
325
|
__owners__: 1,
|
|
325
326
|
__pdf__: 0
|
|
326
|
-
},
|
|
327
|
+
}, me = {
|
|
327
328
|
__pipeline__: "Workflow",
|
|
328
329
|
__tasks__: "Tasks",
|
|
329
330
|
__comments__: "Comments",
|
|
@@ -333,61 +334,73 @@ const ue = 5, _e = /* @__PURE__ */ new Set(["inline-table", "inline-grid", "list
|
|
|
333
334
|
__owners__: "Owners",
|
|
334
335
|
__pdf__: "PDF"
|
|
335
336
|
};
|
|
336
|
-
function
|
|
337
|
-
const { layout: n, rows:
|
|
338
|
-
{ kind: "base", key: "__base__", label: "The record page itself", requests:
|
|
339
|
-
], d =
|
|
340
|
-
for (const
|
|
341
|
-
if (
|
|
342
|
-
const
|
|
343
|
-
if (
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
|
|
337
|
+
function Le(t) {
|
|
338
|
+
const { layout: n, rows: r, relations: s, collection: a } = t, l = [
|
|
339
|
+
{ kind: "base", key: "__base__", label: "The record page itself", requests: _e }
|
|
340
|
+
], d = N(n), u = (o, h) => r.find((c) => c.field === o && (c.group_key ?? null) === h) ?? r.find((c) => c.field === o);
|
|
341
|
+
for (const o of n.assignments) {
|
|
342
|
+
if (o.is_visible === !1 || o.is_visible === 0) continue;
|
|
343
|
+
const h = o.group_key ?? null;
|
|
344
|
+
if (h && Z.includes(h) || h && h !== "__header__" && !d.has(h)) continue;
|
|
345
|
+
const c = `${o.field}\0${h ?? ""}`;
|
|
346
|
+
if (o.widget_id != null) {
|
|
347
|
+
l.push({
|
|
347
348
|
kind: "widget",
|
|
348
|
-
key:
|
|
349
|
-
label:
|
|
349
|
+
key: c,
|
|
350
|
+
label: o.label_override || `Widget ${o.widget_id}`,
|
|
350
351
|
requests: 1
|
|
351
352
|
});
|
|
352
353
|
continue;
|
|
353
354
|
}
|
|
354
|
-
if (
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
kind:
|
|
358
|
-
key:
|
|
359
|
-
label:
|
|
360
|
-
requests:
|
|
355
|
+
if (o.field.startsWith("__")) {
|
|
356
|
+
const b = /^__ext_/.test(o.field), S = b ? 1 : he[o.field] ?? 0;
|
|
357
|
+
S > 0 && l.push({
|
|
358
|
+
kind: b ? "widget" : "panel",
|
|
359
|
+
key: c,
|
|
360
|
+
label: me[o.field] ?? o.field.replace(/^__ext_|__$/g, ""),
|
|
361
|
+
requests: S
|
|
361
362
|
});
|
|
362
363
|
continue;
|
|
363
364
|
}
|
|
364
|
-
const m =
|
|
365
|
-
if (m != null && m.hidden || ee(
|
|
366
|
-
const
|
|
367
|
-
if (
|
|
368
|
-
|
|
365
|
+
const m = u(o.field, h);
|
|
366
|
+
if (m != null && m.hidden || ee(o.overrides)) continue;
|
|
367
|
+
const k = o.label_override || (m == null ? void 0 : m.label) || o.field;
|
|
368
|
+
if (o.field.includes(".")) {
|
|
369
|
+
l.push({ kind: "query", key: c, label: k, requests: 1 });
|
|
369
370
|
continue;
|
|
370
371
|
}
|
|
371
|
-
const
|
|
372
|
-
|
|
372
|
+
const w = (m == null ? void 0 : m.interface) ?? "", v = s.find((b) => b.one_collection === a && b.one_field === o.field), E = s.some((b) => b.many_collection === a && b.many_field === o.field);
|
|
373
|
+
pe.has(w) || v && !v.junction_field && w !== "files-m2m" ? l.push({ kind: "grid", key: c, label: k, requests: 3 }) : v || E || /user|file|m2o|m2m/.test(w) ? l.push({ kind: "picker", key: c, label: k, requests: 1 }) : m != null && m.remote_options_config && l.push({ kind: "query", key: c, label: k, requests: 1 });
|
|
373
374
|
}
|
|
375
|
+
const p = re(n, /* @__PURE__ */ new Set()).groups;
|
|
376
|
+
if (p.size > 0)
|
|
377
|
+
for (const o of l) {
|
|
378
|
+
const h = o.key.split("\0")[1] ?? "";
|
|
379
|
+
h && p.has(h) && (o.deferred = !0);
|
|
380
|
+
}
|
|
374
381
|
const _ = { picker: 0, grid: 0, widget: 0, panel: 0, query: 0 };
|
|
375
|
-
for (const
|
|
376
|
-
|
|
382
|
+
for (const o of l) o.kind !== "base" && !o.deferred && _[o.kind]++;
|
|
383
|
+
const y = (o) => o.reduce((h, c) => h + c.requests, 0);
|
|
384
|
+
return {
|
|
385
|
+
total: y(l.filter((o) => !o.deferred)),
|
|
386
|
+
deferred: y(l.filter((o) => o.deferred)),
|
|
387
|
+
items: l,
|
|
388
|
+
counts: _
|
|
389
|
+
};
|
|
377
390
|
}
|
|
378
391
|
export {
|
|
379
|
-
|
|
380
|
-
|
|
392
|
+
_e as BASE_REQUESTS,
|
|
393
|
+
we as DEFAULT_COST_LIMIT,
|
|
381
394
|
H as MAX_PINNED,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
395
|
+
Ee as compareOutcomes,
|
|
396
|
+
Te as conditionFields,
|
|
397
|
+
Le as formCost,
|
|
398
|
+
Oe as formView,
|
|
399
|
+
M as groupShown,
|
|
400
|
+
fe as nameList,
|
|
401
|
+
Se as readTesting,
|
|
402
|
+
Ae as roleIdsPatch,
|
|
403
|
+
ae as samePin,
|
|
404
|
+
$e as testingPatch,
|
|
405
|
+
qe as walkthrough
|
|
393
406
|
};
|