@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,146 +1,168 @@
1
- import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { Search as w, X as T } from "lucide-react";
3
- import { useState as B, useMemo as m, useCallback as F } from "react";
4
- import { cn as p } from "../../../lib/utils.js";
5
- import { PanelHeader as q } from "../panel-frame.js";
6
- import { groupTitle as A } from "../panel-style.js";
7
- import { AddendumSection as I } from "./AddendumSection.js";
8
- import { ButtonsSection as M } from "./ButtonsSection.js";
9
- import { inputCls as O, quietText as P, VisibleSettingsContext as R } from "./controls.js";
10
- import { DefaultsSection as _ } from "./DefaultsSection.js";
11
- import { InheritanceSection as j } from "./InheritanceSection.js";
12
- import { LayoutSection as D } from "./LayoutSection.js";
13
- import { PdfSection as E } from "./PdfSection.js";
14
- import { ReadSection as W } from "./ReadSection.js";
15
- import { layoutKindOf as $, visibleSections as z } from "./settings-registry.js";
16
- import { ToolsSection as H } from "./ToolsSection.js";
17
- import { WhoSection as K } from "./WhoSection.js";
18
- const L = {
19
- who: K,
20
- layout: D,
21
- buttons: M,
22
- read: W,
23
- pdf: E,
24
- addendum: I,
25
- defaults: _,
26
- inheritance: j,
27
- tools: H
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { Search as T, X as B, MessageCircleQuestion as F } from "lucide-react";
3
+ import { useState as M, useMemo as c, useCallback as q } from "react";
4
+ import { cn as u } from "../../../lib/utils.js";
5
+ import { isWhereQuestion as E } from "../assist/settings-index.js";
6
+ import { PanelHeader as I } from "../panel-frame.js";
7
+ import { groupTitle as O } from "../panel-style.js";
8
+ import { AddendumSection as P } from "./AddendumSection.js";
9
+ import { ButtonsSection as Q } from "./ButtonsSection.js";
10
+ import { inputCls as R, quietText as _, VisibleSettingsContext as j } from "./controls.js";
11
+ import { DefaultsSection as A } from "./DefaultsSection.js";
12
+ import { EntrySection as D } from "./EntrySection.js";
13
+ import { InheritanceSection as L } from "./InheritanceSection.js";
14
+ import { LayoutSection as W } from "./LayoutSection.js";
15
+ import { PdfSection as $ } from "./PdfSection.js";
16
+ import { ReadSection as z } from "./ReadSection.js";
17
+ import { layoutKindOf as H, visibleSections as K } from "./settings-registry.js";
18
+ import { ToolsSection as V } from "./ToolsSection.js";
19
+ import { WhoSection as X } from "./WhoSection.js";
20
+ const G = {
21
+ who: X,
22
+ layout: W,
23
+ buttons: Q,
24
+ read: z,
25
+ pdf: $,
26
+ addendum: P,
27
+ defaults: A,
28
+ entry: D,
29
+ inheritance: L,
30
+ tools: V
28
31
  };
29
- function dt({
30
- bundle: r,
31
- apply: c,
32
- flush: n,
33
- collection: u,
34
- onPreviewRole: g,
35
- previewRoleId: y,
36
- onPreviewRoleChange: S
32
+ function ht({
33
+ bundle: a,
34
+ apply: d,
35
+ flush: m,
36
+ collection: p,
37
+ onPreviewRole: y,
38
+ previewRoleId: x,
39
+ onPreviewRoleChange: v,
40
+ onAskWhere: f
37
41
  }) {
38
- const [a, f] = B(""), i = $(r.layout), l = m(() => z(i, a), [i, a]), x = m(
39
- () => new Set(l.flatMap((t) => t.settings.map((e) => e.key))),
40
- [l]
41
- ), h = F(() => n == null ? void 0 : n(), [n]), v = m(
42
+ const [r, h] = M(""), n = H(a.layout), s = c(() => K(n, r), [n, r]), S = c(
43
+ () => new Set(s.flatMap((t) => t.settings.map((e) => e.key))),
44
+ [s]
45
+ ), b = q(() => m == null ? void 0 : m(), [m]), k = c(
42
46
  () => ({
43
- bundle: r,
44
- layout: r.layout,
45
- kind: i,
46
- collection: u,
47
- set: (t, e, s) => c(
47
+ bundle: a,
48
+ layout: a.layout,
49
+ kind: n,
50
+ collection: p,
51
+ set: (t, e, l) => d(
48
52
  [{ op: "layout_update", patch: t }],
49
- (s == null ? void 0 : s.undoable) === !1 ? { label: e, undoable: !1 } : { label: e }
53
+ (l == null ? void 0 : l.undoable) === !1 ? { label: e, undoable: !1 } : { label: e }
50
54
  ),
51
- setText: (t, e) => c([{ op: "layout_update", patch: t }], { label: e, text: !0 }),
52
- flush: h
55
+ setText: (t, e) => d([{ op: "layout_update", patch: t }], { label: e, text: !0 }),
56
+ flush: b,
57
+ apply: (t, e) => d(t, e)
53
58
  }),
54
- [r, i, u, c, h]
55
- ), k = typeof r.layout.name == "string" ? r.layout.name : "", N = (t) => {
56
- const e = t.currentTarget, s = e.getBoundingClientRect().top;
57
- for (const b of e.querySelectorAll("[data-section-title]")) {
58
- const C = e.scrollTop > 0 && Math.abs(b.getBoundingClientRect().top - s) < 1;
59
- b.toggleAttribute("data-stuck", C);
59
+ [a, n, p, d, b]
60
+ ), N = typeof a.layout.name == "string" ? a.layout.name : "", C = (t) => {
61
+ const e = t.currentTarget, l = e.getBoundingClientRect().top;
62
+ for (const g of e.querySelectorAll("[data-section-title]")) {
63
+ const w = e.scrollTop > 0 && Math.abs(g.getBoundingClientRect().top - l) < 1;
64
+ g.toggleAttribute("data-stuck", w);
60
65
  }
61
66
  };
62
- return /* @__PURE__ */ d("div", { className: "flex h-full min-h-0 flex-col", "data-form-settings": i, children: [
67
+ return /* @__PURE__ */ i("div", { className: "flex h-full min-h-0 flex-col", "data-form-settings": n, children: [
63
68
  /* @__PURE__ */ o(
64
- q,
69
+ I,
65
70
  {
66
71
  eyebrow: "Form settings",
67
- title: k || "This form",
72
+ title: N || "This form",
68
73
  sub: "Who gets this form and how it behaves",
69
- children: /* @__PURE__ */ d("div", { className: "relative", children: [
70
- /* @__PURE__ */ o(w, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
74
+ children: /* @__PURE__ */ i("div", { className: "relative", children: [
75
+ /* @__PURE__ */ o(T, { className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-slate-400" }),
71
76
  /* @__PURE__ */ o(
72
77
  "input",
73
78
  {
74
- value: a,
75
- onChange: (t) => f(t.target.value),
79
+ value: r,
80
+ onChange: (t) => h(t.target.value),
76
81
  placeholder: "Find a setting…",
77
82
  "aria-label": "Find a setting",
78
83
  "data-settings-search": !0,
79
- className: p(O, "pl-8 pr-8")
84
+ className: u(R, "pl-8 pr-8")
80
85
  }
81
86
  ),
82
- a && /* @__PURE__ */ o(
87
+ r && /* @__PURE__ */ o(
83
88
  "button",
84
89
  {
85
90
  type: "button",
86
91
  "aria-label": "Clear search",
87
- onClick: () => f(""),
92
+ onClick: () => h(""),
88
93
  className: "absolute right-2 top-1/2 -translate-y-1/2 rounded p-0.5 text-slate-400 hover:text-slate-700 dark:hover:text-foreground",
89
- children: /* @__PURE__ */ o(T, { className: "h-3.5 w-3.5" })
94
+ children: /* @__PURE__ */ o(B, { className: "h-3.5 w-3.5" })
90
95
  }
91
96
  )
92
97
  ] })
93
98
  }
94
99
  ),
95
- /* @__PURE__ */ o(
100
+ /* @__PURE__ */ i(
96
101
  "div",
97
102
  {
98
103
  "data-panel-body": "",
99
- onScroll: N,
104
+ onScroll: C,
100
105
  className: "min-h-0 flex-1 overflow-y-auto px-4 pb-8",
101
- children: l.length === 0 ? /* @__PURE__ */ d("p", { className: p("py-8 text-center", P), children: [
102
- "No setting matches “",
103
- a.trim(),
104
- "”."
105
- ] }) : /* @__PURE__ */ o(R.Provider, { value: x, children: l.map(({ section: t }) => {
106
- const e = L[t.id];
107
- return /* @__PURE__ */ d(
108
- "section",
106
+ children: [
107
+ f && r.trim() && (s.length === 0 || E(r)) && /* @__PURE__ */ i(
108
+ "button",
109
109
  {
110
- "data-section": t.id,
111
- "aria-labelledby": `form-settings-${t.id}`,
112
- className: "border-t border-slate-100 pb-6 first:border-t-0 dark:border-border/60",
110
+ type: "button",
111
+ "data-settings-ask": "",
112
+ onClick: () => f(r.trim()),
113
+ className: "mt-3 inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[12px] font-medium text-slate-600 transition-colors hover:bg-muted hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",
113
114
  children: [
114
- /* @__PURE__ */ o(
115
- "h3",
116
- {
117
- id: `form-settings-${t.id}`,
118
- "data-section-title": "",
119
- className: p(
120
- A,
121
- "sticky top-0 z-10 -mx-4 border-b border-transparent bg-white px-4 pb-3 pt-4 data-[stuck]:border-slate-200 dark:bg-card dark:data-[stuck]:border-border"
122
- ),
123
- children: t.title
124
- }
125
- ),
126
- /* @__PURE__ */ o("div", { className: "space-y-5", children: /* @__PURE__ */ o(
127
- e,
128
- {
129
- ...v,
130
- onPreviewRole: g,
131
- previewRoleId: y,
132
- onPreviewRoleChange: S
133
- }
134
- ) })
115
+ /* @__PURE__ */ o(F, { className: "h-3.5 w-3.5 text-nvr-cyan" }),
116
+ "Look everywhere for “",
117
+ r.trim(),
118
+ "”"
135
119
  ]
136
- },
137
- t.id
138
- );
139
- }) })
120
+ }
121
+ ),
122
+ s.length === 0 ? /* @__PURE__ */ i("p", { className: u("py-8 text-center", _), children: [
123
+ "No setting matches “",
124
+ r.trim(),
125
+ "”."
126
+ ] }) : /* @__PURE__ */ o(j.Provider, { value: S, children: s.map(({ section: t }) => {
127
+ const e = G[t.id];
128
+ return /* @__PURE__ */ i(
129
+ "section",
130
+ {
131
+ "data-section": t.id,
132
+ "aria-labelledby": `form-settings-${t.id}`,
133
+ className: "border-t border-slate-100 pb-6 first:border-t-0 dark:border-border/60",
134
+ children: [
135
+ /* @__PURE__ */ o(
136
+ "h3",
137
+ {
138
+ id: `form-settings-${t.id}`,
139
+ "data-section-title": "",
140
+ className: u(
141
+ O,
142
+ "sticky top-0 z-10 -mx-4 border-b border-transparent bg-white px-4 pb-3 pt-4 data-[stuck]:border-slate-200 dark:bg-card dark:data-[stuck]:border-border"
143
+ ),
144
+ children: t.title
145
+ }
146
+ ),
147
+ /* @__PURE__ */ o("div", { className: "space-y-5", children: /* @__PURE__ */ o(
148
+ e,
149
+ {
150
+ ...k,
151
+ onPreviewRole: y,
152
+ previewRoleId: x,
153
+ onPreviewRoleChange: v
154
+ }
155
+ ) })
156
+ ]
157
+ },
158
+ t.id
159
+ );
160
+ }) })
161
+ ]
140
162
  }
141
163
  )
142
164
  ] });
143
165
  }
144
166
  export {
145
- dt as FormSettings
167
+ ht as FormSettings
146
168
  };
@@ -27,7 +27,7 @@ function L(o) {
27
27
  e.map((t) => t.name).join(", "),
28
28
  " ",
29
29
  e.length === 1 ? "inherits" : "inherit",
30
- " from this layout, so it cannot inherit from another."
30
+ " from this form, so it cannot inherit from another."
31
31
  ] }) : null
32
32
  }
33
33
  );
@@ -0,0 +1,255 @@
1
+ import { jsx as t, jsxs as r } from "react/jsx-runtime";
2
+ import { useQueryClient as W } from "@tanstack/react-query";
3
+ import { Lock as O, Smartphone as P } from "lucide-react";
4
+ import { useState as x, useEffect as A } from "react";
5
+ import { toast as q } from "sonner";
6
+ import { useItemEditAuth as D, useNivaroClient as M } from "../../../context.js";
7
+ import { post as R, patch as T } from "../../../lib/commands.js";
8
+ import { freezeOf as U, activeFreeze as _, localDay as S, dayWords as k, freezePatch as E, activeWindowOf as j, windowState as B, windowWords as Q, phoneOf as L, phoneOfPatch as V, activeWindowPatch as G, conditionsWithKey as H } from "../../../lib/layout-resolve.js";
9
+ import { cn as g } from "../../../lib/utils.js";
10
+ import { useLayoutEditorHost as J } from "../host.js";
11
+ import { useInvalidateLayouts as X, apiFailure as Y } from "../overview/overview-api.js";
12
+ import { amberStrip as Z } from "../panel-style.js";
13
+ import { Setting as $, smallBtn as b, quietText as w, inputCls as I, PickList as ee } from "./controls.js";
14
+ import { useCollectionLayoutList as te, settingsKeys as ne } from "./settings-api.js";
15
+ import { layoutKindOf as ae } from "./settings-registry.js";
16
+ const F = g(I, "h-8 w-[150px] font-mono dark:[color-scheme:dark]");
17
+ function ge(m) {
18
+ const { layout: c } = m, e = j(c.conditions), [a, l] = x((e == null ? void 0 : e.from) ?? ""), [s, u] = x((e == null ? void 0 : e.until) ?? "");
19
+ A(() => {
20
+ l((e == null ? void 0 : e.from) ?? ""), u((e == null ? void 0 : e.until) ?? "");
21
+ }, [e == null ? void 0 : e.from, e == null ? void 0 : e.until]);
22
+ const p = !!a && !!s && a > s, f = (o, i) => {
23
+ o && i && o > i || (o || null) === ((e == null ? void 0 : e.from) ?? null) && (i || null) === ((e == null ? void 0 : e.until) ?? null) || m.set(
24
+ G(c.conditions, { from: o || null, until: i || null }),
25
+ o || i ? "Set active dates" : "Clear active dates"
26
+ );
27
+ }, d = B(e, S());
28
+ return /* @__PURE__ */ t(
29
+ $,
30
+ {
31
+ k: "layout.conditions.active_window",
32
+ note: p ? /* @__PURE__ */ t("span", { className: "text-amber-700 dark:text-amber-300", children: "The end comes before the start." }) : e && d ? /* @__PURE__ */ t("span", { "data-active-window-state": d, children: d === "open" ? `In use now, ${Q(e)}.` : d === "before" ? `Not in use yet: starts ${k(e.from)}.` : `No longer in use: ended ${k(e.until)}.` }) : null,
33
+ children: /* @__PURE__ */ r("div", { className: "flex flex-wrap items-end gap-2", children: [
34
+ /* @__PURE__ */ r("label", { className: "flex flex-col gap-1", children: [
35
+ /* @__PURE__ */ t("span", { className: w, children: "From" }),
36
+ /* @__PURE__ */ t(
37
+ "input",
38
+ {
39
+ type: "date",
40
+ "aria-label": "Active from",
41
+ value: a,
42
+ max: s || void 0,
43
+ onChange: (o) => {
44
+ l(o.target.value), f(o.target.value, s);
45
+ },
46
+ className: F
47
+ }
48
+ )
49
+ ] }),
50
+ /* @__PURE__ */ r("label", { className: "flex flex-col gap-1", children: [
51
+ /* @__PURE__ */ t("span", { className: w, children: "Until" }),
52
+ /* @__PURE__ */ t(
53
+ "input",
54
+ {
55
+ type: "date",
56
+ "aria-label": "Active until",
57
+ value: s,
58
+ min: a || void 0,
59
+ onChange: (o) => {
60
+ u(o.target.value), f(a, o.target.value);
61
+ },
62
+ className: F
63
+ }
64
+ )
65
+ ] }),
66
+ (a || s) && /* @__PURE__ */ t(
67
+ "button",
68
+ {
69
+ type: "button",
70
+ className: g(b, "mb-0.5"),
71
+ onClick: () => {
72
+ l(""), u(""), f("", "");
73
+ },
74
+ children: "Clear"
75
+ }
76
+ )
77
+ ] })
78
+ }
79
+ );
80
+ }
81
+ function xe(m) {
82
+ const { layout: c, collection: e } = m, a = Number(c.id), l = J(), s = M(), u = W(), p = X(e), f = te(e), [d, o] = x(!1), i = f.filter((n) => ae(n) === "grouped"), h = L(c.conditions), N = i.find((n) => n.id !== a && L(n.conditions) === a) ?? null, v = h != null ? i.find((n) => n.id === h) ?? null : null, C = (n) => {
83
+ l.layoutLink && l.navigate(l.layoutLink(e, n));
84
+ }, K = async () => {
85
+ o(!0);
86
+ try {
87
+ const n = String(c.name || "Form"), z = await s.request(
88
+ R(`/collection-layouts/${a}/clone`, { name: `${n} (phone)`.slice(0, 255) })
89
+ ), y = z == null ? void 0 : z.data;
90
+ if (!(y != null && y.id)) throw new Error("No id came back");
91
+ await s.request(
92
+ T(`/collection-layouts/${y.id}`, {
93
+ conditions: H(y.conditions, "phone_of", a)
94
+ })
95
+ ), u.invalidateQueries({ queryKey: ne.layouts(e) }), p(), q.success("Phone version made: remove what a phone does not need"), C(Number(y.id));
96
+ } catch (n) {
97
+ q.error(Y(n, "Could not make the phone version").message);
98
+ } finally {
99
+ o(!1);
100
+ }
101
+ };
102
+ return /* @__PURE__ */ t(
103
+ $,
104
+ {
105
+ k: "layout.conditions.phone_of",
106
+ note: h != null ? /* @__PURE__ */ r("span", { "data-phone-of": h, children: [
107
+ "This form opens instead of",
108
+ " ",
109
+ /* @__PURE__ */ t("strong", { className: "font-medium text-slate-700 dark:text-foreground", children: (v == null ? void 0 : v.name) ?? `form ${h}` }),
110
+ " ",
111
+ "on small screens, for the records and roles that form gets."
112
+ ] }) : null,
113
+ children: N ? /* @__PURE__ */ r(
114
+ "div",
115
+ {
116
+ "data-phone-version": N.id,
117
+ className: "flex flex-wrap items-center gap-2 text-[12.5px] text-slate-700 dark:text-foreground",
118
+ children: [
119
+ /* @__PURE__ */ t(P, { className: "h-3.5 w-3.5 shrink-0 text-slate-500 dark:text-muted-foreground" }),
120
+ /* @__PURE__ */ t("span", { className: "min-w-0 truncate", children: N.name }),
121
+ l.layoutLink && /* @__PURE__ */ t("button", { type: "button", className: b, onClick: () => C(N.id), children: "Open" })
122
+ ]
123
+ }
124
+ ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
125
+ /* @__PURE__ */ t(
126
+ ee,
127
+ {
128
+ ariaLabel: "Phone version of",
129
+ value: h != null ? String(h) : null,
130
+ placeholder: "Not a phone version",
131
+ clearLabel: "Not a phone version",
132
+ options: i.filter((n) => n.id !== a && L(n.conditions) == null).map((n) => ({ value: String(n.id), label: n.name })),
133
+ onChange: (n) => m.set(
134
+ V(c.conditions, n ? Number(n) : null),
135
+ n ? "Make this a phone version" : "Stop being a phone version"
136
+ ),
137
+ className: "w-[220px]"
138
+ }
139
+ ),
140
+ h == null && /* @__PURE__ */ r(
141
+ "button",
142
+ {
143
+ type: "button",
144
+ className: b,
145
+ disabled: d,
146
+ "data-action": "make-phone-version",
147
+ onClick: () => void K(),
148
+ children: [
149
+ /* @__PURE__ */ t(P, { className: "h-3.5 w-3.5" }),
150
+ d ? "Making…" : "Make a phone version"
151
+ ]
152
+ }
153
+ ),
154
+ v && l.layoutLink && /* @__PURE__ */ r("button", { type: "button", className: b, onClick: () => C(v.id), children: [
155
+ "Open ",
156
+ v.name
157
+ ] })
158
+ ] })
159
+ }
160
+ );
161
+ }
162
+ function Ne(m) {
163
+ const { layout: c } = m, { userId: e } = D(), a = U(c.conditions), l = _(c.conditions), [s, u] = x(""), [p, f] = x(""), d = s > S() && p.trim().length >= 3, o = () => {
164
+ d && (m.set(
165
+ E(c.conditions, {
166
+ until: s,
167
+ reason: p.trim().slice(0, 300),
168
+ by: e || null,
169
+ at: (/* @__PURE__ */ new Date()).toISOString()
170
+ }),
171
+ `Freeze edits until ${k(s)}`
172
+ ), u(""), f(""));
173
+ };
174
+ return /* @__PURE__ */ t($, { k: "layout.conditions.freeze", children: a ? /* @__PURE__ */ r(
175
+ "div",
176
+ {
177
+ "data-layout-frozen": a.until,
178
+ className: g(
179
+ "flex flex-wrap items-center gap-2 rounded-md border px-2.5 py-2 text-[12.5px]",
180
+ l ? Z : "border-slate-200 text-slate-600 dark:border-border dark:text-muted-foreground"
181
+ ),
182
+ children: [
183
+ /* @__PURE__ */ t(O, { className: "h-3.5 w-3.5 shrink-0" }),
184
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
185
+ l ? "Frozen until " : "The freeze ended on ",
186
+ k(a.until),
187
+ a.reason ? `: ${a.reason}` : ""
188
+ ] }),
189
+ /* @__PURE__ */ t(
190
+ "button",
191
+ {
192
+ type: "button",
193
+ className: b,
194
+ "data-action": "lift-freeze",
195
+ onClick: () => m.set(
196
+ E(c.conditions, null),
197
+ l ? "Lift the edit freeze" : "Remove the ended freeze"
198
+ ),
199
+ children: l ? "Lift" : "Remove"
200
+ }
201
+ )
202
+ ]
203
+ }
204
+ ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap items-end gap-2", children: [
205
+ /* @__PURE__ */ r("label", { className: "flex flex-col gap-1", children: [
206
+ /* @__PURE__ */ t("span", { className: w, children: "Until" }),
207
+ /* @__PURE__ */ t(
208
+ "input",
209
+ {
210
+ type: "date",
211
+ "aria-label": "Frozen until",
212
+ value: s,
213
+ min: S(),
214
+ onChange: (i) => u(i.target.value),
215
+ className: F
216
+ }
217
+ )
218
+ ] }),
219
+ /* @__PURE__ */ r("label", { className: "flex min-w-[180px] flex-1 flex-col gap-1", children: [
220
+ /* @__PURE__ */ t("span", { className: w, children: "Reason people see" }),
221
+ /* @__PURE__ */ t(
222
+ "input",
223
+ {
224
+ value: p,
225
+ maxLength: 300,
226
+ placeholder: "e.g. Go-live on Monday",
227
+ onChange: (i) => f(i.target.value),
228
+ onKeyDown: (i) => {
229
+ i.key === "Enter" && o();
230
+ },
231
+ className: g(I, "h-8")
232
+ }
233
+ )
234
+ ] }),
235
+ /* @__PURE__ */ r(
236
+ "button",
237
+ {
238
+ type: "button",
239
+ className: g(b, "mb-0.5"),
240
+ disabled: !d,
241
+ "data-action": "freeze",
242
+ onClick: o,
243
+ children: [
244
+ /* @__PURE__ */ t(O, { className: "h-3.5 w-3.5" }),
245
+ "Freeze"
246
+ ]
247
+ }
248
+ )
249
+ ] }) });
250
+ }
251
+ export {
252
+ ge as ActiveDatesSetting,
253
+ Ne as FreezeSetting,
254
+ xe as PhoneVersionSetting
255
+ };