@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.
Files changed (150) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +339 -2
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +4 -0
  6. package/dist/shared/components/BackgroundRunOffer.js +117 -0
  7. package/dist/shared/components/BroadcastView.js +214 -213
  8. package/dist/shared/components/CollectionBrowserView.js +2592 -2695
  9. package/dist/shared/components/ItemEditForm.js +4066 -3832
  10. package/dist/shared/components/JobsTray.js +100 -55
  11. package/dist/shared/components/MyWorkView.js +91 -89
  12. package/dist/shared/components/NotificationBell.js +80 -79
  13. package/dist/shared/components/ProfileView.js +568 -520
  14. package/dist/shared/components/RecordCompare.js +254 -0
  15. package/dist/shared/components/RecordReadView.js +599 -552
  16. package/dist/shared/components/ReportView.js +578 -543
  17. package/dist/shared/components/RowPresence.js +91 -0
  18. package/dist/shared/components/WidgetSlot.js +474 -458
  19. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  20. package/dist/shared/components/ai/AskPanel.js +139 -119
  21. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  22. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  23. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  24. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  25. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  26. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  27. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  28. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  29. package/dist/shared/components/chat/Composer.js +357 -303
  30. package/dist/shared/components/chat/MessageActions.js +92 -0
  31. package/dist/shared/components/chat/MessageFormat.js +290 -264
  32. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  33. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  34. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  35. package/dist/shared/components/chat/RoomParts.js +213 -274
  36. package/dist/shared/components/chat/ScreenClip.js +184 -0
  37. package/dist/shared/components/chat/chat-core.js +402 -483
  38. package/dist/shared/components/chat/chat-drafts.js +59 -0
  39. package/dist/shared/components/chat/chat-emoji.js +348 -0
  40. package/dist/shared/components/chat/chat-local-time.js +41 -0
  41. package/dist/shared/components/chat/chat-outbox.js +303 -0
  42. package/dist/shared/components/chat/chat-window.js +163 -0
  43. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  44. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  45. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  46. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  47. package/dist/shared/components/help-videos/api.js +76 -73
  48. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  49. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  50. package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
  51. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  52. package/dist/shared/components/item-edit/FieldRow.js +292 -279
  53. package/dist/shared/components/item-edit/GroupSection.js +698 -574
  54. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  55. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  56. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  57. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  58. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  59. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  60. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  61. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  62. package/dist/shared/components/item-edit/lock-why.js +39 -32
  63. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  64. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  65. package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
  66. package/dist/shared/components/layout-editor/AddPanel.js +134 -117
  67. package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
  68. package/dist/shared/components/layout-editor/CollabParts.js +80 -75
  69. package/dist/shared/components/layout-editor/DesignNode.js +126 -120
  70. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
  71. package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
  72. package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
  73. package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
  74. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  75. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  76. package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
  77. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
  78. package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
  79. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
  80. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  81. package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
  82. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  83. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  84. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  85. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  86. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  87. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  88. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  89. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
  90. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
  91. package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
  92. package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
  93. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  94. package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
  95. package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
  96. package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
  97. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  98. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  99. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  100. package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
  101. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  102. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  103. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  104. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  105. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  106. package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
  107. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  108. package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
  109. package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
  110. package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
  111. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  112. package/dist/shared/components/layout-editor/structure-ops.js +81 -77
  113. package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
  114. package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
  115. package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
  116. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  117. package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
  118. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  119. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  120. package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
  121. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  122. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  123. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  124. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  125. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  126. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  127. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  128. package/dist/shared/components/support/SupportView.js +75 -73
  129. package/dist/shared/lib/background-runs.js +150 -0
  130. package/dist/shared/lib/delivery-ack.js +9 -0
  131. package/dist/shared/lib/entry-badge-style.js +13 -0
  132. package/dist/shared/lib/entry-config.js +71 -0
  133. package/dist/shared/lib/form-sections.js +64 -0
  134. package/dist/shared/lib/form-structure.js +99 -0
  135. package/dist/shared/lib/form-usage-beacon.js +101 -52
  136. package/dist/shared/lib/jobs-tray.js +25 -23
  137. package/dist/shared/lib/keyset-pager.js +37 -0
  138. package/dist/shared/lib/layout-ops.js +84 -82
  139. package/dist/shared/lib/layout-resolve.js +113 -0
  140. package/dist/shared/lib/placement-behaviour.js +144 -0
  141. package/dist/shared/lib/prefetch.js +149 -0
  142. package/dist/shared/lib/presence-hooks.js +199 -0
  143. package/dist/shared/lib/record-outbox.js +82 -81
  144. package/dist/shared/lib/replay-socket.js +93 -0
  145. package/dist/shared/lib/request-gate.js +51 -50
  146. package/dist/shared/lib/room-gaps.js +96 -0
  147. package/dist/shared/lib/search-log.js +27 -0
  148. package/dist/shared/lib/socket-realtime.js +101 -80
  149. package/dist/shared/lib/worker-socket.js +200 -0
  150. 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 z } from "../editors/RecordConditionsEditor.js";
4
- import { RolesPicker as F } from "../editors/RolesPicker.js";
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 P } from "../overview/overview-api.js";
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 K, useCollectionLayoutList as M } from "./settings-api.js";
13
- import { layoutKindOf as U } from "./settings-registry.js";
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 $ } from "./ToggleSetting.js";
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
- }, B = (t) => t.toLowerCase().replace(/[^a-z0-9_]/g, "_"), v = (t) => t.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "");
20
- function E(t) {
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 ce(t) {
32
- const { layout: e, collection: o } = t, { fields: c, columns: l, relations: i } = K(o), { data: m = [] } = P(!0), f = E(e.conditions);
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(J, { ...t }),
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
- z,
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
- F,
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: B,
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(G, { layoutId: Number(e.id) })
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($, { k: "layout.create_hidden", props: t })
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 G({ layoutId: t }) {
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 J(t) {
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 = M(t.collection).find(
139
- (r) => r.id !== Number(e.id) && U(r) === o && C(r.is_active)
140
- ), N = o === "grouped" ? "form" : `${g(o).toLowerCase()} layout`, R = () => {
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
- }, A = 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: [
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: R,
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: A, children: [
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
- ce as WhoSection,
248
- B as sanitizeSlug
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"], r = ["grouped"], c = [
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: r
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: r
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 s = e == null ? void 0 : e.layout_type;
444
- return s === "table" || s === "file" || s === "addendum" || s === "detail" || s === "summary" ? s : "grouped";
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, s) {
447
- const a = s.toLowerCase().split(/\s+/).filter(Boolean);
448
- if (a.length === 0) return !0;
449
- const i = `${e.label} ${e.effect} ${e.key} ${e.keywords ?? ""}`.toLowerCase();
450
- return a.every((n) => i.includes(n));
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, s = "") {
453
- const a = [];
454
- for (const i of y) {
455
- const n = c.filter(
456
- (d) => d.section === i.id && d.types.includes(e) && u(d, s)
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
- n.length && a.push({ section: i, settings: n });
555
+ r.length && i.push({ section: n, settings: r });
459
556
  }
460
- return a;
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
+ };