@nivaro/react 0.3.40 → 0.3.42

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 (99) hide show
  1. package/dist/components/LayoutForm.js +100 -98
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +645 -16
  5. package/dist/index.js +814 -775
  6. package/dist/shared/components/ActivityEntry.js +154 -0
  7. package/dist/shared/components/AudienceConfirmPanel.js +98 -0
  8. package/dist/shared/components/BackgroundRunOffer.js +43 -31
  9. package/dist/shared/components/BroadcastView.js +225 -204
  10. package/dist/shared/components/CollectionBrowserView.js +3924 -3584
  11. package/dist/shared/components/ConfigHistory.js +153 -0
  12. package/dist/shared/components/ConfigReadBack.js +65 -0
  13. package/dist/shared/components/DataTable.js +379 -346
  14. package/dist/shared/components/ForceReloadBanner.js +47 -40
  15. package/dist/shared/components/IdleReloadWatcher.js +69 -0
  16. package/dist/shared/components/ItemEditForm.js +4041 -3853
  17. package/dist/shared/components/MyWorkView.js +278 -213
  18. package/dist/shared/components/NotificationBell.js +130 -121
  19. package/dist/shared/components/PickerExcludedRows.js +3 -3
  20. package/dist/shared/components/ProfileView.js +776 -1003
  21. package/dist/shared/components/RecentRecordsRail.js +34 -16
  22. package/dist/shared/components/RecordReadView.js +500 -477
  23. package/dist/shared/components/Skeletons.js +199 -0
  24. package/dist/shared/components/SlowNotice.js +63 -0
  25. package/dist/shared/components/Term.js +23 -0
  26. package/dist/shared/components/WidgetSlot.js +350 -353
  27. package/dist/shared/components/access/PermissionSummary.js +106 -0
  28. package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
  29. package/dist/shared/components/chat/ChatPanel.js +902 -886
  30. package/dist/shared/components/chat/MemberPaging.js +70 -0
  31. package/dist/shared/components/chat/RoomParts.js +147 -117
  32. package/dist/shared/components/chat/ScreenClip.js +73 -69
  33. package/dist/shared/components/chat/chat-core.js +449 -396
  34. package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
  35. package/dist/shared/components/help-videos/api.js +2 -5
  36. package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
  37. package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
  38. package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
  39. package/dist/shared/components/imports/RunDetailSheet.js +222 -227
  40. package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
  41. package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
  42. package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
  43. package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
  44. package/dist/shared/components/item-edit/FieldComments.js +212 -0
  45. package/dist/shared/components/item-edit/FieldRow.js +340 -336
  46. package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
  47. package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
  48. package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
  49. package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
  50. package/dist/shared/components/item-edit/field-comments-context.js +6 -0
  51. package/dist/shared/components/item-edit/field-sources.js +33 -0
  52. package/dist/shared/components/item-edit/rule-hidden.js +30 -0
  53. package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
  54. package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
  55. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
  56. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
  57. package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
  58. package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
  59. package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
  60. package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
  61. package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
  62. package/dist/shared/components/list/CopyListLinkButton.js +41 -0
  63. package/dist/shared/components/list/InlineEdit.js +363 -0
  64. package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
  65. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
  66. package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
  67. package/dist/shared/components/notifications/TestMyRules.js +137 -0
  68. package/dist/shared/components/notifications/changes-lines.js +24 -0
  69. package/dist/shared/components/notifications/why-lines.js +64 -0
  70. package/dist/shared/components/panels/CommentPanel.js +316 -281
  71. package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
  72. package/dist/shared/components/panels/PipelinePanel.js +201 -196
  73. package/dist/shared/components/panels/RevisionsPanel.js +496 -479
  74. package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
  75. package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
  76. package/dist/shared/components/profile/PersonDidPanel.js +188 -0
  77. package/dist/shared/components/profile/PersonProfile.js +57 -52
  78. package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
  79. package/dist/shared/hooks/useSlowReason.js +39 -0
  80. package/dist/shared/lib/activity-sentence.js +670 -0
  81. package/dist/shared/lib/config-sentences.js +418 -0
  82. package/dist/shared/lib/core-glossary.js +229 -0
  83. package/dist/shared/lib/error-hints.js +159 -0
  84. package/dist/shared/lib/error-message.js +105 -0
  85. package/dist/shared/lib/error-toast.js +22 -0
  86. package/dist/shared/lib/field-comments.js +25 -0
  87. package/dist/shared/lib/filter-sentence.js +261 -0
  88. package/dist/shared/lib/glossary.js +55 -48
  89. package/dist/shared/lib/idle-reload.js +138 -0
  90. package/dist/shared/lib/layout-resolve.js +42 -29
  91. package/dist/shared/lib/list-inline-edit.js +190 -0
  92. package/dist/shared/lib/list-link.js +147 -0
  93. package/dist/shared/lib/prefetch.js +259 -106
  94. package/dist/shared/lib/record-ref.js +72 -0
  95. package/dist/shared/lib/reload-holds.js +25 -0
  96. package/dist/shared/lib/safe-error.js +52 -24
  97. package/dist/shared/lib/skeleton-shapes.js +72 -0
  98. package/dist/shared/lib/slow-reason.js +63 -0
  99. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
- import { jsxs as s, jsx as t, Fragment as I } from "react/jsx-runtime";
2
- import { useState as U, useEffect as ae } from "react";
3
- import { readGroupStructure as ne } from "../../../lib/form-structure.js";
4
- import { lazySectionsOf as oe, lazySectionPatch as ie } from "../../../lib/layout-resolve.js";
1
+ import { jsxs as s, jsx as l, Fragment as I } from "react/jsx-runtime";
2
+ import { useState as B, useEffect as ne } from "react";
3
+ import { readGroupStructure as oe } from "../../../lib/form-structure.js";
4
+ import { lazySectionsOf as ie, quietHiddenSectionsOf as se, lazySectionPatch as re, quietHiddenSectionPatch as de } from "../../../lib/layout-resolve.js";
5
5
  import { titleCase as W } from "../../../lib/utils.js";
6
- import { RuleWriter as se } from "../ai-rules/RuleWriter.js";
7
- import { RoleConditionRow as q } from "../editors/lock-conditions.js";
8
- import { O2MAggFieldCombobox as re } from "../editors/o2m-agg-field.js";
9
- import { SwapConfigEditor as de } from "../editors/swap-config.js";
10
- import { IconPicker as ce } from "../pickers/icon-picker.js";
11
- import { SectionReuseActions as he } from "../reuse/SectionReuseActions.js";
12
- import { emptyTextOp as pe, stickyPlan as fe, rowUpdatePlan as X } from "../section-structure.js";
13
- import { useCollectionMeta as me } from "./field-context.js";
14
- import { useInspectorEnv as ue, Setting as d, TextInput as S, Choice as F, Segmented as g, Toggle as k, TextArea as Y, Section as $, FieldMultiPicker as be, ConditionBuilder as ye } from "./kit.js";
15
- import { groupFields as ge, asArray as v, describeField as Z, relKindOf as ke, relatedCollectionOf as ve } from "./model.js";
16
- import { GroupTranslations as _e } from "./Translations.js";
6
+ import { RuleWriter as ce } from "../ai-rules/RuleWriter.js";
7
+ import { RoleConditionRow as U } from "../editors/lock-conditions.js";
8
+ import { O2MAggFieldCombobox as he } from "../editors/o2m-agg-field.js";
9
+ import { SwapConfigEditor as pe } from "../editors/swap-config.js";
10
+ import { IconPicker as fe } from "../pickers/icon-picker.js";
11
+ import { SectionReuseActions as ue } from "../reuse/SectionReuseActions.js";
12
+ import { emptyTextOp as me, stickyPlan as be, rowUpdatePlan as X } from "../section-structure.js";
13
+ import { useCollectionMeta as ye } from "./field-context.js";
14
+ import { useInspectorEnv as ge, Setting as d, TextInput as N, Choice as P, Segmented as k, Toggle as y, TextArea as Y, Section as $, FieldMultiPicker as ke, ConditionBuilder as we } from "./kit.js";
15
+ import { groupFields as _e, asArray as w, describeField as Z, relKindOf as ve, relatedCollectionOf as xe } from "./model.js";
16
+ import { GroupTranslations as Ce } from "./Translations.js";
17
17
  const T = {
18
18
  section: "Section",
19
19
  tab: "Tab or step",
@@ -21,52 +21,52 @@ const T = {
21
21
  container: "Tabs or steps holder",
22
22
  content: "Text block"
23
23
  };
24
- function we(l) {
25
- return typeof l == "string" ? { field: l } : l && typeof l == "object" && typeof l.field == "string" ? l : null;
24
+ function Se(t) {
25
+ return typeof t == "string" ? { field: t } : t && typeof t == "object" && typeof t.field == "string" ? t : null;
26
26
  }
27
- function xe(l) {
28
- const { field: m, label: o, agg: p, agg_field: u, field_options: f } = l;
29
- return !o && !p ? m : {
30
- field: m,
27
+ function Ne(t) {
28
+ const { field: u, label: o, agg: p, agg_field: m, field_options: f } = t;
29
+ return !o && !p ? u : {
30
+ field: u,
31
31
  ...o ? { label: o } : {},
32
- ...p ? { agg: p, agg_field: u, ...f ? { field_options: f } : {} } : {}
32
+ ...p ? { agg: p, agg_field: m, ...f ? { field_options: f } : {} } : {}
33
33
  };
34
34
  }
35
- const _ = (l) => l.length ? JSON.stringify(l) : null;
36
- function je({ group: l, readOnly: m }) {
37
- var B, H;
38
- const o = ue(), { data: p } = me(o.collection), u = (p == null ? void 0 : p.fields) ?? [], f = (p == null ? void 0 : p.relations) ?? [], n = l.label || W(l.key), i = l.type, r = (e, a, c) => o.apply([{ op: "group_update", key: l.key, patch: e }], { label: a, text: c }), L = o.bundle.groups.filter((e) => e.parent_key === l.key), Q = o.bundle.groups.filter((e) => e.type === "container" && e.key !== l.key), P = o.bundle.placements.some((e) => e.group_key === l.key), V = (l.parent_key ? ["tab"] : Object.keys(T)).filter((e) => e === i || !(P && (e === "container" || e === "content"))).map((e) => ({ value: e, label: T[e] })), w = i === "section" || i === "metadata" || i === "tab", R = oe(o.bundle.layout.conditions).includes(l.key), M = !!o.bundle.layout.accordion_mode, x = ne(l.swap_config), D = u.filter((e) => !e.field.startsWith("__") && e.type !== "alias").map((e) => ({ value: e.field, label: e.label || W(e.field) })).sort((e, a) => e.label.localeCompare(a.label)), j = ge(o.bundle, l.key), b = v(l.summary_fields).map(we).filter((e) => !!e), G = (e, a, c) => r({ summary_fields: _(e.map(xe)) }, a, c), J = v(l.visible_when), C = JSON.stringify(J), [ee, K] = U(J);
39
- ae(() => {
40
- K(
35
+ const _ = (t) => t.length ? JSON.stringify(t) : null;
36
+ function Je({ group: t, readOnly: u }) {
37
+ var K, z;
38
+ const o = ge(), { data: p } = ye(o.collection), m = (p == null ? void 0 : p.fields) ?? [], f = (p == null ? void 0 : p.relations) ?? [], n = t.label || W(t.key), i = t.type, r = (e, a, c) => o.apply([{ op: "group_update", key: t.key, patch: e }], { label: a, text: c }), L = o.bundle.groups.filter((e) => e.parent_key === t.key), Q = o.bundle.groups.filter((e) => e.type === "container" && e.key !== t.key), F = o.bundle.placements.some((e) => e.group_key === t.key), V = (t.parent_key ? ["tab"] : Object.keys(T)).filter((e) => e === i || !(F && (e === "container" || e === "content"))).map((e) => ({ value: e, label: T[e] })), v = i === "section" || i === "metadata" || i === "tab", R = ie(o.bundle.layout.conditions).includes(t.key), ee = !se(o.bundle.layout.conditions).includes(t.key), M = !!o.bundle.layout.accordion_mode, x = oe(t.swap_config), D = m.filter((e) => !e.field.startsWith("__") && e.type !== "alias").map((e) => ({ value: e.field, label: e.label || W(e.field) })).sort((e, a) => e.label.localeCompare(a.label)), j = _e(o.bundle, t.key), b = w(t.summary_fields).map(Se).filter((e) => !!e), H = (e, a, c) => r({ summary_fields: _(e.map(Ne)) }, a, c), G = w(t.visible_when), C = JSON.stringify(G), [te, J] = B(G);
39
+ ne(() => {
40
+ J(
41
41
  (e) => JSON.stringify(e.filter((a) => a.field)) === C ? e : JSON.parse(C)
42
42
  );
43
43
  }, [C]);
44
- const [te, z] = U(!1);
45
- return /* @__PURE__ */ s("fieldset", { disabled: m, className: "min-w-0 space-y-5", children: [
46
- /* @__PURE__ */ t(d, { k: "group.label", label: "Name", effect: "The heading people see.", children: /* @__PURE__ */ t(
47
- S,
44
+ const [le, q] = B(!1);
45
+ return /* @__PURE__ */ s("fieldset", { disabled: u, className: "min-w-0 space-y-5", children: [
46
+ /* @__PURE__ */ l(d, { k: "group.label", label: "Name", effect: "The heading people see.", children: /* @__PURE__ */ l(
47
+ N,
48
48
  {
49
49
  ariaLabel: "Name",
50
- value: l.label,
50
+ value: t.label,
51
51
  onChange: (e) => r({ label: e }, `Rename ${n}`, !0)
52
52
  }
53
53
  ) }),
54
- /* @__PURE__ */ t(d, { k: "group.icon", label: "Icon", effect: "Shown before the section title.", children: /* @__PURE__ */ t(
55
- ce,
54
+ /* @__PURE__ */ l(d, { k: "group.icon", label: "Icon", effect: "Shown before the section title.", children: /* @__PURE__ */ l(
55
+ fe,
56
56
  {
57
57
  className: "h-8 rounded-md border-slate-200 bg-white px-2.5 text-[13px] hover:bg-white dark:border-border dark:bg-background dark:hover:bg-background",
58
- value: l.icon ?? "",
58
+ value: t.icon ?? "",
59
59
  onChange: (e) => r({ icon: e || null }, `Change the icon of ${n}`)
60
60
  }
61
61
  ) }),
62
- /* @__PURE__ */ t(
62
+ /* @__PURE__ */ l(
63
63
  d,
64
64
  {
65
65
  k: "group.type",
66
66
  label: "Kind",
67
- effect: i === "container" && L.length ? "Move its tabs out before changing what this is." : P && !l.parent_key ? "What this part of the form is. To make it a tabs holder or a text block, move its fields out first." : "What this part of the form is.",
68
- children: /* @__PURE__ */ t(
69
- F,
67
+ effect: i === "container" && L.length ? "Move its tabs out before changing what this is." : F && !t.parent_key ? "What this part of the form is. To make it a tabs holder or a text block, move its fields out first." : "What this part of the form is.",
68
+ children: /* @__PURE__ */ l(
69
+ P,
70
70
  {
71
71
  ariaLabel: "Kind",
72
72
  disabled: i === "container" && L.length > 0,
@@ -75,7 +75,7 @@ function je({ group: l, readOnly: m }) {
75
75
  onChange: (e) => {
76
76
  var a;
77
77
  return r(
78
- e === "container" ? { type: e, tab_mode: l.tab_mode ?? "tabs" } : { type: e },
78
+ e === "container" ? { type: e, tab_mode: t.tab_mode ?? "tabs" } : { type: e },
79
79
  `Make ${n} a ${(a = T[e]) == null ? void 0 : a.toLowerCase()}`
80
80
  );
81
81
  }
@@ -83,16 +83,16 @@ function je({ group: l, readOnly: m }) {
83
83
  )
84
84
  }
85
85
  ),
86
- i === "container" && /* @__PURE__ */ t(
86
+ i === "container" && /* @__PURE__ */ l(
87
87
  d,
88
88
  {
89
89
  k: "group.tab_mode",
90
90
  label: "Show its tabs as",
91
91
  effect: "Steps walk people through in order.",
92
- children: /* @__PURE__ */ t(
93
- g,
92
+ children: /* @__PURE__ */ l(
93
+ k,
94
94
  {
95
- value: l.tab_mode === "steps" ? "steps" : "tabs",
95
+ value: t.tab_mode === "steps" ? "steps" : "tabs",
96
96
  options: [
97
97
  { value: "tabs", label: "Tabs" },
98
98
  { value: "steps", label: "Steps" }
@@ -102,17 +102,17 @@ function je({ group: l, readOnly: m }) {
102
102
  )
103
103
  }
104
104
  ),
105
- i === "tab" && /* @__PURE__ */ t(
105
+ i === "tab" && /* @__PURE__ */ l(
106
106
  d,
107
107
  {
108
108
  k: "group.container_id",
109
109
  label: "Sits in",
110
110
  effect: "Tabs show inside a tabs or steps holder.",
111
- children: /* @__PURE__ */ t(
112
- F,
111
+ children: /* @__PURE__ */ l(
112
+ P,
113
113
  {
114
114
  ariaLabel: "Sits in",
115
- value: l.parent_key ?? "",
115
+ value: t.parent_key ?? "",
116
116
  options: [
117
117
  { value: "", label: "The form itself" },
118
118
  ...Q.map((e) => ({ value: e.key, label: e.label || W(e.key) }))
@@ -121,7 +121,7 @@ function je({ group: l, readOnly: m }) {
121
121
  [
122
122
  {
123
123
  op: "group_move",
124
- key: l.key,
124
+ key: t.key,
125
125
  parent_key: e || null,
126
126
  index: Number.MAX_SAFE_INTEGER
127
127
  }
@@ -132,29 +132,29 @@ function je({ group: l, readOnly: m }) {
132
132
  )
133
133
  }
134
134
  ),
135
- (i === "section" || i === "metadata") && /* @__PURE__ */ t(
136
- k,
135
+ (i === "section" || i === "metadata") && /* @__PURE__ */ l(
136
+ y,
137
137
  {
138
138
  k: "group.is_collapsed",
139
139
  label: "Starts collapsed",
140
140
  effect: "The section opens folded; people unfold it.",
141
- checked: l.is_collapsed,
141
+ checked: t.is_collapsed,
142
142
  onChange: (e) => r({ is_collapsed: e }, e ? `Collapse ${n}` : `Expand ${n}`)
143
143
  }
144
144
  ),
145
- (i === "section" || i === "metadata") && /* @__PURE__ */ t(
146
- k,
145
+ (i === "section" || i === "metadata") && /* @__PURE__ */ l(
146
+ y,
147
147
  {
148
148
  k: "group.load_on_open",
149
149
  label: "Load when opened",
150
- effect: l.is_collapsed || M ? "Its pickers, grids and widgets load only once someone opens it; a lighter open for every record." : "Turn on Starts collapsed first: an open section loads straight away.",
150
+ effect: t.is_collapsed || M ? "Its pickers, grids and widgets load only once someone opens it; a lighter open for every record." : "Turn on Starts collapsed first: an open section loads straight away.",
151
151
  checked: R,
152
- disabled: !R && !l.is_collapsed && !M,
152
+ disabled: !R && !t.is_collapsed && !M,
153
153
  onChange: (e) => o.apply(
154
154
  [
155
155
  {
156
156
  op: "layout_update",
157
- patch: ie(o.bundle.layout.conditions, l.key, e)
157
+ patch: re(o.bundle.layout.conditions, t.key, e)
158
158
  }
159
159
  ],
160
160
  { label: e ? `Load ${n} when opened` : `Load ${n} with the form` }
@@ -162,16 +162,16 @@ function je({ group: l, readOnly: m }) {
162
162
  }
163
163
  ),
164
164
  i === "content" && /* @__PURE__ */ s(I, { children: [
165
- /* @__PURE__ */ t(
165
+ /* @__PURE__ */ l(
166
166
  d,
167
167
  {
168
168
  k: "group.content_tone",
169
169
  label: "Style",
170
170
  effect: "Note and Warning are coloured boxes; Divider is a line with the text.",
171
- children: /* @__PURE__ */ t(
172
- g,
171
+ children: /* @__PURE__ */ l(
172
+ k,
173
173
  {
174
- value: l.content_tone ?? "info",
174
+ value: t.content_tone ?? "info",
175
175
  options: [
176
176
  { value: "info", label: "Note" },
177
177
  { value: "warn", label: "Warning" },
@@ -182,42 +182,42 @@ function je({ group: l, readOnly: m }) {
182
182
  )
183
183
  }
184
184
  ),
185
- /* @__PURE__ */ t(d, { k: "group.content", label: "Text", effect: "The words this block shows on the form.", children: /* @__PURE__ */ t(
185
+ /* @__PURE__ */ l(d, { k: "group.content", label: "Text", effect: "The words this block shows on the form.", children: /* @__PURE__ */ l(
186
186
  Y,
187
187
  {
188
188
  ariaLabel: "Text",
189
- value: l.content ?? "",
189
+ value: t.content ?? "",
190
190
  onChange: (e) => r({ content: e || null }, `Edit the text of ${n}`, !0)
191
191
  }
192
192
  ) })
193
193
  ] }),
194
194
  (i === "section" || i === "tab") && /* @__PURE__ */ s(I, { children: [
195
- /* @__PURE__ */ t(
195
+ /* @__PURE__ */ l(
196
196
  d,
197
197
  {
198
198
  k: "group.content",
199
199
  label: "Intro",
200
200
  effect: "A short note at the top: what to fill in here and why. Empty shows none.",
201
- children: /* @__PURE__ */ t(
201
+ children: /* @__PURE__ */ l(
202
202
  Y,
203
203
  {
204
204
  ariaLabel: "Intro",
205
- value: l.content ?? "",
205
+ value: t.content ?? "",
206
206
  onChange: (e) => r({ content: e || null }, `Edit the intro of ${n}`, !0)
207
207
  }
208
208
  )
209
209
  }
210
210
  ),
211
- !!((B = l.content) != null && B.trim()) && /* @__PURE__ */ t(
211
+ !!((K = t.content) != null && K.trim()) && /* @__PURE__ */ l(
212
212
  d,
213
213
  {
214
214
  k: "group.content_tone",
215
215
  label: "Intro style",
216
216
  effect: "Note is a quiet box; Warning is amber.",
217
- children: /* @__PURE__ */ t(
218
- g,
217
+ children: /* @__PURE__ */ l(
218
+ k,
219
219
  {
220
- value: l.content_tone === "warn" ? "warn" : "info",
220
+ value: t.content_tone === "warn" ? "warn" : "info",
221
221
  options: [
222
222
  { value: "info", label: "Note" },
223
223
  { value: "warn", label: "Warning" }
@@ -228,17 +228,17 @@ function je({ group: l, readOnly: m }) {
228
228
  }
229
229
  )
230
230
  ] }),
231
- w && /* @__PURE__ */ s(I, { children: [
232
- /* @__PURE__ */ t(
231
+ v && /* @__PURE__ */ s(I, { children: [
232
+ /* @__PURE__ */ l(
233
233
  d,
234
234
  {
235
235
  k: "group.visibility_mode",
236
236
  label: "Show",
237
237
  effect: "On new records, existing ones or both.",
238
- children: /* @__PURE__ */ t(
239
- g,
238
+ children: /* @__PURE__ */ l(
239
+ k,
240
240
  {
241
- value: l.visibility_mode ?? "always",
241
+ value: t.visibility_mode ?? "always",
242
242
  options: [
243
243
  { value: "always", label: "Always" },
244
244
  { value: "new_only", label: "New records" },
@@ -249,26 +249,26 @@ function je({ group: l, readOnly: m }) {
249
249
  )
250
250
  }
251
251
  ),
252
- /* @__PURE__ */ t(
253
- k,
252
+ /* @__PURE__ */ l(
253
+ y,
254
254
  {
255
255
  k: "group.hide_when_empty",
256
256
  label: "Hide when all its fields are empty",
257
257
  effect: "The section disappears while none of its fields has a value.",
258
- checked: l.hide_when_empty,
258
+ checked: t.hide_when_empty,
259
259
  onChange: (e) => r({ hide_when_empty: e }, `Change when ${n} hides`)
260
260
  }
261
261
  ),
262
- /* @__PURE__ */ t(
262
+ /* @__PURE__ */ l(
263
263
  d,
264
264
  {
265
265
  k: "group.read_width",
266
266
  label: "Width when reading",
267
267
  effect: "On the read view, summary and detail panels. Automatic: half for a short list, full for grids.",
268
- children: /* @__PURE__ */ t(
269
- g,
268
+ children: /* @__PURE__ */ l(
269
+ k,
270
270
  {
271
- value: l.read_width ?? "",
271
+ value: t.read_width ?? "",
272
272
  options: [
273
273
  { value: "", label: "Automatic" },
274
274
  { value: "full", label: "Full" },
@@ -280,19 +280,19 @@ function je({ group: l, readOnly: m }) {
280
280
  )
281
281
  }
282
282
  ),
283
- /* @__PURE__ */ t(
283
+ /* @__PURE__ */ l(
284
284
  d,
285
285
  {
286
286
  k: "group.empty_text",
287
287
  label: "When nothing is filled",
288
288
  effect: "Shown in the read view and the PDF instead of empty values, such as “No shipping details yet”. Empty: the values show as dashes.",
289
- children: /* @__PURE__ */ t(
290
- S,
289
+ children: /* @__PURE__ */ l(
290
+ N,
291
291
  {
292
292
  ariaLabel: "When nothing is filled",
293
293
  value: x.emptyText ?? "",
294
294
  placeholder: "No details yet",
295
- onChange: (e) => o.apply([pe(l, e)], {
295
+ onChange: (e) => o.apply([me(t, e)], {
296
296
  label: `Change the empty text of ${n}`,
297
297
  text: !0
298
298
  })
@@ -300,45 +300,45 @@ function je({ group: l, readOnly: m }) {
300
300
  )
301
301
  }
302
302
  ),
303
- i === "section" && !l.parent_key && /* @__PURE__ */ t(
304
- k,
303
+ i === "section" && !t.parent_key && /* @__PURE__ */ l(
304
+ y,
305
305
  {
306
306
  k: "group.sticky",
307
307
  label: "Stick to the top",
308
308
  effect: "Stays at the top of the form while people scroll the rest, for totals or status. One section per form; not on phones.",
309
309
  checked: x.sticky,
310
310
  onChange: (e) => {
311
- const a = fe(o.bundle, l.key, e);
311
+ const a = be(o.bundle, t.key, e);
312
312
  a.ok && o.apply(a.ops, { label: a.label });
313
313
  }
314
314
  }
315
315
  )
316
316
  ] }),
317
- (i === "section" || i === "tab") && /* @__PURE__ */ t($, { title: "Side by side", children: /* @__PURE__ */ t(
317
+ (i === "section" || i === "tab") && /* @__PURE__ */ l($, { title: "Side by side", children: /* @__PURE__ */ l(
318
318
  d,
319
319
  {
320
320
  k: "group.row_groups",
321
321
  label: "Rows of fields",
322
322
  effect: "Short fields that share one row under one label, like Street / City / Zip. To add one, select the fields on the form, right-click and pick Put side by side.",
323
- children: x.rows.length === 0 ? /* @__PURE__ */ t("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "No rows yet." }) : /* @__PURE__ */ t("div", { className: "space-y-2", children: x.rows.map((e) => /* @__PURE__ */ s("div", { className: "space-y-1", "data-row-group-setting": e.key, children: [
323
+ children: x.rows.length === 0 ? /* @__PURE__ */ l("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "No rows yet." }) : /* @__PURE__ */ l("div", { className: "space-y-2", children: x.rows.map((e) => /* @__PURE__ */ s("div", { className: "space-y-1", "data-row-group-setting": e.key, children: [
324
324
  /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5", children: [
325
- /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ t(
326
- S,
325
+ /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ l(
326
+ N,
327
327
  {
328
328
  ariaLabel: `Label of the row ${e.label}`,
329
329
  value: e.label,
330
330
  onChange: (a) => {
331
- const c = X(o.bundle, l.key, e.key, { label: a });
331
+ const c = X(o.bundle, t.key, e.key, { label: a });
332
332
  c.ok && o.apply(c.ops, { label: c.label, text: !0 });
333
333
  }
334
334
  }
335
335
  ) }),
336
- /* @__PURE__ */ t(
336
+ /* @__PURE__ */ l(
337
337
  "button",
338
338
  {
339
339
  type: "button",
340
340
  onClick: () => {
341
- const a = X(o.bundle, l.key, e.key, null);
341
+ const a = X(o.bundle, t.key, e.key, null);
342
342
  a.ok && o.apply(a.ops, { label: a.label });
343
343
  },
344
344
  className: "shrink-0 rounded-md px-2 py-1 text-[12px] text-slate-600 hover:bg-muted hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",
@@ -346,27 +346,27 @@ function je({ group: l, readOnly: m }) {
346
346
  }
347
347
  )
348
348
  ] }),
349
- /* @__PURE__ */ t("p", { className: "truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: e.fields.map((a) => {
349
+ /* @__PURE__ */ l("p", { className: "truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: e.fields.map((a) => {
350
350
  const c = o.bundle.placements.find(
351
- (N) => N.field === a && N.group_key === l.key
351
+ (S) => S.field === a && S.group_key === t.key
352
352
  ) ?? null;
353
- return Z(a, u, f, c).label;
353
+ return Z(a, m, f, c).label;
354
354
  }).join(" · ") })
355
355
  ] }, e.key)) })
356
356
  }
357
357
  ) }),
358
358
  i === "tab" && /* @__PURE__ */ s($, { title: "As a step", children: [
359
- /* @__PURE__ */ t(
359
+ /* @__PURE__ */ l(
360
360
  d,
361
361
  {
362
362
  k: "group.skip_if_filled",
363
363
  label: "Skip as the first step when filled",
364
364
  effect: "Opens on a later step when these fields already have values.",
365
- children: /* @__PURE__ */ t(
366
- be,
365
+ children: /* @__PURE__ */ l(
366
+ ke,
367
367
  {
368
368
  ariaLabel: "Skip as the first step when filled",
369
- value: v(l.skip_if_filled),
369
+ value: w(t.skip_if_filled),
370
370
  options: D,
371
371
  onChange: (e) => r({ skip_if_filled: _(e) }, `Change when ${n} is skipped`)
372
372
  }
@@ -380,65 +380,83 @@ function je({ group: l, readOnly: m }) {
380
380
  label: "Only when",
381
381
  effect: "The step shows only while every condition holds. No conditions: always.",
382
382
  children: [
383
- /* @__PURE__ */ t(
384
- ye,
383
+ /* @__PURE__ */ l(
384
+ we,
385
385
  {
386
- value: ee,
386
+ value: te,
387
387
  fields: D,
388
388
  onChange: (e) => {
389
- K(e);
389
+ J(e);
390
390
  const a = e.filter((c) => c.field);
391
391
  JSON.stringify(a) !== C && r({ visible_when: _(a) }, `Change when ${n} shows`, !0);
392
392
  }
393
393
  }
394
394
  ),
395
- /* @__PURE__ */ t(
396
- se,
395
+ /* @__PURE__ */ l(
396
+ ce,
397
397
  {
398
398
  layoutId: Number(o.bundle.layout.id),
399
- target: { kind: "step", group: l.key },
399
+ target: { kind: "step", group: t.key },
400
400
  bundle: o.bundle,
401
401
  apply: (e, a) => o.apply(e, a),
402
- disabled: m
402
+ disabled: u
403
403
  }
404
404
  )
405
405
  ]
406
406
  }
407
+ ),
408
+ /* @__PURE__ */ l(
409
+ y,
410
+ {
411
+ k: "group.rule_hint",
412
+ label: "Say why it is hidden",
413
+ effect: `While its conditions hide it, the form shows one quiet line ("${n} shows when …") with a read-only Show anyway. Off: it vanishes without a word.`,
414
+ checked: ee,
415
+ onChange: (e) => o.apply(
416
+ [
417
+ {
418
+ op: "layout_update",
419
+ patch: de(o.bundle.layout.conditions, t.key, e)
420
+ }
421
+ ],
422
+ { label: e ? `Say why ${n} is hidden` : `Hide ${n} without a word` }
423
+ )
424
+ }
407
425
  )
408
426
  ] }),
409
- w && /* @__PURE__ */ s($, { title: "Who", children: [
410
- /* @__PURE__ */ t(
427
+ v && /* @__PURE__ */ s($, { title: "Who", children: [
428
+ /* @__PURE__ */ l(
411
429
  d,
412
430
  {
413
431
  k: "group.hidden_for_roles",
414
432
  label: "Hidden for",
415
433
  effect: "People in these roles do not see it. Admins always do.",
416
- children: /* @__PURE__ */ t(
417
- q,
434
+ children: /* @__PURE__ */ l(
435
+ U,
418
436
  {
419
- roleIds: v(l.hidden_for_roles),
437
+ roleIds: w(t.hidden_for_roles),
420
438
  onRoleIdsChange: (e) => r({ hidden_for_roles: _(e) }, `Change who sees ${n}`)
421
439
  }
422
440
  )
423
441
  }
424
442
  ),
425
- /* @__PURE__ */ t(
443
+ /* @__PURE__ */ l(
426
444
  d,
427
445
  {
428
446
  k: "group.locked_for_roles",
429
447
  label: "Read-only for",
430
448
  effect: "People in these roles cannot change it; the server drops their writes. Admins are exempt.",
431
- children: /* @__PURE__ */ t(
432
- q,
449
+ children: /* @__PURE__ */ l(
450
+ U,
433
451
  {
434
- roleIds: v(l.locked_for_roles),
452
+ roleIds: w(t.locked_for_roles),
435
453
  onRoleIdsChange: (e) => r({ locked_for_roles: _(e) }, `Change who can edit ${n}`)
436
454
  }
437
455
  )
438
456
  }
439
457
  )
440
458
  ] }),
441
- w && /* @__PURE__ */ s($, { title: "When collapsed", children: [
459
+ v && /* @__PURE__ */ s($, { title: "When collapsed", children: [
442
460
  /* @__PURE__ */ s(
443
461
  d,
444
462
  {
@@ -450,32 +468,32 @@ function je({ group: l, readOnly: m }) {
450
468
  "Place fields in ",
451
469
  n,
452
470
  " first."
453
- ] }) : /* @__PURE__ */ t("div", { className: "space-y-1.5", children: j.map((e) => {
454
- const a = b.find((h) => h.field === e), c = ke(e, f) === "O2M", N = o.bundle.placements.find((h) => h.field === e) ?? null, O = Z(e, u, f, N).label, E = (h, y, le) => G(
471
+ ] }) : /* @__PURE__ */ l("div", { className: "space-y-1.5", children: j.map((e) => {
472
+ const a = b.find((h) => h.field === e), c = ve(e, f) === "O2M", S = o.bundle.placements.find((h) => h.field === e) ?? null, O = Z(e, m, f, S).label, E = (h, g, ae) => H(
455
473
  b.map((A) => A.field === e ? { ...A, ...h } : A),
456
- y,
457
- le
474
+ g,
475
+ ae
458
476
  );
459
477
  return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
460
478
  /* @__PURE__ */ s("label", { className: "flex items-center gap-2 text-[12px]", children: [
461
- /* @__PURE__ */ t(
479
+ /* @__PURE__ */ l(
462
480
  "input",
463
481
  {
464
482
  type: "checkbox",
465
483
  checked: !!a,
466
- onChange: (h) => G(
467
- h.target.checked ? [...b, c ? { field: e, agg: "count" } : { field: e }] : b.filter((y) => y.field !== e),
484
+ onChange: (h) => H(
485
+ h.target.checked ? [...b, c ? { field: e, agg: "count" } : { field: e }] : b.filter((g) => g.field !== e),
468
486
  `Change the summary of ${n}`
469
487
  ),
470
488
  className: "h-3.5 w-3.5 accent-nvr-cyan"
471
489
  }
472
490
  ),
473
- /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: O }),
474
- c && /* @__PURE__ */ t("span", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "list" })
491
+ /* @__PURE__ */ l("span", { className: "flex-1 truncate", children: O }),
492
+ c && /* @__PURE__ */ l("span", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "list" })
475
493
  ] }),
476
494
  a && /* @__PURE__ */ s("div", { className: "space-y-1 pl-5", children: [
477
- /* @__PURE__ */ t("div", { "data-setting": "group.summary_fields.label", children: /* @__PURE__ */ t(
478
- S,
495
+ /* @__PURE__ */ l("div", { "data-setting": "group.summary_fields.label", children: /* @__PURE__ */ l(
496
+ N,
479
497
  {
480
498
  ariaLabel: `Label for ${O}`,
481
499
  value: a.label ?? "",
@@ -488,8 +506,8 @@ function je({ group: l, readOnly: m }) {
488
506
  }
489
507
  ) }),
490
508
  c && /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
491
- /* @__PURE__ */ t("div", { className: "flex-1", "data-setting": "group.summary_fields.agg", children: /* @__PURE__ */ t(
492
- F,
509
+ /* @__PURE__ */ l("div", { className: "flex-1", "data-setting": "group.summary_fields.agg", children: /* @__PURE__ */ l(
510
+ P,
493
511
  {
494
512
  ariaLabel: "Show",
495
513
  value: a.agg ?? "count",
@@ -506,18 +524,18 @@ function je({ group: l, readOnly: m }) {
506
524
  )
507
525
  }
508
526
  ) }),
509
- (a.agg ?? "count") !== "count" && /* @__PURE__ */ t(
527
+ (a.agg ?? "count") !== "count" && /* @__PURE__ */ l(
510
528
  "div",
511
529
  {
512
530
  className: "flex-1",
513
531
  "data-setting": "group.summary_fields.agg_field",
514
- children: /* @__PURE__ */ t(
515
- re,
532
+ children: /* @__PURE__ */ l(
533
+ he,
516
534
  {
517
- relatedCollection: ve(e, f),
535
+ relatedCollection: xe(e, f),
518
536
  value: a.agg_field ?? "",
519
- onChange: (h, y) => E(
520
- { agg_field: h, field_options: y },
537
+ onChange: (h, g) => E(
538
+ { agg_field: h, field_options: g },
521
539
  `Change the summary of ${n}`
522
540
  )
523
541
  }
@@ -542,33 +560,33 @@ function je({ group: l, readOnly: m }) {
542
560
  ]
543
561
  }
544
562
  ),
545
- /* @__PURE__ */ t(
546
- k,
563
+ /* @__PURE__ */ l(
564
+ y,
547
565
  {
548
566
  k: "group.summary_hide_empty",
549
567
  label: "Leave out empty values",
550
568
  effect: "Fields without a value are left out of the summary line.",
551
- checked: l.summary_hide_empty,
569
+ checked: t.summary_hide_empty,
552
570
  onChange: (e) => r({ summary_hide_empty: e }, `Change the summary of ${n}`)
553
571
  }
554
572
  )
555
573
  ] }),
556
- w && /* @__PURE__ */ t(
557
- de,
574
+ v && /* @__PURE__ */ l(
575
+ pe,
558
576
  {
559
- group: { id: l.id ?? 0, swap_config: l.swap_config },
560
- allFields: u.map((e) => ({ field: e.field, type: e.type ?? void 0 })),
577
+ group: { id: t.id ?? 0, swap_config: t.swap_config },
578
+ allFields: m.map((e) => ({ field: e.field, type: e.type ?? void 0 })),
561
579
  onGroupSettings: (e, a) => r(a, `Change the field swap of ${n}`)
562
580
  }
563
581
  ),
564
- !m && /* @__PURE__ */ t(he, { bundle: o.bundle, collection: o.collection, group: l }),
565
- /* @__PURE__ */ t(_e, { group: l }),
566
- /* @__PURE__ */ t(
582
+ !u && /* @__PURE__ */ l(ue, { bundle: o.bundle, collection: o.collection, group: t }),
583
+ /* @__PURE__ */ l(Ce, { group: t }),
584
+ /* @__PURE__ */ l(
567
585
  "div",
568
586
  {
569
587
  "data-setting": "group.delete",
570
588
  className: "border-t border-slate-200 pt-3 dark:border-border",
571
- children: te ? /* @__PURE__ */ s("div", { className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[12px] text-red-900 dark:border-red-800/60 dark:bg-red-950/30 dark:text-red-100", children: [
589
+ children: le ? /* @__PURE__ */ s("div", { className: "space-y-2 rounded-md border border-red-200 bg-red-50 p-2.5 text-[12px] text-red-900 dark:border-red-800/60 dark:bg-red-950/30 dark:text-red-100", children: [
572
590
  /* @__PURE__ */ s("p", { children: [
573
591
  "Delete ",
574
592
  n,
@@ -577,22 +595,22 @@ function je({ group: l, readOnly: m }) {
577
595
  ". Undo brings it back."
578
596
  ] }),
579
597
  /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
580
- /* @__PURE__ */ t(
598
+ /* @__PURE__ */ l(
581
599
  "button",
582
600
  {
583
601
  type: "button",
584
- onClick: () => o.apply([{ op: "group_remove", key: l.key, placements: "ungroup" }], {
602
+ onClick: () => o.apply([{ op: "group_remove", key: t.key, placements: "ungroup" }], {
585
603
  label: `Delete ${n}`
586
604
  }),
587
605
  className: "rounded-md bg-red-600 px-2.5 py-1 text-[12px] font-medium text-white hover:bg-red-700",
588
606
  children: "Delete"
589
607
  }
590
608
  ),
591
- /* @__PURE__ */ t(
609
+ /* @__PURE__ */ l(
592
610
  "button",
593
611
  {
594
612
  type: "button",
595
- onClick: () => z(!1),
613
+ onClick: () => q(!1),
596
614
  className: "rounded-md px-2.5 py-1 text-[12px] hover:bg-red-100 dark:hover:bg-red-900/40",
597
615
  children: "Keep"
598
616
  }
@@ -602,11 +620,11 @@ function je({ group: l, readOnly: m }) {
602
620
  "button",
603
621
  {
604
622
  type: "button",
605
- onClick: () => z(!0),
623
+ onClick: () => q(!0),
606
624
  className: "text-[12px] text-red-600 hover:underline dark:text-red-400",
607
625
  children: [
608
626
  "Delete ",
609
- ((H = T[i]) == null ? void 0 : H.toLowerCase()) ?? "section"
627
+ ((z = T[i]) == null ? void 0 : z.toLowerCase()) ?? "section"
610
628
  ]
611
629
  }
612
630
  )
@@ -615,5 +633,5 @@ function je({ group: l, readOnly: m }) {
615
633
  ] });
616
634
  }
617
635
  export {
618
- je as GroupInspector
636
+ Je as GroupInspector
619
637
  };