@nivaro/react 0.2.54 → 0.2.56
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 +367 -2
- package/dist/index.js +645 -616
- 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/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsxs as a, Fragment as u, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useState as y } from "react";
|
|
3
|
-
import { RecordConditionsEditor as I, RecordConditionsJson as
|
|
4
|
-
import { RolesPicker as
|
|
3
|
+
import { RecordConditionsEditor as I, RecordConditionsJson as P } from "../editors/RecordConditionsEditor.js";
|
|
4
|
+
import { RolesPicker as z } from "../editors/RolesPicker.js";
|
|
5
5
|
import { DependencyDiagram as w } from "../ops/DependencyDiagram.js";
|
|
6
6
|
import { useLayoutDependencies as L } from "../ops/ops-api.js";
|
|
7
7
|
import { LAYOUT_TYPES as D } from "../overview/OverviewActions.js";
|
|
8
|
-
import { useRoleNames as
|
|
8
|
+
import { useRoleNames as F } from "../overview/overview-api.js";
|
|
9
9
|
import { roleIdsPatch as Y } from "../testing/testing-model.js";
|
|
10
10
|
import { Setting as p, smallBtn as d, quietText as x, Segmented as j } from "./controls.js";
|
|
11
|
+
import { ActiveDatesSetting as K, PhoneVersionSetting as M } from "./ResolveSettings.js";
|
|
11
12
|
import { changeLabel as _, flag as C } from "./section-props.js";
|
|
12
|
-
import { useFieldSources as
|
|
13
|
-
import { layoutKindOf as
|
|
13
|
+
import { useFieldSources as U, useCollectionLayoutList as $ } from "./settings-api.js";
|
|
14
|
+
import { layoutKindOf as B } from "./settings-registry.js";
|
|
14
15
|
import { TextSetting as S } from "./TextSetting.js";
|
|
15
|
-
import { ToggleSetting as
|
|
16
|
+
import { ToggleSetting as E } from "./ToggleSetting.js";
|
|
16
17
|
const g = (t) => {
|
|
17
18
|
var e;
|
|
18
19
|
return ((e = D.find((o) => o.type === t)) == null ? void 0 : e.label) ?? t;
|
|
19
|
-
},
|
|
20
|
-
function
|
|
20
|
+
}, G = (t) => t.toLowerCase().replace(/[^a-z0-9_]/g, "_"), v = (t) => t.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
|
|
21
|
+
function J(t) {
|
|
21
22
|
let e = t;
|
|
22
23
|
if (typeof e == "string")
|
|
23
24
|
try {
|
|
@@ -28,16 +29,16 @@ function E(t) {
|
|
|
28
29
|
const o = e == null ? void 0 : e.role_ids;
|
|
29
30
|
return Array.isArray(o) ? o.map(String) : [];
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
const { layout: e, collection: o } = t, { fields: c, columns: l, relations: i } =
|
|
32
|
+
function me(t) {
|
|
33
|
+
const { layout: e, collection: o } = t, { fields: c, columns: l, relations: i } = U(o), { data: m = [] } = F(!0), f = J(e.conditions);
|
|
33
34
|
return /* @__PURE__ */ a(u, { children: [
|
|
34
|
-
/* @__PURE__ */ n(
|
|
35
|
+
/* @__PURE__ */ n(V, { ...t }),
|
|
35
36
|
/* @__PURE__ */ n(
|
|
36
37
|
p,
|
|
37
38
|
{
|
|
38
39
|
k: "layout.record_conditions",
|
|
39
40
|
note: /* @__PURE__ */ n(
|
|
40
|
-
|
|
41
|
+
P,
|
|
41
42
|
{
|
|
42
43
|
value: e.record_conditions,
|
|
43
44
|
onApply: (s) => t.set({ record_conditions: s }, _("layout.record_conditions"))
|
|
@@ -62,7 +63,7 @@ function ce(t) {
|
|
|
62
63
|
}
|
|
63
64
|
),
|
|
64
65
|
/* @__PURE__ */ n(p, { k: "layout.conditions.role_ids", children: /* @__PURE__ */ n(
|
|
65
|
-
|
|
66
|
+
z,
|
|
66
67
|
{
|
|
67
68
|
value: f,
|
|
68
69
|
roles: m,
|
|
@@ -80,7 +81,7 @@ function ce(t) {
|
|
|
80
81
|
props: t,
|
|
81
82
|
mono: !0,
|
|
82
83
|
placeholder: "e.g. unit_order",
|
|
83
|
-
sanitize:
|
|
84
|
+
sanitize: G,
|
|
84
85
|
blurOnly: !0,
|
|
85
86
|
extra: !e.slug && typeof e.name == "string" && v(e.name) ? /* @__PURE__ */ n(
|
|
86
87
|
"button",
|
|
@@ -97,7 +98,7 @@ function ce(t) {
|
|
|
97
98
|
"?layout=",
|
|
98
99
|
String(e.slug)
|
|
99
100
|
] }),
|
|
100
|
-
/* @__PURE__ */ n(
|
|
101
|
+
/* @__PURE__ */ n(q, { layoutId: Number(e.id) })
|
|
101
102
|
] }) : null
|
|
102
103
|
}
|
|
103
104
|
),
|
|
@@ -109,10 +110,12 @@ function ce(t) {
|
|
|
109
110
|
placeholder: typeof e.name == "string" ? e.name : ""
|
|
110
111
|
}
|
|
111
112
|
),
|
|
112
|
-
/* @__PURE__ */ n(
|
|
113
|
+
/* @__PURE__ */ n(E, { k: "layout.create_hidden", props: t }),
|
|
114
|
+
/* @__PURE__ */ n(K, { ...t }),
|
|
115
|
+
/* @__PURE__ */ n(M, { ...t })
|
|
113
116
|
] });
|
|
114
117
|
}
|
|
115
|
-
function
|
|
118
|
+
function q({ layoutId: t }) {
|
|
116
119
|
const { data: e } = L(t), [o, c] = y(!1), l = ((e == null ? void 0 : e.nodes) ?? []).filter((i) => i.breaks.includes("slug")).length;
|
|
117
120
|
return l ? /* @__PURE__ */ a(u, { children: [
|
|
118
121
|
" · ",
|
|
@@ -134,12 +137,12 @@ function G({ layoutId: t }) {
|
|
|
134
137
|
o && /* @__PURE__ */ n(w, { layoutId: t, change: "slug", compact: !0, className: "mt-2" })
|
|
135
138
|
] }) : null;
|
|
136
139
|
}
|
|
137
|
-
function
|
|
138
|
-
const { layout: e, kind: o, bundle: c } = t, [l, i] = y(null), { data: m } = L(Number(e.id)), f = ((m == null ? void 0 : m.nodes.length) ?? 0) > 0, s = c.placements.length + c.groups.length, h = (r) => t.set({ layout_type: r }, `Change kind to ${g(r)}`), T = C(e.is_active), [O, b] = y(!1), k =
|
|
139
|
-
(r) => r.id !== Number(e.id) &&
|
|
140
|
-
), N = o === "grouped" ? "form" : `${g(o).toLowerCase()} layout`,
|
|
140
|
+
function V(t) {
|
|
141
|
+
const { layout: e, kind: o, bundle: c } = t, [l, i] = y(null), { data: m } = L(Number(e.id)), f = ((m == null ? void 0 : m.nodes.length) ?? 0) > 0, s = c.placements.length + c.groups.length, h = (r) => t.set({ layout_type: r }, `Change kind to ${g(r)}`), T = C(e.is_active), [O, b] = y(!1), k = $(t.collection).find(
|
|
142
|
+
(r) => r.id !== Number(e.id) && B(r) === o && C(r.is_active)
|
|
143
|
+
), N = o === "grouped" ? "form" : `${g(o).toLowerCase()} layout`, A = () => {
|
|
141
144
|
t.set({ is_active: !0 }, "Make default", { undoable: !1 }), b(!1);
|
|
142
|
-
},
|
|
145
|
+
}, R = o === "file" ? null : /* @__PURE__ */ n("div", { className: "flex flex-wrap items-center gap-2", children: T ? /* @__PURE__ */ a("span", { className: x, "data-default-layout": !0, children: [
|
|
143
146
|
"This is the default ",
|
|
144
147
|
g(o).toLowerCase(),
|
|
145
148
|
" layout: records no rule or role catches use it."
|
|
@@ -171,7 +174,7 @@ function J(t) {
|
|
|
171
174
|
type: "button",
|
|
172
175
|
"data-action": "make-default-confirm",
|
|
173
176
|
className: d,
|
|
174
|
-
onClick:
|
|
177
|
+
onClick: A,
|
|
175
178
|
children: "Yes, make default"
|
|
176
179
|
}
|
|
177
180
|
),
|
|
@@ -192,7 +195,7 @@ function J(t) {
|
|
|
192
195
|
),
|
|
193
196
|
/* @__PURE__ */ n("span", { className: x, children: "Records no rule or role catches would open with this layout." })
|
|
194
197
|
] }) });
|
|
195
|
-
return /* @__PURE__ */ a(p, { k: "layout.layout_type", note:
|
|
198
|
+
return /* @__PURE__ */ a(p, { k: "layout.layout_type", note: R, children: [
|
|
196
199
|
/* @__PURE__ */ n(
|
|
197
200
|
j,
|
|
198
201
|
{
|
|
@@ -244,6 +247,6 @@ function J(t) {
|
|
|
244
247
|
] });
|
|
245
248
|
}
|
|
246
249
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
me as WhoSection,
|
|
251
|
+
G as sanitizeSlug
|
|
249
252
|
};
|
|
@@ -6,9 +6,10 @@ const y = [
|
|
|
6
6
|
{ id: "pdf", title: "PDF" },
|
|
7
7
|
{ id: "addendum", title: "Addendum" },
|
|
8
8
|
{ id: "defaults", title: "Defaults for new records" },
|
|
9
|
+
{ id: "entry", title: "Entering data" },
|
|
9
10
|
{ id: "inheritance", title: "Inheritance" },
|
|
10
11
|
{ id: "tools", title: "AI review, previews, version history" }
|
|
11
|
-
], o = ["grouped", "table", "file", "addendum", "detail", "summary"], t = ["grouped", "table", "detail", "summary"], l = ["grouped", "detail", "summary"],
|
|
12
|
+
], o = ["grouped", "table", "file", "addendum", "detail", "summary"], t = ["grouped", "table", "detail", "summary"], l = ["grouped", "detail", "summary"], s = ["grouped"], c = [
|
|
12
13
|
// ── Who gets this form ────────────────────────────────────────────────────
|
|
13
14
|
{
|
|
14
15
|
key: "layout.layout_type",
|
|
@@ -44,14 +45,30 @@ const y = [
|
|
|
44
45
|
section: "who",
|
|
45
46
|
label: "New-menu label",
|
|
46
47
|
effect: "The name shown in the New menu of the collection list. Empty uses the layout name.",
|
|
47
|
-
types:
|
|
48
|
+
types: s
|
|
48
49
|
},
|
|
49
50
|
{
|
|
50
51
|
key: "layout.create_hidden",
|
|
51
52
|
section: "who",
|
|
52
53
|
label: "Hide from New menu",
|
|
53
54
|
effect: "Leaves this layout out of the New menu; its link name keeps working.",
|
|
54
|
-
types:
|
|
55
|
+
types: s
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "layout.conditions.active_window",
|
|
59
|
+
section: "who",
|
|
60
|
+
label: "Active dates",
|
|
61
|
+
effect: "The form applies only on these days, both included; outside them records open with the next form that fits.",
|
|
62
|
+
types: ["grouped"],
|
|
63
|
+
keywords: "window from until year end close season schedule period"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "layout.conditions.phone_of",
|
|
67
|
+
section: "who",
|
|
68
|
+
label: "Phone version",
|
|
69
|
+
effect: "A lighter copy of a form that opens instead of it on small screens; it never opens on its own.",
|
|
70
|
+
types: ["grouped"],
|
|
71
|
+
keywords: "mobile small screen variant device lighter"
|
|
55
72
|
},
|
|
56
73
|
// ── How it's laid out ─────────────────────────────────────────────────────
|
|
57
74
|
{
|
|
@@ -346,6 +363,70 @@ const y = [
|
|
|
346
363
|
effect: "Replaces the steps with the cascade chain of this collection, parents first.",
|
|
347
364
|
types: t
|
|
348
365
|
},
|
|
366
|
+
// ── Entering data ─────────────────────────────────────────────────────────
|
|
367
|
+
{
|
|
368
|
+
key: "layout.focus_first",
|
|
369
|
+
section: "entry",
|
|
370
|
+
label: "Start on the first empty required field",
|
|
371
|
+
effect: "When the form opens, the cursor is already in the first required field with no value.",
|
|
372
|
+
types: s,
|
|
373
|
+
keywords: "keyboard focus autofocus cursor"
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
key: "layout.enter_next",
|
|
377
|
+
section: "entry",
|
|
378
|
+
label: "Enter moves to the next field",
|
|
379
|
+
effect: "Pressing Enter in a field goes to the next one instead of saving; Ctrl or ⌘ + Enter still saves.",
|
|
380
|
+
types: s,
|
|
381
|
+
keywords: "keyboard submit return"
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
key: "layout.tab_order",
|
|
385
|
+
section: "entry",
|
|
386
|
+
label: "Tab order",
|
|
387
|
+
effect: "The order the Tab key visits fields in. Set it by clicking fields in order on the canvas.",
|
|
388
|
+
types: s,
|
|
389
|
+
keywords: "keyboard accessibility sequence"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
key: "layout.adaptive_mode",
|
|
393
|
+
section: "entry",
|
|
394
|
+
label: "Guided steps for new people",
|
|
395
|
+
effect: "A person making their first records sees this form as steps; after that it shows as tabs. Each person can switch.",
|
|
396
|
+
types: s,
|
|
397
|
+
keywords: "beginner expert onboarding steps tabs"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
key: "layout.adaptive_threshold",
|
|
401
|
+
section: "entry",
|
|
402
|
+
label: "Records before tabs",
|
|
403
|
+
effect: "How many records of their own a person makes before the form switches to tabs.",
|
|
404
|
+
types: s
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
key: "layout.badge",
|
|
408
|
+
section: "entry",
|
|
409
|
+
label: "Form badge",
|
|
410
|
+
effect: "A colour and short tag on the record header, so people can tell which form they are in.",
|
|
411
|
+
types: s,
|
|
412
|
+
keywords: "identity chip tag colour label"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
key: "layout.glossary",
|
|
416
|
+
section: "entry",
|
|
417
|
+
label: "Glossary tooltips in help text",
|
|
418
|
+
effect: "Glossary terms in help text get a dotted underline that shows their definition.",
|
|
419
|
+
types: s,
|
|
420
|
+
keywords: "definition term hover"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
key: "layout.presets",
|
|
424
|
+
section: "entry",
|
|
425
|
+
label: "Placement presets",
|
|
426
|
+
effect: "Named bundles of field settings (width, required, help text) that apply to other fields in one click.",
|
|
427
|
+
types: s,
|
|
428
|
+
keywords: "template reuse bundle"
|
|
429
|
+
},
|
|
349
430
|
// ── Inheritance ───────────────────────────────────────────────────────────
|
|
350
431
|
{
|
|
351
432
|
key: "layout.parent_layout_id",
|
|
@@ -420,6 +501,22 @@ const y = [
|
|
|
420
501
|
types: o,
|
|
421
502
|
keywords: "change note reason ticket audit required"
|
|
422
503
|
},
|
|
504
|
+
{
|
|
505
|
+
key: "layout.email_summary_group",
|
|
506
|
+
section: "tools",
|
|
507
|
+
label: "Section for notification emails",
|
|
508
|
+
effect: "Notification emails summarise the record with this section’s fields, in this form’s order, cut to what each person may see. None keeps the header strip. Only the default form’s choice counts.",
|
|
509
|
+
types: s,
|
|
510
|
+
keywords: "email mail notification summary body section"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
key: "layout.conditions.freeze",
|
|
514
|
+
section: "tools",
|
|
515
|
+
label: "Freeze edits",
|
|
516
|
+
effect: "Until the date, saves to this layout are refused with your reason; an administrator can still save by giving a note.",
|
|
517
|
+
types: o,
|
|
518
|
+
keywords: "freeze lock go-live audit read-only block edits override"
|
|
519
|
+
},
|
|
423
520
|
{
|
|
424
521
|
key: "tool.cost_limit",
|
|
425
522
|
section: "tools",
|
|
@@ -440,24 +537,24 @@ function h(e) {
|
|
|
440
537
|
return f.get(e);
|
|
441
538
|
}
|
|
442
539
|
function p(e) {
|
|
443
|
-
const
|
|
444
|
-
return
|
|
540
|
+
const a = e == null ? void 0 : e.layout_type;
|
|
541
|
+
return a === "table" || a === "file" || a === "addendum" || a === "detail" || a === "summary" ? a : "grouped";
|
|
445
542
|
}
|
|
446
|
-
function u(e,
|
|
447
|
-
const
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
return
|
|
543
|
+
function u(e, a) {
|
|
544
|
+
const i = a.toLowerCase().split(/\s+/).filter(Boolean);
|
|
545
|
+
if (i.length === 0) return !0;
|
|
546
|
+
const n = `${e.label} ${e.effect} ${e.key} ${e.keywords ?? ""}`.toLowerCase();
|
|
547
|
+
return i.every((r) => n.includes(r));
|
|
451
548
|
}
|
|
452
|
-
function m(e,
|
|
453
|
-
const
|
|
454
|
-
for (const
|
|
455
|
-
const
|
|
456
|
-
(d) => d.section ===
|
|
549
|
+
function m(e, a = "") {
|
|
550
|
+
const i = [];
|
|
551
|
+
for (const n of y) {
|
|
552
|
+
const r = c.filter(
|
|
553
|
+
(d) => d.section === n.id && d.types.includes(e) && u(d, a)
|
|
457
554
|
);
|
|
458
|
-
|
|
555
|
+
r.length && i.push({ section: n, settings: r });
|
|
459
556
|
}
|
|
460
|
-
return
|
|
557
|
+
return i;
|
|
461
558
|
}
|
|
462
559
|
export {
|
|
463
560
|
y as SECTIONS,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { useQuery as p, useQueryClient as y } from "@tanstack/react-query";
|
|
2
|
+
import { useCallback as c, useMemo as f } from "react";
|
|
3
|
+
import { useNivaroClient as u } from "../../context.js";
|
|
4
|
+
import { get as g, post as l } from "../../lib/commands.js";
|
|
5
|
+
const i = {
|
|
6
|
+
mine: (s) => ["layout-editor", "staged", s]
|
|
7
|
+
}, m = (s) => {
|
|
8
|
+
const t = s;
|
|
9
|
+
return !!t && typeof t.label == "string" && Array.isArray(t.ops);
|
|
10
|
+
};
|
|
11
|
+
function v(s) {
|
|
12
|
+
const t = s ?? {}, e = t.data, o = e && typeof e == "object" && !Array.isArray(e) && typeof e.base_rev == "string" && Array.isArray(e.steps) && e.steps.length > 0 && e.steps.every(m) ? {
|
|
13
|
+
steps: e.steps,
|
|
14
|
+
base_rev: e.base_rev,
|
|
15
|
+
saved_at: typeof e.saved_at == "string" ? e.saved_at : (/* @__PURE__ */ new Date()).toISOString()
|
|
16
|
+
} : null, n = Array.isArray(t.others) ? t.others.filter((r) => {
|
|
17
|
+
const a = r;
|
|
18
|
+
return !!a && typeof a.user_id == "string" && typeof a.name == "string";
|
|
19
|
+
}) : [];
|
|
20
|
+
return { data: o, others: n, available: t.available !== !1 };
|
|
21
|
+
}
|
|
22
|
+
function h(s, t = !0) {
|
|
23
|
+
const e = u();
|
|
24
|
+
return p({
|
|
25
|
+
queryKey: i.mine(s),
|
|
26
|
+
queryFn: () => e.request(g(`/collection-layouts/${s}/staged`)).then(v),
|
|
27
|
+
enabled: t,
|
|
28
|
+
staleTime: 3e4,
|
|
29
|
+
refetchOnWindowFocus: !1,
|
|
30
|
+
retry: !1
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function S() {
|
|
34
|
+
const s = u(), t = y(), e = c(
|
|
35
|
+
async (n, r) => {
|
|
36
|
+
await s.request(
|
|
37
|
+
l(`/collection-layouts/${n}/staged`, {
|
|
38
|
+
steps: r.steps.map((a) => ({ label: a.label, ops: a.ops })),
|
|
39
|
+
base_rev: r.baseRev
|
|
40
|
+
})
|
|
41
|
+
), t.setQueryData(i.mine(n), (a) => ({
|
|
42
|
+
data: { steps: r.steps, base_rev: r.baseRev, saved_at: (/* @__PURE__ */ new Date()).toISOString() },
|
|
43
|
+
others: (a == null ? void 0 : a.others) ?? [],
|
|
44
|
+
available: !0
|
|
45
|
+
}));
|
|
46
|
+
},
|
|
47
|
+
[s, t]
|
|
48
|
+
), o = c(
|
|
49
|
+
async (n) => {
|
|
50
|
+
await s.request(l(`/collection-layouts/${n}/staged/clear`)), t.setQueryData(
|
|
51
|
+
i.mine(n),
|
|
52
|
+
(r) => r && { ...r, data: null }
|
|
53
|
+
);
|
|
54
|
+
},
|
|
55
|
+
[s, t]
|
|
56
|
+
);
|
|
57
|
+
return f(() => ({ write: e, clear: o }), [e, o]);
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
v as parseStagedAnswer,
|
|
61
|
+
i as stagedKeys,
|
|
62
|
+
h as useStagedDraft,
|
|
63
|
+
S as useStagedWriter
|
|
64
|
+
};
|