@nivaro/react 0.2.53 → 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 (294) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +99 -98
  3. package/dist/index.d.ts +452 -4
  4. package/dist/index.js +644 -618
  5. package/dist/layout-editor.d.ts +252 -2
  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/FormWhatsNew.js +60 -0
  10. package/dist/shared/components/ItemEditForm.js +3968 -3618
  11. package/dist/shared/components/JobsTray.js +100 -55
  12. package/dist/shared/components/MyWorkView.js +91 -89
  13. package/dist/shared/components/NotificationBell.js +80 -79
  14. package/dist/shared/components/ProfileView.js +568 -520
  15. package/dist/shared/components/RecordCompare.js +254 -0
  16. package/dist/shared/components/RecordReadView.js +598 -543
  17. package/dist/shared/components/ReportView.js +578 -543
  18. package/dist/shared/components/RowPresence.js +91 -0
  19. package/dist/shared/components/TipLayer.js +27 -27
  20. package/dist/shared/components/WidgetSlot.js +474 -458
  21. package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
  22. package/dist/shared/components/ai/AskPanel.js +139 -119
  23. package/dist/shared/components/ai/FirstWeekCard.js +126 -0
  24. package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
  25. package/dist/shared/components/bulk/bulk-field-options.js +45 -0
  26. package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
  27. package/dist/shared/components/chat/ChannelArchive.js +326 -0
  28. package/dist/shared/components/chat/ChannelExtras.js +141 -121
  29. package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
  30. package/dist/shared/components/chat/ChatPanel.js +1695 -1733
  31. package/dist/shared/components/chat/Composer.js +357 -303
  32. package/dist/shared/components/chat/MessageActions.js +92 -0
  33. package/dist/shared/components/chat/MessageFormat.js +290 -264
  34. package/dist/shared/components/chat/OutboxBubbles.js +146 -0
  35. package/dist/shared/components/chat/RequestIdCard.js +135 -0
  36. package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
  37. package/dist/shared/components/chat/RoomParts.js +213 -274
  38. package/dist/shared/components/chat/ScreenClip.js +184 -0
  39. package/dist/shared/components/chat/chat-core.js +402 -483
  40. package/dist/shared/components/chat/chat-drafts.js +59 -0
  41. package/dist/shared/components/chat/chat-emoji.js +348 -0
  42. package/dist/shared/components/chat/chat-local-time.js +41 -0
  43. package/dist/shared/components/chat/chat-outbox.js +303 -0
  44. package/dist/shared/components/chat/chat-window.js +163 -0
  45. package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
  46. package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
  47. package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
  48. package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
  49. package/dist/shared/components/help-videos/api.js +80 -67
  50. package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
  51. package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
  52. package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
  53. package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
  54. package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
  55. package/dist/shared/components/item-edit/FieldRow.js +382 -320
  56. package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
  57. package/dist/shared/components/item-edit/GroupSection.js +786 -639
  58. package/dist/shared/components/item-edit/HeaderTools.js +59 -56
  59. package/dist/shared/components/item-edit/InlineTableField.js +3 -1
  60. package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
  61. package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
  62. package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
  63. package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
  64. package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
  65. package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
  66. package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
  67. package/dist/shared/components/item-edit/lazy-sections.js +36 -0
  68. package/dist/shared/components/item-edit/lock-why.js +94 -0
  69. package/dist/shared/components/item-edit/picker-miss.js +26 -0
  70. package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
  71. package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
  72. package/dist/shared/components/layout-editor/AddPanel.js +226 -151
  73. package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
  74. package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
  75. package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
  76. package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
  77. package/dist/shared/components/layout-editor/CollabParts.js +175 -0
  78. package/dist/shared/components/layout-editor/DesignNode.js +311 -116
  79. package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
  80. package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
  81. package/dist/shared/components/layout-editor/FindReplace.js +188 -0
  82. package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
  83. package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
  84. package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
  85. package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
  86. package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
  87. package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
  88. package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
  89. package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
  90. package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
  91. package/dist/shared/components/layout-editor/StagedChip.js +22 -0
  92. package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
  93. package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
  94. package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
  95. package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
  96. package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
  97. package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
  98. package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
  99. package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
  100. package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
  101. package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
  102. package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
  103. package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
  104. package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
  105. package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
  106. package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
  107. package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
  108. package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
  109. package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
  110. package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
  111. package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
  112. package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
  113. package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
  114. package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
  115. package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
  116. package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
  117. package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
  118. package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
  119. package/dist/shared/components/layout-editor/assist/jump.js +142 -0
  120. package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
  121. package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
  122. package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
  123. package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
  124. package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
  125. package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
  126. package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
  127. package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
  128. package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
  129. package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
  130. package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
  131. package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
  132. package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
  133. package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
  134. package/dist/shared/components/layout-editor/commands/intents.js +214 -0
  135. package/dist/shared/components/layout-editor/commands/parse.js +242 -0
  136. package/dist/shared/components/layout-editor/design-context.js +26 -6
  137. package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
  138. package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
  139. package/dist/shared/components/layout-editor/dnd/node.js +69 -57
  140. package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
  141. package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
  142. package/dist/shared/components/layout-editor/editor-notes.js +78 -0
  143. package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
  144. package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
  145. package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
  146. package/dist/shared/components/layout-editor/entry/presets.js +71 -0
  147. package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
  148. package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
  149. package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
  150. package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
  151. package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
  152. package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
  153. package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
  154. package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
  155. package/dist/shared/components/layout-editor/field-zones.js +116 -0
  156. package/dist/shared/components/layout-editor/form-map.js +138 -0
  157. package/dist/shared/components/layout-editor/grid-guides.js +142 -0
  158. package/dist/shared/components/layout-editor/history-api.js +87 -0
  159. package/dist/shared/components/layout-editor/inheritance.js +55 -0
  160. package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
  161. package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
  162. package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
  163. package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
  164. package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
  165. package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
  166. package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
  167. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
  168. package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
  169. package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
  170. package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
  171. package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
  172. package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
  173. package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
  174. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
  175. package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
  176. package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
  177. package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
  178. package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
  179. package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
  180. package/dist/shared/components/layout-editor/is-typing.js +9 -0
  181. package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
  182. package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
  183. package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
  184. package/dist/shared/components/layout-editor/load-error.js +37 -0
  185. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
  186. package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
  187. package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
  188. package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
  189. package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
  190. package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
  191. package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
  192. package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
  193. package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
  194. package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
  195. package/dist/shared/components/layout-editor/nav/find.js +20 -0
  196. package/dist/shared/components/layout-editor/nav/tree.js +142 -0
  197. package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
  198. package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
  199. package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
  200. package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
  201. package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
  202. package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
  203. package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
  204. package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
  205. package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
  206. package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
  207. package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
  208. package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
  209. package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
  210. package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
  211. package/dist/shared/components/layout-editor/panel-style.js +8 -7
  212. package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
  213. package/dist/shared/components/layout-editor/pin.js +25 -0
  214. package/dist/shared/components/layout-editor/presence.js +111 -0
  215. package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
  216. package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
  217. package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
  218. package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
  219. package/dist/shared/components/layout-editor/restore-piece.js +192 -0
  220. package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
  221. package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
  222. package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
  223. package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
  224. package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
  225. package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
  226. package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
  227. package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
  228. package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
  229. package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
  230. package/dist/shared/components/layout-editor/section-structure.js +241 -0
  231. package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
  232. package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
  233. package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
  234. package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
  235. package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
  236. package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
  237. package/dist/shared/components/layout-editor/settings/controls.js +8 -8
  238. package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
  239. package/dist/shared/components/layout-editor/shortcuts.js +88 -0
  240. package/dist/shared/components/layout-editor/show-when.js +35 -0
  241. package/dist/shared/components/layout-editor/slot-names.js +4 -3
  242. package/dist/shared/components/layout-editor/staged-api.js +64 -0
  243. package/dist/shared/components/layout-editor/structure-ops.js +403 -0
  244. package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
  245. package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
  246. package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
  247. package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
  248. package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
  249. package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
  250. package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
  251. package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
  252. package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
  253. package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
  254. package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
  255. package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
  256. package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
  257. package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
  258. package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
  259. package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
  260. package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
  261. package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
  262. package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
  263. package/dist/shared/components/profile/AgentsPanel.js +479 -0
  264. package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
  265. package/dist/shared/components/support/SuggestFormChange.js +143 -0
  266. package/dist/shared/components/support/SupportAnalytics.js +171 -0
  267. package/dist/shared/components/support/SupportView.js +75 -73
  268. package/dist/shared/lib/ai-fill.js +37 -0
  269. package/dist/shared/lib/background-runs.js +150 -0
  270. package/dist/shared/lib/delivery-ack.js +9 -0
  271. package/dist/shared/lib/entry-badge-style.js +13 -0
  272. package/dist/shared/lib/entry-config.js +71 -0
  273. package/dist/shared/lib/form-sections.js +64 -0
  274. package/dist/shared/lib/form-structure.js +99 -0
  275. package/dist/shared/lib/form-usage-beacon.js +133 -0
  276. package/dist/shared/lib/jobs-tray.js +25 -23
  277. package/dist/shared/lib/keyset-pager.js +37 -0
  278. package/dist/shared/lib/layout-i18n.js +66 -0
  279. package/dist/shared/lib/layout-lint.js +490 -0
  280. package/dist/shared/lib/layout-ops.js +116 -110
  281. package/dist/shared/lib/layout-resolve.js +113 -0
  282. package/dist/shared/lib/placement-behaviour.js +144 -0
  283. package/dist/shared/lib/prefetch.js +149 -0
  284. package/dist/shared/lib/presence-hooks.js +199 -0
  285. package/dist/shared/lib/record-outbox.js +82 -81
  286. package/dist/shared/lib/replay-socket.js +93 -0
  287. package/dist/shared/lib/request-gate.js +51 -50
  288. package/dist/shared/lib/room-gaps.js +96 -0
  289. package/dist/shared/lib/screenshot.js +54 -28
  290. package/dist/shared/lib/search-log.js +27 -0
  291. package/dist/shared/lib/socket-realtime.js +101 -80
  292. package/dist/shared/lib/visible-when.js +34 -0
  293. package/dist/shared/lib/worker-socket.js +200 -0
  294. package/package.json +1 -1
@@ -1,56 +1,62 @@
1
- import { jsxs as s, jsx as t, Fragment as j } from "react/jsx-runtime";
2
- import { useState as J, useEffect as z } from "react";
3
- import { titleCase as T } from "../../../lib/utils.js";
4
- import { RoleConditionRow as K } from "../editors/lock-conditions.js";
5
- import { O2MAggFieldCombobox as Q } from "../editors/o2m-agg-field.js";
6
- import { SwapConfigEditor as V } from "../editors/swap-config.js";
7
- import { IconPicker as Z } from "../pickers/icon-picker.js";
8
- import { useCollectionMeta as ee } from "./field-context.js";
9
- import { useInspectorEnv as te, Setting as d, TextInput as G, Choice as L, Segmented as w, Toggle as O, TextArea as le, Section as A, FieldMultiPicker as ae, ConditionBuilder as ne } from "./kit.js";
10
- import { groupFields as oe, asArray as b, relKindOf as ie, describeField as se, relatedCollectionOf as re } from "./model.js";
11
- const C = {
1
+ import { jsxs as r, 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";
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 ue } from "./field-context.js";
14
+ import { useInspectorEnv as me, Setting as d, TextInput as S, Choice as F, Segmented as y, Toggle as g, TextArea as Y, Section as $, FieldMultiPicker as be, ConditionBuilder as ye } from "./kit.js";
15
+ import { groupFields as ge, asArray as k, describeField as Z, relKindOf as ke, relatedCollectionOf as _e } from "./model.js";
16
+ import { GroupTranslations as ve } from "./Translations.js";
17
+ const T = {
12
18
  section: "Section",
13
19
  tab: "Tab or step",
14
20
  metadata: "Record info (read-only)",
15
21
  container: "Tabs or steps holder",
16
22
  content: "Text block"
17
23
  };
18
- function de(l) {
24
+ function we(l) {
19
25
  return typeof l == "string" ? { field: l } : l && typeof l == "object" && typeof l.field == "string" ? l : null;
20
26
  }
21
- function ce(l) {
22
- const { field: y, label: c, agg: h, agg_field: m, field_options: p } = l;
23
- return !c && !h ? y : {
24
- field: y,
25
- ...c ? { label: c } : {},
26
- ...h ? { agg: h, agg_field: m, ...p ? { field_options: p } : {} } : {}
27
+ function xe(l) {
28
+ const { field: u, label: o, agg: p, agg_field: m, field_options: f } = l;
29
+ return !o && !p ? u : {
30
+ field: u,
31
+ ...o ? { label: o } : {},
32
+ ...p ? { agg: p, agg_field: m, ...f ? { field_options: f } : {} } : {}
27
33
  };
28
34
  }
29
- const g = (l) => l.length ? JSON.stringify(l) : null;
30
- function ve({ group: l, readOnly: y }) {
31
- var P;
32
- const c = te(), { data: h } = ee(c.collection), m = (h == null ? void 0 : h.fields) ?? [], p = (h == null ? void 0 : h.relations) ?? [], a = l.label || T(l.key), r = l.type, o = (e, n, f) => c.apply([{ op: "group_update", key: l.key, patch: e }], { label: n, text: f }), x = c.bundle.groups.filter((e) => e.parent_key === l.key), B = c.bundle.groups.filter((e) => e.type === "container" && e.key !== l.key), E = c.bundle.placements.some((e) => e.group_key === l.key), H = (l.parent_key ? ["tab"] : Object.keys(C)).filter((e) => e === r || !(E && (e === "container" || e === "content"))).map((e) => ({ value: e, label: C[e] })), _ = r === "section" || r === "metadata" || r === "tab", I = m.filter((e) => !e.field.startsWith("__") && e.type !== "alias").map((e) => ({ value: e.field, label: e.label || T(e.field) })).sort((e, n) => e.label.localeCompare(n.label)), F = oe(c.bundle, l.key), k = b(l.summary_fields).map(de).filter((e) => !!e), M = (e, n, f) => o({ summary_fields: g(e.map(ce)) }, n, f), D = b(l.visible_when), v = JSON.stringify(D), [U, R] = J(D);
33
- z(() => {
34
- R(
35
- (e) => JSON.stringify(e.filter((n) => n.field)) === v ? e : JSON.parse(v)
35
+ const _ = (l) => l.length ? JSON.stringify(l) : null;
36
+ function je({ group: l, readOnly: u }) {
37
+ var B, H;
38
+ const o = me(), { data: p } = ue(o.collection), m = (p == null ? void 0 : p.fields) ?? [], f = (p == null ? void 0 : p.relations) ?? [], n = l.label || W(l.key), i = l.type, s = (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] })), v = i === "section" || i === "metadata" || i === "tab", R = oe(o.bundle.layout.conditions).includes(l.key), M = !!o.bundle.layout.accordion_mode, w = ne(l.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 = ge(o.bundle, l.key), x = k(l.summary_fields).map(we).filter((e) => !!e), G = (e, a, c) => s({ summary_fields: _(e.map(xe)) }, a, c), J = k(l.visible_when), C = JSON.stringify(J), [ee, K] = U(J);
39
+ ae(() => {
40
+ K(
41
+ (e) => JSON.stringify(e.filter((a) => a.field)) === C ? e : JSON.parse(C)
36
42
  );
37
- }, [v]);
38
- const [X, W] = J(!1);
39
- return /* @__PURE__ */ s("fieldset", { disabled: y, className: "min-w-0 space-y-5", children: [
43
+ }, [C]);
44
+ const [te, z] = U(!1);
45
+ return /* @__PURE__ */ r("fieldset", { disabled: u, className: "min-w-0 space-y-5", children: [
40
46
  /* @__PURE__ */ t(d, { k: "group.label", label: "Name", effect: "The heading people see.", children: /* @__PURE__ */ t(
41
- G,
47
+ S,
42
48
  {
43
49
  ariaLabel: "Name",
44
50
  value: l.label,
45
- onChange: (e) => o({ label: e }, `Rename ${a}`, !0)
51
+ onChange: (e) => s({ label: e }, `Rename ${n}`, !0)
46
52
  }
47
53
  ) }),
48
54
  /* @__PURE__ */ t(d, { k: "group.icon", label: "Icon", effect: "Shown before the section title.", children: /* @__PURE__ */ t(
49
- Z,
55
+ ce,
50
56
  {
51
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",
52
58
  value: l.icon ?? "",
53
- onChange: (e) => o({ icon: e || null }, `Change the icon of ${a}`)
59
+ onChange: (e) => s({ icon: e || null }, `Change the icon of ${n}`)
54
60
  }
55
61
  ) }),
56
62
  /* @__PURE__ */ t(
@@ -58,60 +64,60 @@ function ve({ group: l, readOnly: y }) {
58
64
  {
59
65
  k: "group.type",
60
66
  label: "Kind",
61
- effect: r === "container" && x.length ? "Move its tabs out before changing what this is." : E && !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.",
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.",
62
68
  children: /* @__PURE__ */ t(
63
- L,
69
+ F,
64
70
  {
65
71
  ariaLabel: "Kind",
66
- disabled: r === "container" && x.length > 0,
67
- value: r,
68
- options: H,
72
+ disabled: i === "container" && L.length > 0,
73
+ value: i,
74
+ options: V,
69
75
  onChange: (e) => {
70
- var n;
71
- return o(
76
+ var a;
77
+ return s(
72
78
  e === "container" ? { type: e, tab_mode: l.tab_mode ?? "tabs" } : { type: e },
73
- `Make ${a} a ${(n = C[e]) == null ? void 0 : n.toLowerCase()}`
79
+ `Make ${n} a ${(a = T[e]) == null ? void 0 : a.toLowerCase()}`
74
80
  );
75
81
  }
76
82
  }
77
83
  )
78
84
  }
79
85
  ),
80
- r === "container" && /* @__PURE__ */ t(
86
+ i === "container" && /* @__PURE__ */ t(
81
87
  d,
82
88
  {
83
89
  k: "group.tab_mode",
84
90
  label: "Show its tabs as",
85
91
  effect: "Steps walk people through in order.",
86
92
  children: /* @__PURE__ */ t(
87
- w,
93
+ y,
88
94
  {
89
95
  value: l.tab_mode === "steps" ? "steps" : "tabs",
90
96
  options: [
91
97
  { value: "tabs", label: "Tabs" },
92
98
  { value: "steps", label: "Steps" }
93
99
  ],
94
- onChange: (e) => o({ tab_mode: e }, `Show ${a} as ${e}`)
100
+ onChange: (e) => s({ tab_mode: e }, `Show ${n} as ${e}`)
95
101
  }
96
102
  )
97
103
  }
98
104
  ),
99
- r === "tab" && /* @__PURE__ */ t(
105
+ i === "tab" && /* @__PURE__ */ t(
100
106
  d,
101
107
  {
102
108
  k: "group.container_id",
103
109
  label: "Sits in",
104
110
  effect: "Tabs show inside a tabs or steps holder.",
105
111
  children: /* @__PURE__ */ t(
106
- L,
112
+ F,
107
113
  {
108
114
  ariaLabel: "Sits in",
109
115
  value: l.parent_key ?? "",
110
116
  options: [
111
117
  { value: "", label: "The form itself" },
112
- ...B.map((e) => ({ value: e.key, label: e.label || T(e.key) }))
118
+ ...Q.map((e) => ({ value: e.key, label: e.label || W(e.key) }))
113
119
  ],
114
- onChange: (e) => c.apply(
120
+ onChange: (e) => o.apply(
115
121
  [
116
122
  {
117
123
  op: "group_move",
@@ -120,23 +126,42 @@ function ve({ group: l, readOnly: y }) {
120
126
  index: Number.MAX_SAFE_INTEGER
121
127
  }
122
128
  ],
123
- { label: e ? `Move ${a} into a holder` : `Move ${a} out of its holder` }
129
+ { label: e ? `Move ${n} into a holder` : `Move ${n} out of its holder` }
124
130
  )
125
131
  }
126
132
  )
127
133
  }
128
134
  ),
129
- (r === "section" || r === "metadata") && /* @__PURE__ */ t(
130
- O,
135
+ (i === "section" || i === "metadata") && /* @__PURE__ */ t(
136
+ g,
131
137
  {
132
138
  k: "group.is_collapsed",
133
139
  label: "Starts collapsed",
134
140
  effect: "The section opens folded; people unfold it.",
135
141
  checked: l.is_collapsed,
136
- onChange: (e) => o({ is_collapsed: e }, e ? `Collapse ${a}` : `Expand ${a}`)
142
+ onChange: (e) => s({ is_collapsed: e }, e ? `Collapse ${n}` : `Expand ${n}`)
137
143
  }
138
144
  ),
139
- r === "content" && /* @__PURE__ */ s(j, { children: [
145
+ (i === "section" || i === "metadata") && /* @__PURE__ */ t(
146
+ g,
147
+ {
148
+ k: "group.load_on_open",
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.",
151
+ checked: R,
152
+ disabled: !R && !l.is_collapsed && !M,
153
+ onChange: (e) => o.apply(
154
+ [
155
+ {
156
+ op: "layout_update",
157
+ patch: ie(o.bundle.layout.conditions, l.key, e)
158
+ }
159
+ ],
160
+ { label: e ? `Load ${n} when opened` : `Load ${n} with the form` }
161
+ )
162
+ }
163
+ ),
164
+ i === "content" && /* @__PURE__ */ r(I, { children: [
140
165
  /* @__PURE__ */ t(
141
166
  d,
142
167
  {
@@ -144,7 +169,7 @@ function ve({ group: l, readOnly: y }) {
144
169
  label: "Style",
145
170
  effect: "Note and Warning are coloured boxes; Divider is a line with the text.",
146
171
  children: /* @__PURE__ */ t(
147
- w,
172
+ y,
148
173
  {
149
174
  value: l.content_tone ?? "info",
150
175
  options: [
@@ -152,21 +177,58 @@ function ve({ group: l, readOnly: y }) {
152
177
  { value: "warn", label: "Warning" },
153
178
  { value: "divider", label: "Divider" }
154
179
  ],
155
- onChange: (e) => o({ content_tone: e }, `Change the style of ${a}`)
180
+ onChange: (e) => s({ content_tone: e }, `Change the style of ${n}`)
156
181
  }
157
182
  )
158
183
  }
159
184
  ),
160
185
  /* @__PURE__ */ t(d, { k: "group.content", label: "Text", effect: "The words this block shows on the form.", children: /* @__PURE__ */ t(
161
- le,
186
+ Y,
162
187
  {
163
188
  ariaLabel: "Text",
164
189
  value: l.content ?? "",
165
- onChange: (e) => o({ content: e || null }, `Edit the text of ${a}`, !0)
190
+ onChange: (e) => s({ content: e || null }, `Edit the text of ${n}`, !0)
166
191
  }
167
192
  ) })
168
193
  ] }),
169
- _ && /* @__PURE__ */ s(j, { children: [
194
+ (i === "section" || i === "tab") && /* @__PURE__ */ r(I, { children: [
195
+ /* @__PURE__ */ t(
196
+ d,
197
+ {
198
+ k: "group.content",
199
+ label: "Intro",
200
+ effect: "A short note at the top: what to fill in here and why. Empty shows none.",
201
+ children: /* @__PURE__ */ t(
202
+ Y,
203
+ {
204
+ ariaLabel: "Intro",
205
+ value: l.content ?? "",
206
+ onChange: (e) => s({ content: e || null }, `Edit the intro of ${n}`, !0)
207
+ }
208
+ )
209
+ }
210
+ ),
211
+ !!((B = l.content) != null && B.trim()) && /* @__PURE__ */ t(
212
+ d,
213
+ {
214
+ k: "group.content_tone",
215
+ label: "Intro style",
216
+ effect: "Note is a quiet box; Warning is amber.",
217
+ children: /* @__PURE__ */ t(
218
+ y,
219
+ {
220
+ value: l.content_tone === "warn" ? "warn" : "info",
221
+ options: [
222
+ { value: "info", label: "Note" },
223
+ { value: "warn", label: "Warning" }
224
+ ],
225
+ onChange: (e) => s({ content_tone: e }, `Change the intro style of ${n}`)
226
+ }
227
+ )
228
+ }
229
+ )
230
+ ] }),
231
+ v && /* @__PURE__ */ r(I, { children: [
170
232
  /* @__PURE__ */ t(
171
233
  d,
172
234
  {
@@ -174,7 +236,7 @@ function ve({ group: l, readOnly: y }) {
174
236
  label: "Show",
175
237
  effect: "On new records, existing ones or both.",
176
238
  children: /* @__PURE__ */ t(
177
- w,
239
+ y,
178
240
  {
179
241
  value: l.visibility_mode ?? "always",
180
242
  options: [
@@ -182,19 +244,19 @@ function ve({ group: l, readOnly: y }) {
182
244
  { value: "new_only", label: "New records" },
183
245
  { value: "existing_only", label: "Existing" }
184
246
  ],
185
- onChange: (e) => o({ visibility_mode: e }, `Change when ${a} shows`)
247
+ onChange: (e) => s({ visibility_mode: e }, `Change when ${n} shows`)
186
248
  }
187
249
  )
188
250
  }
189
251
  ),
190
252
  /* @__PURE__ */ t(
191
- O,
253
+ g,
192
254
  {
193
255
  k: "group.hide_when_empty",
194
256
  label: "Hide when all its fields are empty",
195
257
  effect: "The section disappears while none of its fields has a value.",
196
258
  checked: l.hide_when_empty,
197
- onChange: (e) => o({ hide_when_empty: e }, `Change when ${a} hides`)
259
+ onChange: (e) => s({ hide_when_empty: e }, `Change when ${n} hides`)
198
260
  }
199
261
  ),
200
262
  /* @__PURE__ */ t(
@@ -204,7 +266,7 @@ function ve({ group: l, readOnly: y }) {
204
266
  label: "Width when reading",
205
267
  effect: "On the read view, summary and detail panels. Automatic: half for a short list, full for grids.",
206
268
  children: /* @__PURE__ */ t(
207
- w,
269
+ y,
208
270
  {
209
271
  value: l.read_width ?? "",
210
272
  options: [
@@ -213,13 +275,87 @@ function ve({ group: l, readOnly: y }) {
213
275
  { value: "half", label: "½" },
214
276
  { value: "third", label: "⅓" }
215
277
  ],
216
- onChange: (e) => o({ read_width: e || null }, `Change the read width of ${a}`)
278
+ onChange: (e) => s({ read_width: e || null }, `Change the read width of ${n}`)
279
+ }
280
+ )
281
+ }
282
+ ),
283
+ /* @__PURE__ */ t(
284
+ d,
285
+ {
286
+ k: "group.empty_text",
287
+ label: "When nothing is filled",
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,
291
+ {
292
+ ariaLabel: "When nothing is filled",
293
+ value: w.emptyText ?? "",
294
+ placeholder: "No details yet",
295
+ onChange: (e) => o.apply([pe(l, e)], {
296
+ label: `Change the empty text of ${n}`,
297
+ text: !0
298
+ })
217
299
  }
218
300
  )
219
301
  }
302
+ ),
303
+ i === "section" && !l.parent_key && /* @__PURE__ */ t(
304
+ g,
305
+ {
306
+ k: "group.sticky",
307
+ label: "Stick to the top",
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
+ checked: w.sticky,
310
+ onChange: (e) => {
311
+ const a = fe(o.bundle, l.key, e);
312
+ a.ok && o.apply(a.ops, { label: a.label });
313
+ }
314
+ }
220
315
  )
221
316
  ] }),
222
- r === "tab" && /* @__PURE__ */ s(A, { title: "As a step", children: [
317
+ (i === "section" || i === "tab") && /* @__PURE__ */ t($, { title: "Side by side", children: /* @__PURE__ */ t(
318
+ d,
319
+ {
320
+ k: "group.row_groups",
321
+ label: "Rows of fields",
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: w.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: w.rows.map((e) => /* @__PURE__ */ r("div", { className: "space-y-1", "data-row-group-setting": e.key, children: [
324
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
325
+ /* @__PURE__ */ t("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ t(
326
+ S,
327
+ {
328
+ ariaLabel: `Label of the row ${e.label}`,
329
+ value: e.label,
330
+ onChange: (a) => {
331
+ const c = X(o.bundle, l.key, e.key, { label: a });
332
+ c.ok && o.apply(c.ops, { label: c.label, text: !0 });
333
+ }
334
+ }
335
+ ) }),
336
+ /* @__PURE__ */ t(
337
+ "button",
338
+ {
339
+ type: "button",
340
+ onClick: () => {
341
+ const a = X(o.bundle, l.key, e.key, null);
342
+ a.ok && o.apply(a.ops, { label: a.label });
343
+ },
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",
345
+ children: "Take apart"
346
+ }
347
+ )
348
+ ] }),
349
+ /* @__PURE__ */ t("p", { className: "truncate text-[12px] text-slate-500 dark:text-muted-foreground", children: e.fields.map((a) => {
350
+ const c = o.bundle.placements.find(
351
+ (N) => N.field === a && N.group_key === l.key
352
+ ) ?? null;
353
+ return Z(a, m, f, c).label;
354
+ }).join(" · ") })
355
+ ] }, e.key)) })
356
+ }
357
+ ) }),
358
+ i === "tab" && /* @__PURE__ */ r($, { title: "As a step", children: [
223
359
  /* @__PURE__ */ t(
224
360
  d,
225
361
  {
@@ -227,38 +363,50 @@ function ve({ group: l, readOnly: y }) {
227
363
  label: "Skip as the first step when filled",
228
364
  effect: "Opens on a later step when these fields already have values.",
229
365
  children: /* @__PURE__ */ t(
230
- ae,
366
+ be,
231
367
  {
232
368
  ariaLabel: "Skip as the first step when filled",
233
- value: b(l.skip_if_filled),
234
- options: I,
235
- onChange: (e) => o({ skip_if_filled: g(e) }, `Change when ${a} is skipped`)
369
+ value: k(l.skip_if_filled),
370
+ options: D,
371
+ onChange: (e) => s({ skip_if_filled: _(e) }, `Change when ${n} is skipped`)
236
372
  }
237
373
  )
238
374
  }
239
375
  ),
240
- /* @__PURE__ */ t(
376
+ /* @__PURE__ */ r(
241
377
  d,
242
378
  {
243
379
  k: "group.visible_when",
244
380
  label: "Only when",
245
381
  effect: "The step shows only while every condition holds. No conditions: always.",
246
- children: /* @__PURE__ */ t(
247
- ne,
248
- {
249
- value: U,
250
- fields: I,
251
- onChange: (e) => {
252
- R(e);
253
- const n = e.filter((f) => f.field);
254
- JSON.stringify(n) !== v && o({ visible_when: g(n) }, `Change when ${a} shows`, !0);
382
+ children: [
383
+ /* @__PURE__ */ t(
384
+ ye,
385
+ {
386
+ value: ee,
387
+ fields: D,
388
+ onChange: (e) => {
389
+ K(e);
390
+ const a = e.filter((c) => c.field);
391
+ JSON.stringify(a) !== C && s({ visible_when: _(a) }, `Change when ${n} shows`, !0);
392
+ }
255
393
  }
256
- }
257
- )
394
+ ),
395
+ /* @__PURE__ */ t(
396
+ se,
397
+ {
398
+ layoutId: Number(o.bundle.layout.id),
399
+ target: { kind: "step", group: l.key },
400
+ bundle: o.bundle,
401
+ apply: (e, a) => o.apply(e, a),
402
+ disabled: u
403
+ }
404
+ )
405
+ ]
258
406
  }
259
407
  )
260
408
  ] }),
261
- _ && /* @__PURE__ */ s(A, { title: "Who", children: [
409
+ v && /* @__PURE__ */ r($, { title: "Who", children: [
262
410
  /* @__PURE__ */ t(
263
411
  d,
264
412
  {
@@ -266,10 +414,10 @@ function ve({ group: l, readOnly: y }) {
266
414
  label: "Hidden for",
267
415
  effect: "People in these roles do not see it. Admins always do.",
268
416
  children: /* @__PURE__ */ t(
269
- K,
417
+ q,
270
418
  {
271
- roleIds: b(l.hidden_for_roles),
272
- onRoleIdsChange: (e) => o({ hidden_for_roles: g(e) }, `Change who sees ${a}`)
419
+ roleIds: k(l.hidden_for_roles),
420
+ onRoleIdsChange: (e) => s({ hidden_for_roles: _(e) }, `Change who sees ${n}`)
273
421
  }
274
422
  )
275
423
  }
@@ -281,69 +429,69 @@ function ve({ group: l, readOnly: y }) {
281
429
  label: "Read-only for",
282
430
  effect: "People in these roles cannot change it; the server drops their writes. Admins are exempt.",
283
431
  children: /* @__PURE__ */ t(
284
- K,
432
+ q,
285
433
  {
286
- roleIds: b(l.locked_for_roles),
287
- onRoleIdsChange: (e) => o({ locked_for_roles: g(e) }, `Change who can edit ${a}`)
434
+ roleIds: k(l.locked_for_roles),
435
+ onRoleIdsChange: (e) => s({ locked_for_roles: _(e) }, `Change who can edit ${n}`)
288
436
  }
289
437
  )
290
438
  }
291
439
  )
292
440
  ] }),
293
- _ && /* @__PURE__ */ s(A, { title: "When collapsed", children: [
441
+ v && /* @__PURE__ */ r($, { title: "When collapsed", children: [
294
442
  /* @__PURE__ */ t(
295
443
  d,
296
444
  {
297
445
  k: "group.summary_fields",
298
446
  label: "Show these values in the heading",
299
447
  effect: "A short summary while the section is closed.",
300
- children: F.length === 0 ? /* @__PURE__ */ s("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: [
448
+ children: j.length === 0 ? /* @__PURE__ */ r("p", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: [
301
449
  "Place fields in ",
302
- a,
450
+ n,
303
451
  " first."
304
- ] }) : /* @__PURE__ */ t("div", { className: "space-y-1.5", children: F.map((e) => {
305
- const n = k.find((i) => i.field === e), f = ie(e, p) === "O2M", Y = c.bundle.placements.find((i) => i.field === e) ?? null, N = se(e, m, p, Y).label, S = (i, u, q) => M(
306
- k.map(($) => $.field === e ? { ...$, ...i } : $),
307
- u,
308
- q
452
+ ] }) : /* @__PURE__ */ t("div", { className: "space-y-1.5", children: j.map((e) => {
453
+ const a = x.find((h) => h.field === e), c = ke(e, f) === "O2M", N = o.bundle.placements.find((h) => h.field === e) ?? null, O = Z(e, m, f, N).label, E = (h, b, le) => G(
454
+ x.map((A) => A.field === e ? { ...A, ...h } : A),
455
+ b,
456
+ le
309
457
  );
310
- return /* @__PURE__ */ s("div", { className: "space-y-1", children: [
311
- /* @__PURE__ */ s("label", { className: "flex items-center gap-2 text-[12px]", children: [
458
+ return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
459
+ /* @__PURE__ */ r("label", { className: "flex items-center gap-2 text-[12px]", children: [
312
460
  /* @__PURE__ */ t(
313
461
  "input",
314
462
  {
315
463
  type: "checkbox",
316
- checked: !!n,
317
- onChange: (i) => M(
318
- i.target.checked ? [...k, f ? { field: e, agg: "count" } : { field: e }] : k.filter((u) => u.field !== e),
319
- `Change the summary of ${a}`
464
+ checked: !!a,
465
+ onChange: (h) => G(
466
+ h.target.checked ? [...x, c ? { field: e, agg: "count" } : { field: e }] : x.filter((b) => b.field !== e),
467
+ `Change the summary of ${n}`
320
468
  ),
321
469
  className: "h-3.5 w-3.5 accent-nvr-cyan"
322
470
  }
323
471
  ),
324
- /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: N }),
325
- f && /* @__PURE__ */ t("span", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "list" })
472
+ /* @__PURE__ */ t("span", { className: "flex-1 truncate", children: O }),
473
+ c && /* @__PURE__ */ t("span", { className: "text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "list" })
326
474
  ] }),
327
- n && /* @__PURE__ */ s("div", { className: "space-y-1 pl-5", children: [
475
+ a && /* @__PURE__ */ r("div", { className: "space-y-1 pl-5", children: [
328
476
  /* @__PURE__ */ t("div", { "data-setting": "group.summary_fields.label", children: /* @__PURE__ */ t(
329
- G,
477
+ S,
330
478
  {
331
- ariaLabel: `Label for ${N}`,
332
- value: n.label ?? "",
333
- placeholder: `Label (${N})`,
334
- onChange: (i) => S(
335
- { label: i || null },
336
- `Change the summary of ${a}`,
479
+ ariaLabel: `Label for ${O}`,
480
+ value: a.label ?? "",
481
+ placeholder: `Label (${O})`,
482
+ onChange: (h) => E(
483
+ { label: h || null },
484
+ `Change the summary of ${n}`,
337
485
  !0
338
486
  )
339
487
  }
340
488
  ) }),
341
- f && /* @__PURE__ */ s("div", { className: "flex gap-1", children: [
489
+ c && /* @__PURE__ */ r("div", { className: "flex gap-1", children: [
342
490
  /* @__PURE__ */ t("div", { className: "flex-1", "data-setting": "group.summary_fields.agg", children: /* @__PURE__ */ t(
343
- L,
491
+ F,
344
492
  {
345
493
  ariaLabel: "Show",
346
- value: n.agg ?? "count",
494
+ value: a.agg ?? "count",
347
495
  options: [
348
496
  { value: "count", label: "Count" },
349
497
  { value: "sum", label: "Sum" },
@@ -351,25 +499,25 @@ function ve({ group: l, readOnly: y }) {
351
499
  { value: "min", label: "Smallest" },
352
500
  { value: "max", label: "Largest" }
353
501
  ],
354
- onChange: (i) => S(
355
- i === "count" ? { agg: i, agg_field: void 0, field_options: void 0 } : { agg: i },
356
- `Change the summary of ${a}`
502
+ onChange: (h) => E(
503
+ h === "count" ? { agg: h, agg_field: void 0, field_options: void 0 } : { agg: h },
504
+ `Change the summary of ${n}`
357
505
  )
358
506
  }
359
507
  ) }),
360
- (n.agg ?? "count") !== "count" && /* @__PURE__ */ t(
508
+ (a.agg ?? "count") !== "count" && /* @__PURE__ */ t(
361
509
  "div",
362
510
  {
363
511
  className: "flex-1",
364
512
  "data-setting": "group.summary_fields.agg_field",
365
513
  children: /* @__PURE__ */ t(
366
- Q,
514
+ re,
367
515
  {
368
- relatedCollection: re(e, p),
369
- value: n.agg_field ?? "",
370
- onChange: (i, u) => S(
371
- { agg_field: i, field_options: u },
372
- `Change the summary of ${a}`
516
+ relatedCollection: _e(e, f),
517
+ value: a.agg_field ?? "",
518
+ onChange: (h, b) => E(
519
+ { agg_field: h, field_options: b },
520
+ `Change the summary of ${n}`
373
521
  )
374
522
  }
375
523
  )
@@ -382,44 +530,46 @@ function ve({ group: l, readOnly: y }) {
382
530
  }
383
531
  ),
384
532
  /* @__PURE__ */ t(
385
- O,
533
+ g,
386
534
  {
387
535
  k: "group.summary_hide_empty",
388
536
  label: "Leave out empty values",
389
537
  effect: "Fields without a value are left out of the summary line.",
390
538
  checked: l.summary_hide_empty,
391
- onChange: (e) => o({ summary_hide_empty: e }, `Change the summary of ${a}`)
539
+ onChange: (e) => s({ summary_hide_empty: e }, `Change the summary of ${n}`)
392
540
  }
393
541
  )
394
542
  ] }),
395
- _ && /* @__PURE__ */ t(
396
- V,
543
+ v && /* @__PURE__ */ t(
544
+ de,
397
545
  {
398
546
  group: { id: l.id ?? 0, swap_config: l.swap_config },
399
547
  allFields: m.map((e) => ({ field: e.field, type: e.type ?? void 0 })),
400
- onGroupSettings: (e, n) => o(n, `Change the field swap of ${a}`)
548
+ onGroupSettings: (e, a) => s(a, `Change the field swap of ${n}`)
401
549
  }
402
550
  ),
551
+ !u && /* @__PURE__ */ t(he, { bundle: o.bundle, collection: o.collection, group: l }),
552
+ /* @__PURE__ */ t(ve, { group: l }),
403
553
  /* @__PURE__ */ t(
404
554
  "div",
405
555
  {
406
556
  "data-setting": "group.delete",
407
557
  className: "border-t border-slate-200 pt-3 dark:border-border",
408
- children: X ? /* @__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: [
409
- /* @__PURE__ */ s("p", { children: [
558
+ children: te ? /* @__PURE__ */ r("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: [
559
+ /* @__PURE__ */ r("p", { children: [
410
560
  "Delete ",
411
- a,
561
+ n,
412
562
  "? Its fields move to the top of the form",
413
- x.length ? " and its tabs move out" : "",
563
+ L.length ? " and its tabs move out" : "",
414
564
  ". Undo brings it back."
415
565
  ] }),
416
- /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
566
+ /* @__PURE__ */ r("div", { className: "flex gap-2", children: [
417
567
  /* @__PURE__ */ t(
418
568
  "button",
419
569
  {
420
570
  type: "button",
421
- onClick: () => c.apply([{ op: "group_remove", key: l.key, placements: "ungroup" }], {
422
- label: `Delete ${a}`
571
+ onClick: () => o.apply([{ op: "group_remove", key: l.key, placements: "ungroup" }], {
572
+ label: `Delete ${n}`
423
573
  }),
424
574
  className: "rounded-md bg-red-600 px-2.5 py-1 text-[12px] font-medium text-white hover:bg-red-700",
425
575
  children: "Delete"
@@ -429,21 +579,21 @@ function ve({ group: l, readOnly: y }) {
429
579
  "button",
430
580
  {
431
581
  type: "button",
432
- onClick: () => W(!1),
582
+ onClick: () => z(!1),
433
583
  className: "rounded-md px-2.5 py-1 text-[12px] hover:bg-red-100 dark:hover:bg-red-900/40",
434
584
  children: "Keep"
435
585
  }
436
586
  )
437
587
  ] })
438
- ] }) : /* @__PURE__ */ s(
588
+ ] }) : /* @__PURE__ */ r(
439
589
  "button",
440
590
  {
441
591
  type: "button",
442
- onClick: () => W(!0),
592
+ onClick: () => z(!0),
443
593
  className: "text-[12px] text-red-600 hover:underline dark:text-red-400",
444
594
  children: [
445
595
  "Delete ",
446
- ((P = C[r]) == null ? void 0 : P.toLowerCase()) ?? "section"
596
+ ((H = T[i]) == null ? void 0 : H.toLowerCase()) ?? "section"
447
597
  ]
448
598
  }
449
599
  )
@@ -452,5 +602,5 @@ function ve({ group: l, readOnly: y }) {
452
602
  ] });
453
603
  }
454
604
  export {
455
- ve as GroupInspector
605
+ je as GroupInspector
456
606
  };