@qoretechnologies/reqraft 0.10.77 → 0.10.78-pr.145.g02bd420

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 (445) hide show
  1. package/dist/components/Description/AllowedValuesHelp.d.ts +4 -4
  2. package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -1
  3. package/dist/components/Description/AllowedValuesHelp.js +10 -7
  4. package/dist/components/Description/AllowedValuesHelp.js.map +1 -1
  5. package/dist/components/Description/index.d.ts.map +1 -1
  6. package/dist/components/Description/index.js +22 -4
  7. package/dist/components/Description/index.js.map +1 -1
  8. package/dist/components/FocusedEditing/index.d.ts.map +1 -1
  9. package/dist/components/FocusedEditing/index.js +3 -1
  10. package/dist/components/FocusedEditing/index.js.map +1 -1
  11. package/dist/components/codeSize/index.d.ts +6 -0
  12. package/dist/components/codeSize/index.d.ts.map +1 -1
  13. package/dist/components/codeSize/index.js +12 -2
  14. package/dist/components/codeSize/index.js.map +1 -1
  15. package/dist/components/colorValue/colorValue.d.ts.map +1 -1
  16. package/dist/components/colorValue/colorValue.js +27 -36
  17. package/dist/components/colorValue/colorValue.js.map +1 -1
  18. package/dist/components/composer/Composer.d.ts +18 -2
  19. package/dist/components/composer/Composer.d.ts.map +1 -1
  20. package/dist/components/composer/Composer.js +57 -29
  21. package/dist/components/composer/Composer.js.map +1 -1
  22. package/dist/components/composer/labels.d.ts +24 -0
  23. package/dist/components/composer/labels.d.ts.map +1 -0
  24. package/dist/components/composer/labels.js +16 -0
  25. package/dist/components/composer/labels.js.map +1 -0
  26. package/dist/components/dpqlEditor/dpqlTags.js +1 -1
  27. package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
  28. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  29. package/dist/components/form/engine/CompactRow.js +168 -32
  30. package/dist/components/form/engine/CompactRow.js.map +1 -1
  31. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  32. package/dist/components/form/engine/CompactToolbar.js +73 -21
  33. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  34. package/dist/components/form/engine/FormEngine.d.ts +66 -2
  35. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  36. package/dist/components/form/engine/FormEngine.js +595 -208
  37. package/dist/components/form/engine/FormEngine.js.map +1 -1
  38. package/dist/components/form/engine/ItemAttention.d.ts +12 -0
  39. package/dist/components/form/engine/ItemAttention.d.ts.map +1 -0
  40. package/dist/components/form/engine/ItemAttention.js +33 -0
  41. package/dist/components/form/engine/ItemAttention.js.map +1 -0
  42. package/dist/components/form/engine/OptionFieldMessages.d.ts +35 -2
  43. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  44. package/dist/components/form/engine/OptionFieldMessages.js +42 -6
  45. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  46. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  47. package/dist/components/form/engine/_structuredData/SchemaDataView.js +27 -1
  48. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  49. package/dist/components/form/engine/compactRowContext.d.ts +5 -0
  50. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  51. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  52. package/dist/components/form/engine/compactRowStyles.d.ts +17 -0
  53. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  54. package/dist/components/form/engine/compactRowStyles.js +99 -52
  55. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  56. package/dist/components/form/engine/compactToolbarContext.d.ts +9 -0
  57. package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
  58. package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
  59. package/dist/components/form/engine/formAppearance.d.ts +96 -0
  60. package/dist/components/form/engine/formAppearance.d.ts.map +1 -0
  61. package/dist/components/form/engine/formAppearance.js +156 -0
  62. package/dist/components/form/engine/formAppearance.js.map +1 -0
  63. package/dist/components/form/engine/readFirst.d.ts +38 -2
  64. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  65. package/dist/components/form/engine/readFirst.js +31 -6
  66. package/dist/components/form/engine/readFirst.js.map +1 -1
  67. package/dist/components/form/engine/revealRow.d.ts +13 -0
  68. package/dist/components/form/engine/revealRow.d.ts.map +1 -1
  69. package/dist/components/form/engine/revealRow.js +24 -1
  70. package/dist/components/form/engine/revealRow.js.map +1 -1
  71. package/dist/components/form/engine/rowFocus.d.ts +9 -1
  72. package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
  73. package/dist/components/form/engine/rowFocus.js +17 -4
  74. package/dist/components/form/engine/rowFocus.js.map +1 -1
  75. package/dist/components/form/engine/rowLabelled.d.ts +9 -0
  76. package/dist/components/form/engine/rowLabelled.d.ts.map +1 -0
  77. package/dist/components/form/engine/rowLabelled.js +12 -0
  78. package/dist/components/form/engine/rowLabelled.js.map +1 -0
  79. package/dist/components/form/engine/rowPlaces.d.ts +43 -0
  80. package/dist/components/form/engine/rowPlaces.d.ts.map +1 -0
  81. package/dist/components/form/engine/rowPlaces.js +163 -0
  82. package/dist/components/form/engine/rowPlaces.js.map +1 -0
  83. package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
  84. package/dist/components/form/expressions/DpqlRendering.js +4 -2
  85. package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
  86. package/dist/components/form/expressions/ExpressionField.d.ts +6 -8
  87. package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
  88. package/dist/components/form/expressions/ExpressionField.js +13 -11
  89. package/dist/components/form/expressions/ExpressionField.js.map +1 -1
  90. package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
  91. package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
  92. package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
  93. package/dist/components/form/expressions/builder/argumentLabel.d.ts +3 -1
  94. package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
  95. package/dist/components/form/expressions/builder/argumentLabel.js +66 -26
  96. package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
  97. package/dist/components/form/expressions/builder/argumentSlot.d.ts.map +1 -1
  98. package/dist/components/form/expressions/builder/argumentSlot.js +3 -2
  99. package/dist/components/form/expressions/builder/argumentSlot.js.map +1 -1
  100. package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
  101. package/dist/components/form/expressions/builder/argumentWrapper.js +10 -6
  102. package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
  103. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
  104. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +13 -8
  105. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
  106. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
  107. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +4 -2
  108. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
  109. package/dist/components/form/expressions/builder/index.d.ts +6 -1
  110. package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
  111. package/dist/components/form/expressions/builder/index.js +110 -64
  112. package/dist/components/form/expressions/builder/index.js.map +1 -1
  113. package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
  114. package/dist/components/form/expressions/builder/item.js +4 -2
  115. package/dist/components/form/expressions/builder/item.js.map +1 -1
  116. package/dist/components/form/expressions/builder/moveToPositionStrip.d.ts +1 -1
  117. package/dist/components/form/expressions/builder/moveToPositionStrip.d.ts.map +1 -1
  118. package/dist/components/form/expressions/builder/moveToPositionStrip.js +8 -7
  119. package/dist/components/form/expressions/builder/moveToPositionStrip.js.map +1 -1
  120. package/dist/components/form/expressions/builder/renderTemplate.d.ts.map +1 -1
  121. package/dist/components/form/expressions/builder/renderTemplate.js +3 -1
  122. package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
  123. package/dist/components/form/expressions/expressionOperands.js +1 -1
  124. package/dist/components/form/expressions/labels.d.ts +143 -0
  125. package/dist/components/form/expressions/labels.d.ts.map +1 -0
  126. package/dist/components/form/expressions/labels.js +123 -0
  127. package/dist/components/form/expressions/labels.js.map +1 -0
  128. package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
  129. package/dist/components/form/expressions/renderExpressionToText.js +15 -0
  130. package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
  131. package/dist/components/form/expressions/types.d.ts +1 -1
  132. package/dist/components/form/fields/ChoiceGroupHeading.d.ts +22 -0
  133. package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +1 -0
  134. package/dist/components/form/fields/ChoiceGroupHeading.js +40 -0
  135. package/dist/components/form/fields/ChoiceGroupHeading.js.map +1 -0
  136. package/dist/components/form/fields/Field.d.ts.map +1 -1
  137. package/dist/components/form/fields/Field.js +9 -5
  138. package/dist/components/form/fields/Field.js.map +1 -1
  139. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +7 -0
  140. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  141. package/dist/components/form/fields/allowed-values/AllowedValues.js +34 -10
  142. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  143. package/dist/components/form/fields/allowed-values/savedValues.d.ts +30 -0
  144. package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +1 -0
  145. package/dist/components/form/fields/allowed-values/savedValues.js +39 -0
  146. package/dist/components/form/fields/allowed-values/savedValues.js.map +1 -0
  147. package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
  148. package/dist/components/form/fields/array/ArrayAuto.js +31 -14
  149. package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
  150. package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
  151. package/dist/components/form/fields/array/ArrayAutoField.js +21 -19
  152. package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
  153. package/dist/components/form/fields/auto/AutoFormField.d.ts +5 -1
  154. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  155. package/dist/components/form/fields/auto/AutoFormField.js +41 -15
  156. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  157. package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
  158. package/dist/components/form/fields/binary/Binary.js +6 -1
  159. package/dist/components/form/fields/binary/Binary.js.map +1 -1
  160. package/dist/components/form/fields/boolean/Boolean.d.ts +7 -1
  161. package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
  162. package/dist/components/form/fields/boolean/Boolean.js +8 -2
  163. package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
  164. package/dist/components/form/fields/codeFont.d.ts +12 -0
  165. package/dist/components/form/fields/codeFont.d.ts.map +1 -0
  166. package/dist/components/form/fields/codeFont.js +26 -0
  167. package/dist/components/form/fields/codeFont.js.map +1 -0
  168. package/dist/components/form/fields/color/Color.d.ts.map +1 -1
  169. package/dist/components/form/fields/color/Color.js +9 -6
  170. package/dist/components/form/fields/color/Color.js.map +1 -1
  171. package/dist/components/form/fields/file/File.d.ts +1 -1
  172. package/dist/components/form/fields/file/File.d.ts.map +1 -1
  173. package/dist/components/form/fields/file/File.js +18 -6
  174. package/dist/components/form/fields/file/File.js.map +1 -1
  175. package/dist/components/form/fields/labels.d.ts +72 -0
  176. package/dist/components/form/fields/labels.d.ts.map +1 -0
  177. package/dist/components/form/fields/labels.js +47 -0
  178. package/dist/components/form/fields/labels.js.map +1 -0
  179. package/dist/components/form/fields/long-string/LongString.d.ts +7 -1
  180. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  181. package/dist/components/form/fields/long-string/LongString.js +15 -5
  182. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  183. package/dist/components/form/fields/markdown/Markdown.d.ts.map +1 -1
  184. package/dist/components/form/fields/markdown/Markdown.js +3 -1
  185. package/dist/components/form/fields/markdown/Markdown.js.map +1 -1
  186. package/dist/components/form/fields/number/Number.d.ts +4 -1
  187. package/dist/components/form/fields/number/Number.d.ts.map +1 -1
  188. package/dist/components/form/fields/number/Number.js +21 -7
  189. package/dist/components/form/fields/number/Number.js.map +1 -1
  190. package/dist/components/form/fields/object/Object.d.ts +9 -1
  191. package/dist/components/form/fields/object/Object.d.ts.map +1 -1
  192. package/dist/components/form/fields/object/Object.js +24 -8
  193. package/dist/components/form/fields/object/Object.js.map +1 -1
  194. package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
  195. package/dist/components/form/fields/radio-group/RadioGroup.js +13 -7
  196. package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
  197. package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
  198. package/dist/components/form/fields/rich-text/RichText.js +6 -3
  199. package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
  200. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +2 -0
  201. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -1
  202. package/dist/components/form/fields/rich-text/useTemplateTags.js +7 -1
  203. package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -1
  204. package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
  205. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +10 -8
  206. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
  207. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts +1 -1
  208. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
  209. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +39 -27
  210. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
  211. package/dist/components/form/fields/schema-definition/Hint.d.ts +4 -3
  212. package/dist/components/form/fields/schema-definition/Hint.d.ts.map +1 -1
  213. package/dist/components/form/fields/schema-definition/Hint.js +10 -2
  214. package/dist/components/form/fields/schema-definition/Hint.js.map +1 -1
  215. package/dist/components/form/fields/schema-definition/InlineValidationBanner.d.ts.map +1 -1
  216. package/dist/components/form/fields/schema-definition/InlineValidationBanner.js +3 -1
  217. package/dist/components/form/fields/schema-definition/InlineValidationBanner.js.map +1 -1
  218. package/dist/components/form/fields/schema-definition/Loader.d.ts.map +1 -1
  219. package/dist/components/form/fields/schema-definition/Loader.js +4 -2
  220. package/dist/components/form/fields/schema-definition/Loader.js.map +1 -1
  221. package/dist/components/form/fields/schema-definition/MigrationsTab.d.ts.map +1 -1
  222. package/dist/components/form/fields/schema-definition/MigrationsTab.js +31 -26
  223. package/dist/components/form/fields/schema-definition/MigrationsTab.js.map +1 -1
  224. package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
  225. package/dist/components/form/fields/schema-definition/TableEditor.js +3 -1
  226. package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
  227. package/dist/components/form/fields/schema-definition/TablesTab.d.ts.map +1 -1
  228. package/dist/components/form/fields/schema-definition/TablesTab.js +25 -23
  229. package/dist/components/form/fields/schema-definition/TablesTab.js.map +1 -1
  230. package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
  231. package/dist/components/form/fields/schema-definition/index.js +20 -14
  232. package/dist/components/form/fields/schema-definition/index.js.map +1 -1
  233. package/dist/components/form/fields/schema-definition/labels.d.ts +123 -0
  234. package/dist/components/form/fields/schema-definition/labels.d.ts.map +1 -0
  235. package/dist/components/form/fields/schema-definition/labels.js +113 -0
  236. package/dist/components/form/fields/schema-definition/labels.js.map +1 -0
  237. package/dist/components/form/fields/select/Select.d.ts +1 -1
  238. package/dist/components/form/fields/select/Select.d.ts.map +1 -1
  239. package/dist/components/form/fields/select/Select.js +13 -6
  240. package/dist/components/form/fields/select/Select.js.map +1 -1
  241. package/dist/components/form/fields/select/SelectCollection.d.ts +2 -2
  242. package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
  243. package/dist/components/form/fields/select/SelectCollection.js +11 -3
  244. package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
  245. package/dist/components/form/fields/template/ExampleValueModal.d.ts.map +1 -1
  246. package/dist/components/form/fields/template/ExampleValueModal.js +4 -1
  247. package/dist/components/form/fields/template/ExampleValueModal.js.map +1 -1
  248. package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -1
  249. package/dist/components/form/fields/template/TemplateBrowser.js +3 -1
  250. package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -1
  251. package/dist/components/form/fields/template/TemplateField.d.ts +12 -2
  252. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  253. package/dist/components/form/fields/template/TemplateField.js +71 -60
  254. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  255. package/dist/components/form/fields/template/TemplatePicker.d.ts +7 -1
  256. package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -1
  257. package/dist/components/form/fields/template/TemplatePicker.js +35 -16
  258. package/dist/components/form/fields/template/TemplatePicker.js.map +1 -1
  259. package/dist/components/form/fields/template/templatesListProps.d.ts +11 -0
  260. package/dist/components/form/fields/template/templatesListProps.d.ts.map +1 -0
  261. package/dist/components/form/fields/template/templatesListProps.js +37 -0
  262. package/dist/components/form/fields/template/templatesListProps.js.map +1 -0
  263. package/dist/components/form/index.d.ts +2 -0
  264. package/dist/components/form/index.d.ts.map +1 -1
  265. package/dist/components/form/index.js +2 -0
  266. package/dist/components/form/index.js.map +1 -1
  267. package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
  268. package/dist/components/imageLightbox/ImageLightbox.js +10 -6
  269. package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
  270. package/dist/components/log/Log.d.ts +1 -1
  271. package/dist/components/log/Log.d.ts.map +1 -1
  272. package/dist/components/log/Log.js +21 -18
  273. package/dist/components/log/Log.js.map +1 -1
  274. package/dist/components/log/labels.d.ts +25 -0
  275. package/dist/components/log/labels.d.ts.map +1 -0
  276. package/dist/components/log/labels.js +22 -0
  277. package/dist/components/log/labels.js.map +1 -0
  278. package/dist/components/menu/Menu.d.ts.map +1 -1
  279. package/dist/components/menu/Menu.js +3 -1
  280. package/dist/components/menu/Menu.js.map +1 -1
  281. package/dist/components/qonsoleSmartInput/useQonsoleSession.d.ts.map +1 -1
  282. package/dist/components/qonsoleSmartInput/useQonsoleSession.js +3 -2
  283. package/dist/components/qonsoleSmartInput/useQonsoleSession.js.map +1 -1
  284. package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -1
  285. package/dist/components/smartEditor/CompletionMenu.js +13 -6
  286. package/dist/components/smartEditor/CompletionMenu.js.map +1 -1
  287. package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
  288. package/dist/components/smartEditor/SmartEditor.js +3 -1
  289. package/dist/components/smartEditor/SmartEditor.js.map +1 -1
  290. package/dist/components/smartEditor/completionStyle.d.ts +17 -2
  291. package/dist/components/smartEditor/completionStyle.d.ts.map +1 -1
  292. package/dist/components/smartEditor/completionStyle.js +32 -4
  293. package/dist/components/smartEditor/completionStyle.js.map +1 -1
  294. package/dist/components/smartEditor/templateCompletions.js +1 -1
  295. package/dist/components/smartEditor/templateCompletions.js.map +1 -1
  296. package/dist/components/smartEditor/types.d.ts +1 -1
  297. package/dist/components/smartEditor/useLspAutocomplete.d.ts +5 -0
  298. package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
  299. package/dist/components/smartEditor/useLspAutocomplete.js +76 -20
  300. package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
  301. package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
  302. package/dist/components/supportTicket/AttachmentChips.js +4 -2
  303. package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
  304. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +3 -2
  305. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
  306. package/dist/components/supportTicket/InterfaceReferenceTags.js +6 -6
  307. package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
  308. package/dist/components/supportTicket/ReferencePicker.d.ts +3 -2
  309. package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
  310. package/dist/components/supportTicket/ReferencePicker.js +35 -25
  311. package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
  312. package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
  313. package/dist/components/supportTicket/TicketHeader.js +4 -1
  314. package/dist/components/supportTicket/TicketHeader.js.map +1 -1
  315. package/dist/components/supportTicket/TicketMetaTags.d.ts +19 -12
  316. package/dist/components/supportTicket/TicketMetaTags.d.ts.map +1 -1
  317. package/dist/components/supportTicket/TicketMetaTags.js +57 -6
  318. package/dist/components/supportTicket/TicketMetaTags.js.map +1 -1
  319. package/dist/components/supportTicket/TicketReplyBox.d.ts +3 -2
  320. package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
  321. package/dist/components/supportTicket/TicketReplyBox.js +41 -19
  322. package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
  323. package/dist/components/supportTicket/WorkspaceAccessStatus.d.ts +10 -2
  324. package/dist/components/supportTicket/WorkspaceAccessStatus.d.ts.map +1 -1
  325. package/dist/components/supportTicket/WorkspaceAccessStatus.js +45 -17
  326. package/dist/components/supportTicket/WorkspaceAccessStatus.js.map +1 -1
  327. package/dist/components/supportTicket/accessMeta.d.ts +6 -1
  328. package/dist/components/supportTicket/accessMeta.d.ts.map +1 -1
  329. package/dist/components/supportTicket/accessMeta.js +83 -65
  330. package/dist/components/supportTicket/accessMeta.js.map +1 -1
  331. package/dist/components/supportTicket/attachmentAccess.d.ts.map +1 -1
  332. package/dist/components/supportTicket/attachmentAccess.js +14 -26
  333. package/dist/components/supportTicket/attachmentAccess.js.map +1 -1
  334. package/dist/components/supportTicket/fileToAttachment.d.ts.map +1 -1
  335. package/dist/components/supportTicket/fileToAttachment.js +4 -1
  336. package/dist/components/supportTicket/fileToAttachment.js.map +1 -1
  337. package/dist/components/supportTicket/labels.d.ts +159 -0
  338. package/dist/components/supportTicket/labels.d.ts.map +1 -0
  339. package/dist/components/supportTicket/labels.js +216 -0
  340. package/dist/components/supportTicket/labels.js.map +1 -0
  341. package/dist/components/supportTicket/meta.d.ts +31 -4
  342. package/dist/components/supportTicket/meta.d.ts.map +1 -1
  343. package/dist/components/supportTicket/meta.js +98 -72
  344. package/dist/components/supportTicket/meta.js.map +1 -1
  345. package/dist/components/supportTicket/ticketAttentionInks.d.ts +23 -0
  346. package/dist/components/supportTicket/ticketAttentionInks.d.ts.map +1 -0
  347. package/dist/components/supportTicket/ticketAttentionInks.js +42 -0
  348. package/dist/components/supportTicket/ticketAttentionInks.js.map +1 -0
  349. package/dist/components/supportTicket/ticketModel.d.ts +5 -1
  350. package/dist/components/supportTicket/ticketModel.d.ts.map +1 -1
  351. package/dist/components/supportTicket/useLoadedImages.d.ts +10 -0
  352. package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
  353. package/dist/components/supportTicket/useLoadedImages.js +64 -1
  354. package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
  355. package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
  356. package/dist/components/ticketReferences/TicketReferences.js +56 -45
  357. package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
  358. package/dist/components/ticketThread/TicketThread.d.ts +22 -2
  359. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  360. package/dist/components/ticketThread/TicketThread.js +58 -36
  361. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  362. package/dist/components/ticketThread/index.d.ts +1 -1
  363. package/dist/components/ticketThread/index.d.ts.map +1 -1
  364. package/dist/components/ticketThread/index.js +2 -1
  365. package/dist/components/ticketThread/index.js.map +1 -1
  366. package/dist/helpers/allowedValues.d.ts.map +1 -1
  367. package/dist/helpers/allowedValues.js +11 -4
  368. package/dist/helpers/allowedValues.js.map +1 -1
  369. package/dist/helpers/expressions.d.ts.map +1 -1
  370. package/dist/helpers/expressions.js +7 -12
  371. package/dist/helpers/expressions.js.map +1 -1
  372. package/dist/helpers/fieldDescription.d.ts +16 -0
  373. package/dist/helpers/fieldDescription.d.ts.map +1 -0
  374. package/dist/helpers/fieldDescription.js +40 -0
  375. package/dist/helpers/fieldDescription.js.map +1 -0
  376. package/dist/helpers/markdownText.d.ts +9 -0
  377. package/dist/helpers/markdownText.d.ts.map +1 -1
  378. package/dist/helpers/markdownText.js +49 -2
  379. package/dist/helpers/markdownText.js.map +1 -1
  380. package/dist/helpers/noDescription.d.ts +4 -4
  381. package/dist/helpers/noDescription.d.ts.map +1 -1
  382. package/dist/helpers/noDescription.js +8 -6
  383. package/dist/helpers/noDescription.js.map +1 -1
  384. package/dist/helpers/optionUiTypes.d.ts +3 -3
  385. package/dist/helpers/options.d.ts +2 -2
  386. package/dist/helpers/options.d.ts.map +1 -1
  387. package/dist/helpers/options.js +11 -8
  388. package/dist/helpers/options.js.map +1 -1
  389. package/dist/helpers/qorusTypeCatalogue.d.ts +1 -1
  390. package/dist/helpers/qorusTypeCatalogue.js +1 -1
  391. package/dist/helpers/readableColors.d.ts +8 -0
  392. package/dist/helpers/readableColors.d.ts.map +1 -1
  393. package/dist/helpers/readableColors.js +12 -1
  394. package/dist/helpers/readableColors.js.map +1 -1
  395. package/dist/helpers/reqraftLabels.d.ts +83 -0
  396. package/dist/helpers/reqraftLabels.d.ts.map +1 -1
  397. package/dist/helpers/reqraftLabels.js +60 -15
  398. package/dist/helpers/reqraftLabels.js.map +1 -1
  399. package/dist/helpers/sentenceCase.d.ts +9 -0
  400. package/dist/helpers/sentenceCase.d.ts.map +1 -0
  401. package/dist/helpers/sentenceCase.js +22 -0
  402. package/dist/helpers/sentenceCase.js.map +1 -0
  403. package/dist/helpers/singleLineString.d.ts.map +1 -1
  404. package/dist/helpers/singleLineString.js +1 -0
  405. package/dist/helpers/singleLineString.js.map +1 -1
  406. package/dist/helpers/templateItems.d.ts +1 -1
  407. package/dist/helpers/templateItems.js +1 -1
  408. package/dist/helpers/templates.js +1 -1
  409. package/dist/helpers/templates.js.map +1 -1
  410. package/dist/helpers/validationLabels.d.ts +190 -0
  411. package/dist/helpers/validationLabels.d.ts.map +1 -0
  412. package/dist/helpers/validationLabels.js +210 -0
  413. package/dist/helpers/validationLabels.js.map +1 -0
  414. package/dist/helpers/validations.d.ts +14 -2
  415. package/dist/helpers/validations.d.ts.map +1 -1
  416. package/dist/helpers/validations.js +165 -178
  417. package/dist/helpers/validations.js.map +1 -1
  418. package/dist/hooks/useDestructiveButtonProps.d.ts +22 -0
  419. package/dist/hooks/useDestructiveButtonProps.d.ts.map +1 -0
  420. package/dist/hooks/useDestructiveButtonProps.js +46 -0
  421. package/dist/hooks/useDestructiveButtonProps.js.map +1 -0
  422. package/dist/hooks/useWebSocket/useWebSocket.d.ts.map +1 -1
  423. package/dist/hooks/useWebSocket/useWebSocket.js +6 -5
  424. package/dist/hooks/useWebSocket/useWebSocket.js.map +1 -1
  425. package/dist/tracking/ui/ExperimentCard.d.ts +3 -3
  426. package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
  427. package/dist/tracking/ui/ExperimentCard.js +33 -45
  428. package/dist/tracking/ui/ExperimentCard.js.map +1 -1
  429. package/dist/tracking/ui/ExperimentsOverlay.d.ts +3 -3
  430. package/dist/tracking/ui/ExperimentsOverlay.d.ts.map +1 -1
  431. package/dist/tracking/ui/ExperimentsOverlay.js +8 -6
  432. package/dist/tracking/ui/ExperimentsOverlay.js.map +1 -1
  433. package/dist/tracking/ui/card.d.ts +9 -13
  434. package/dist/tracking/ui/card.d.ts.map +1 -1
  435. package/dist/tracking/ui/card.js +96 -107
  436. package/dist/tracking/ui/card.js.map +1 -1
  437. package/dist/tracking/ui/client.d.ts +0 -6
  438. package/dist/tracking/ui/client.d.ts.map +1 -1
  439. package/dist/tracking/ui/client.js +9 -2
  440. package/dist/tracking/ui/client.js.map +1 -1
  441. package/dist/tracking/ui/labels.d.ts +198 -0
  442. package/dist/tracking/ui/labels.d.ts.map +1 -0
  443. package/dist/tracking/ui/labels.js +171 -0
  444. package/dist/tracking/ui/labels.js.map +1 -0
  445. package/package.json +1 -1
@@ -112,6 +112,7 @@ var typeChoices_1 = require("./typeChoices");
112
112
  var optionActions_1 = require("./optionActions");
113
113
  var rendererTypes_1 = require("./rendererTypes");
114
114
  var revealRow_1 = require("./revealRow");
115
+ var rowFocus_1 = require("./rowFocus");
115
116
  var emittedValues_1 = require("../fields/emittedValues");
116
117
  var lodash_1 = require("lodash");
117
118
  var map_1 = __importDefault(require("lodash/map"));
@@ -120,6 +121,7 @@ var size_1 = __importDefault(require("lodash/size"));
120
121
  var react_2 = __importStar(require("react"));
121
122
  var react_use_1 = require("react-use");
122
123
  var styled_components_1 = __importStar(require("styled-components"));
124
+ var fieldDescription_1 = require("../../../helpers/fieldDescription");
123
125
  var common_1 = require("../../../helpers/common");
124
126
  var options_1 = require("../../../helpers/options");
125
127
  var validations_1 = require("../../../helpers/validations");
@@ -143,13 +145,15 @@ var OptionFieldMessages_1 = require("./OptionFieldMessages");
143
145
  var optionsContext_1 = require("./optionsContext");
144
146
  var markdownRendererContext_1 = require("../../Description/markdownRendererContext");
145
147
  var OptionsHelpDialog_1 = require("./OptionsHelpDialog");
148
+ var formAppearance_1 = require("./formAppearance");
146
149
  var typeSentenceForm_1 = require("../typeSentenceForm");
147
150
  var referenceNames_1 = require("../fields/template/referenceNames");
148
151
  var qorusTypeCatalogue_1 = require("../../../helpers/qorusTypeCatalogue");
149
152
  var allowedValues_1 = require("../../../helpers/allowedValues");
150
- var rowFocus_1 = require("./rowFocus");
153
+ var rowFocus_2 = require("./rowFocus");
151
154
  var optionUiTypes_1 = require("../../../helpers/optionUiTypes");
152
155
  var readFirst_1 = require("./readFirst");
156
+ var rowPlaces_1 = require("./rowPlaces");
153
157
  /** One shared "nothing came down from above" bag. See `inheritedScopeFor`. */
154
158
  var NO_INHERITED_SCOPE = Object.freeze({});
155
159
  /**
@@ -672,27 +676,30 @@ var FormEngineImpl = function (_a) {
672
676
  var name = _a.name, uniqueName = _a.uniqueName, value = _a.value, onChange = _a.onChange, onSingleOptionsChange = _a.onSingleOptionsChange, onDependableOptionChange = _a.onDependableOptionChange, placeholder = _a.placeholder, noValueString = _a.noValueString, // eslint-disable-line @typescript-eslint/no-unused-vars
673
677
  isValid = _a.isValid, // eslint-disable-line @typescript-eslint/no-unused-vars
674
678
  url = _a.url, customUrl = _a.customUrl, operatorsUrl = _a.operatorsUrl, onOptionsLoaded = _a.onOptionsLoaded, recordRequiresSearchOptions = _a.recordRequiresSearchOptions, readOnly = _a.readOnly, onReadOnlyActivate = _a.onReadOnlyActivate, _h = _a.allowTemplates, allowTemplates = _h === void 0 ? true : _h, interfaceContext = _a.interfaceContext, templateFieldProps = _a.templateFieldProps, forceDropdown = _a.forceDropdown, _j = _a.showTypeToggle, showTypeToggle = _j === void 0 ? true : _j, compact = _a.compact,
679
+ // Read through the context `FormEngine` provides (resolved there against an
680
+ // inherited appearance); destructured only to keep it out of `rest`.
681
+ _appearance = _a.appearance, // eslint-disable-line @typescript-eslint/no-unused-vars
675
682
  // Destructured only to keep it out of `rest` (and so off the DOM). The gutter
676
683
  // this prop documents was never implemented: it was passed to the wrap as
677
684
  // `$flush`, whose styled template had no interpolation slot, so it has always
678
685
  // been a no-op. Removing it from the API is a separate, breaking change —
679
686
  // every consumer passing it today already gets the flush layout by default.
680
687
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
681
- _k = _a.compactFlush,
688
+ _k = _a.compactFlush, // eslint-disable-line @typescript-eslint/no-unused-vars
682
689
  // Destructured only to keep it out of `rest` (and so off the DOM). The gutter
683
690
  // this prop documents was never implemented: it was passed to the wrap as
684
691
  // `$flush`, whose styled template had no interpolation slot, so it has always
685
692
  // been a no-op. Removing it from the API is a separate, breaking change —
686
693
  // every consumer passing it today already gets the flush layout by default.
687
694
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
688
- compactFlush = _k === void 0 ? false : _k, _l = _a.compactNested, compactNested = _l === void 0 ? false : _l, _m = _a.compactScroll, compactScroll = _m === void 0 ? 'host' : _m, compactPanelProps = _a.compactPanelProps, compactCollapsedGroupsProp = _a.compactCollapsedGroups, compactBoxLabels = _a.compactBoxLabels, _o = _a.compactStickyBoxHeaders, compactStickyBoxHeaders = _o === void 0 ? true : _o, _p = _a.compactStickyOffset, compactStickyOffset = _p === void 0 ? 0 : _p, _q = _a.compactToolbar, compactToolbar = _q === void 0 ? true : _q, _r = _a.commitMode, commitMode = _r === void 0 ? 'immediate' : _r, _s = _a.expandMode, expandMode = _s === void 0 ? 'single' : _s, onCommit = _a.onCommit, operatorsProp = _a.operators, groups = _a.groups, optionsLoader = _a.optionsLoader, onValidityChange = _a.onValidityChange, optionActions = _a.optionActions, _t = _a.optionActionsCollapse, optionActionsCollapse = _t === void 0 ? 'auto' : _t, componentOverrides = _a.componentOverrides, codePreviewRenderer = _a.codePreviewRenderer, readSummaries = _a.readSummaries, cardEditorTypes = _a.cardEditorTypes,
695
+ compactFlush = _k === void 0 ? false : _k, _l = _a.compactNested, compactNested = _l === void 0 ? false : _l, _m = _a.compactScroll, compactScroll = _m === void 0 ? 'host' : _m, compactPanelProps = _a.compactPanelProps, compactCollapsedGroupsProp = _a.compactCollapsedGroups, compactBoxLabels = _a.compactBoxLabels, _o = _a.revealRequired, revealRequired = _o === void 0 ? false : _o, focusAttentionRequest = _a.focusAttentionRequest, onAttentionChange = _a.onAttentionChange, outsideAttention = _a.outsideAttention, _p = _a.compactStickyBoxHeaders, compactStickyBoxHeaders = _p === void 0 ? true : _p, _q = _a.compactStickyOffset, compactStickyOffset = _q === void 0 ? 0 : _q, _r = _a.compactToolbar, compactToolbar = _r === void 0 ? true : _r, _s = _a.commitMode, commitMode = _s === void 0 ? 'immediate' : _s, _t = _a.expandMode, expandMode = _t === void 0 ? 'single' : _t, onCommit = _a.onCommit, operatorsProp = _a.operators, groups = _a.groups, optionsLoader = _a.optionsLoader, onValidityChange = _a.onValidityChange, optionActions = _a.optionActions, _u = _a.optionActionsCollapse, optionActionsCollapse = _u === void 0 ? 'auto' : _u, componentOverrides = _a.componentOverrides, codePreviewRenderer = _a.codePreviewRenderer, readSummaries = _a.readSummaries, cardEditorTypes = _a.cardEditorTypes,
689
696
  // consumed by the wrapper below, which publishes it to every description this
690
697
  // form draws; destructured here only so it cannot reach `rest` and be spread
691
698
  // onto a DOM node
692
699
  _markdownRenderer = _a.markdownRenderer, // eslint-disable-line @typescript-eslint/no-unused-vars
693
700
  rendererOnlyUiTypes = _a.rendererOnlyUiTypes, templateAwareUiTypes = _a.templateAwareUiTypes, anyLikeUiTypes = _a.anyLikeUiTypes, inheritedFromParent = _a.inheritedFromParent, autoFocusFirstRequired = _a.autoFocusFirstRequired, expandFirstRequired = _a.expandFirstRequired, initialExpandedOptions = _a.initialExpandedOptions, expandOptionsRequest = _a.expandOptionsRequest, valueKey = _a.valueKey, maxFieldsShown = _a.maxFieldsShown,
694
701
  // The form's own props, read here and never handed on to the collection drawn below (`{...rest}`).
695
- optionsSchema = _a.options, stringTemplates = _a.stringTemplates, skeletonReason = _a.skeletonReason, rest = __rest(_a, ["name", "uniqueName", "value", "onChange", "onSingleOptionsChange", "onDependableOptionChange", "placeholder", "noValueString", "isValid", "url", "customUrl", "operatorsUrl", "onOptionsLoaded", "recordRequiresSearchOptions", "readOnly", "onReadOnlyActivate", "allowTemplates", "interfaceContext", "templateFieldProps", "forceDropdown", "showTypeToggle", "compact", "compactFlush", "compactNested", "compactScroll", "compactPanelProps", "compactCollapsedGroups", "compactBoxLabels", "compactStickyBoxHeaders", "compactStickyOffset", "compactToolbar", "commitMode", "expandMode", "onCommit", "operators", "groups", "optionsLoader", "onValidityChange", "optionActions", "optionActionsCollapse", "componentOverrides", "codePreviewRenderer", "readSummaries", "cardEditorTypes", "markdownRenderer", "rendererOnlyUiTypes", "templateAwareUiTypes", "anyLikeUiTypes", "inheritedFromParent", "autoFocusFirstRequired", "expandFirstRequired", "initialExpandedOptions", "expandOptionsRequest", "valueKey", "maxFieldsShown", "options", "stringTemplates", "skeletonReason"]);
702
+ optionsSchema = _a.options, stringTemplates = _a.stringTemplates, skeletonReason = _a.skeletonReason, rest = __rest(_a, ["name", "uniqueName", "value", "onChange", "onSingleOptionsChange", "onDependableOptionChange", "placeholder", "noValueString", "isValid", "url", "customUrl", "operatorsUrl", "onOptionsLoaded", "recordRequiresSearchOptions", "readOnly", "onReadOnlyActivate", "allowTemplates", "interfaceContext", "templateFieldProps", "forceDropdown", "showTypeToggle", "compact", "appearance", "compactFlush", "compactNested", "compactScroll", "compactPanelProps", "compactCollapsedGroups", "compactBoxLabels", "revealRequired", "focusAttentionRequest", "onAttentionChange", "outsideAttention", "compactStickyBoxHeaders", "compactStickyOffset", "compactToolbar", "commitMode", "expandMode", "onCommit", "operators", "groups", "optionsLoader", "onValidityChange", "optionActions", "optionActionsCollapse", "componentOverrides", "codePreviewRenderer", "readSummaries", "cardEditorTypes", "markdownRenderer", "rendererOnlyUiTypes", "templateAwareUiTypes", "anyLikeUiTypes", "inheritedFromParent", "autoFocusFirstRequired", "expandFirstRequired", "initialExpandedOptions", "expandOptionsRequest", "valueKey", "maxFieldsShown", "options", "stringTemplates", "skeletonReason"]);
696
703
  var feWords = (0, reqraftLabels_1.useReqraftLabels)().formEngine;
697
704
  // Built-ins + whatever the consumer declared for its own injected editors.
698
705
  var isRendererOnly = (0, react_2.useMemo)(function () { return (0, rendererTypes_1.createRendererOnlyUiTypeCheck)(rendererOnlyUiTypes); }, [JSON.stringify(rendererOnlyUiTypes)]);
@@ -718,7 +725,7 @@ var FormEngineImpl = function (_a) {
718
725
  enters the component, so the header, the chips, the messages, the meter and
719
726
  the read-first summary cannot disagree about it: every one of them reads
720
727
  `options`, and none of them has to know the rule. */
721
- var _u = (0, react_2.useState)(optionsSchema || undefined), servedOptions = _u[0], setOptions = _u[1];
728
+ var _v = (0, react_2.useState)(optionsSchema || undefined), servedOptions = _v[0], setOptions = _v[1];
722
729
  var options = (0, react_2.useMemo)(function () { return (0, options_1.resolveDegenerateRequiredGroups)(servedOptions); }, [servedOptions]);
723
730
  /* Whether the schema the form holds is the one in force: its host is not waiting behind the skeleton, and a
724
731
  schema the host hands down has been taken in (`servedOptions` follows the `options` prop a render later).
@@ -733,31 +740,47 @@ var FormEngineImpl = function (_a) {
733
740
  JSON.stringify(optionsSchema || undefined) !== JSON.stringify(servedOptions);
734
741
  var schemaInForce = !rest.skeleton && !hostSchemaPending;
735
742
  // optionsLoader lifecycle: loading feeds the skeleton gate, error the banner.
736
- var _v = (0, react_2.useState)(!!optionsLoader && !optionsSchema), optionsLoading = _v[0], setOptionsLoading = _v[1];
737
- var _w = (0, react_2.useState)(), optionsError = _w[0], setOptionsError = _w[1];
743
+ var _w = (0, react_2.useState)(!!optionsLoader && !optionsSchema), optionsLoading = _w[0], setOptionsLoading = _w[1];
744
+ var _x = (0, react_2.useState)(), optionsError = _x[0], setOptionsError = _x[1];
738
745
  // Operators: prop-provided (compact) or fetched via operatorsUrl (dpql,
739
746
  // ported from IDE Options) — the fetch overrides the seeded prop value.
740
- var _x = (0, react_2.useState)(operatorsProp), operators = _x[0], setOperators = _x[1];
747
+ var _y = (0, react_2.useState)(operatorsProp), operators = _y[0], setOperators = _y[1];
741
748
  // Remote-fetch loading (ported from IDE Options); only relevant when one of
742
749
  // the fetch urls is set — schema-as-props consumers never see the skeleton.
743
- var _y = (0, react_2.useState)(!!(url || customUrl || operatorsUrl)), loading = _y[0], setLoading = _y[1];
750
+ var _z = (0, react_2.useState)(!!(url || customUrl || operatorsUrl)), loading = _z[0], setLoading = _z[1];
744
751
  var confirmAction = (0, reqore_1.useReqoreProperty)('confirmAction');
745
752
  var theme = (0, reqore_1.useReqoreTheme)();
746
- var _z = (0, react_2.useState)(), focusedEditing = _z[0], setFocusedEditing = _z[1];
747
- var _0 = (0, react_2.useState)(false), showFieldTypes = _0[0], setShowFieldTypes = _0[1];
753
+ var calm = (0, formAppearance_1.useIsCalmForm)();
754
+ var _0 = (0, react_2.useState)(), focusedEditing = _0[0], setFocusedEditing = _0[1];
755
+ var _1 = (0, react_2.useState)(false), showFieldTypes = _1[0], setShowFieldTypes = _1[1];
748
756
  // Global toggle (toolbar ⓘ): reveal the short-description info panel on every
749
757
  // field that has a short_desc. Per-row ⓘ overrides still win over it.
750
758
  // Global field-info visibility, tri-state: `undefined` = default (critical
751
759
  // messages auto-open, the rest closed); `true` = show all; `false` = hide all
752
760
  // (even message fields). The toolbar ⓘ drives it.
753
- var _1 = (0, react_2.useState)(undefined), showAllDescriptions = _1[0], setShowAllDescriptions = _1[1];
754
- var _2 = (0, react_2.useState)(), showHelpForOption = _2[0], setShowHelpForOption = _2[1];
755
- var _3 = (0, react_2.useState)(false), showInvalidOptionsOnly = _3[0], setShowInvalidOptionsOnly = _3[1];
761
+ var _2 = (0, react_2.useState)(undefined), showAllDescriptions = _2[0], setShowAllDescriptions = _2[1];
762
+ var _3 = (0, react_2.useState)(), showHelpForOption = _3[0], setShowHelpForOption = _3[1];
763
+ var _4 = (0, react_2.useState)(false), showInvalidOptionsOnly = _4[0], setShowInvalidOptionsOnly = _4[1];
756
764
  // Which options are expanded into their editor (several can be open at once).
757
- var _4 = (0, react_2.useState)([]), expandedOptions = _4[0], setExpandedOptions = _4[1];
765
+ var _5 = (0, react_2.useState)([]), expandedOptions = _5[0], setExpandedOptions = _5[1];
766
+ // The fields the person has opened and left. An empty required field becomes a
767
+ // fault only then (or after a submit attempt, `revealRequired`): a form nobody has
768
+ // touched is not already wrong.
769
+ var _6 = (0, react_2.useState)([]), visitedOptions = _6[0], setVisitedOptions = _6[1];
770
+ var lastExpandedOptions = (0, react_2.useRef)([]);
771
+ (0, react_2.useEffect)(function () {
772
+ var left = lastExpandedOptions.current.filter(function (name) { return !expandedOptions.includes(name); });
773
+ lastExpandedOptions.current = expandedOptions;
774
+ if (left.length) {
775
+ setVisitedOptions(function (prev) {
776
+ var added = left.filter(function (name) { return !prev.includes(name); });
777
+ return added.length ? __spreadArray(__spreadArray([], prev, true), added, true) : prev;
778
+ });
779
+ }
780
+ }, [expandedOptions]);
758
781
  /** Status boxes whose "N more fields" control the reader has opened. Keyed by
759
782
  box so opening Optional does not also unfold Set. */
760
- var _5 = (0, react_2.useState)([]), expandedMoreBoxes = _5[0], setExpandedMoreBoxes = _5[1];
783
+ var _7 = (0, react_2.useState)([]), expandedMoreBoxes = _7[0], setExpandedMoreBoxes = _7[1];
761
784
  // --- Reveal a status box's content when it is opened ----------------------
762
785
  //
763
786
  // The status boxes stack, so the last one ("Optional", which holds every
@@ -773,7 +796,7 @@ var FormEngineImpl = function (_a) {
773
796
  // box has not grown and there is nothing to scroll to. A layout effect runs
774
797
  // after the DOM is updated and before paint, which makes the reveal
775
798
  // deterministic instead of a guessed delay.
776
- var _6 = (0, react_2.useState)(undefined), openedStatusBox = _6[0], setOpenedStatusBox = _6[1];
799
+ var _8 = (0, react_2.useState)(undefined), openedStatusBox = _8[0], setOpenedStatusBox = _8[1];
777
800
  var statusBoxRefs = (0, react_2.useRef)({});
778
801
  (0, react_2.useLayoutEffect)(function () {
779
802
  var _a, _b;
@@ -802,15 +825,19 @@ var FormEngineImpl = function (_a) {
802
825
  // stays put when its status flips (e.g. becomes valid) instead of jumping to
803
826
  // another box mid-edit and stealing focus. Keyed by option name.
804
827
  var settledBucket = (0, react_2.useRef)({});
828
+ // Each row's own node, drawn into once and moved between the boxes (`rowPlaces`)
829
+ var rowHosts = (0, rowPlaces_1.useRowHosts)();
830
+ // Which boxes are open, so a collapsed box's rows are not drawn (`rowPlaces`)
831
+ var openBoxes = (0, rowPlaces_1.useOpenBoxes)();
805
832
  // Measured form width (not viewport — the form lives in drawers/panels of
806
833
  // arbitrary width) drives the stacked narrow layout.
807
- var _7 = (0, react_use_1.useMeasure)(), compactWrapRef = _7[0], compactWrapWidth = _7[1].width;
834
+ var _9 = (0, react_use_1.useMeasure)(), compactWrapRef = _9[0], compactWrapWidth = _9[1].width;
808
835
  // Own handle on the scroll wrap (useMeasure's ref is a callback, no `.current`)
809
836
  // so the label-column measurement can publish its CSS var on the element. It's
810
837
  // STATE, not a ref: the wrap mounts only after the loading-skeleton gate
811
838
  // resolves, so the measurement effect must re-run when the node appears — a
812
839
  // ref wouldn't retrigger it.
813
- var _8 = (0, react_2.useState)(null), compactWrapNode = _8[0], setCompactWrapNode = _8[1];
840
+ var _10 = (0, react_2.useState)(null), compactWrapNode = _10[0], setCompactWrapNode = _10[1];
814
841
  // Ref mirror of the wrap node for callbacks that must not re-create when it
815
842
  // mounts (flashOptions reads it inside a rAF).
816
843
  var compactWrapNodeRef = (0, react_2.useRef)(null);
@@ -826,10 +853,28 @@ var FormEngineImpl = function (_a) {
826
853
  /* The label column the rows are laid out with: measured from the labels (see below), the
827
854
  default until it is. A form stacks its rows where its value column would be too narrow
828
855
  beside it (`isCompactNarrow`), not at one form width whatever its labels are. */
829
- var _9 = (0, react_2.useState)(compactRowStyles_1.COMPACT_LABEL_COL), compactLabelColumn = _9[0], setCompactLabelColumn = _9[1];
856
+ var _11 = (0, react_2.useState)(compactRowStyles_1.COMPACT_LABEL_COL), compactLabelColumn = _11[0], setCompactLabelColumn = _11[1];
830
857
  // the label column holds a finger's help button where the pointer is a finger (`labelAffordanceWidth`)
831
858
  var coarsePointer = (0, useCoarsePointer_1.useCoarsePointer)();
832
- var compactNarrow = !!compactWrapWidth && (0, compactRowStyles_1.isCompactNarrow)(compactWrapWidth, compactLabelColumn);
859
+ /* The wrap's width as it is laid out the moment it mounts, read before it is first drawn.
860
+ `useMeasure` reports only from a ResizeObserver, after the browser's next layout, so until
861
+ then the width was 0 and a narrow form drew its first frames as a wide one: on a 190px form
862
+ a 220px name column, and the editor of an open row in a 0px column past the row's right edge.
863
+ Anything opened in those frames was laid out there - a picker focused as the form appeared
864
+ had its list closed as hidden (board f63). The observer's figure takes over once it has one. */
865
+ var _12 = (0, react_2.useState)(0), mountedWrapWidth = _12[0], setMountedWrapWidth = _12[1];
866
+ (0, react_2.useLayoutEffect)(function () {
867
+ if (!compactWrapNode) {
868
+ return;
869
+ }
870
+ var style = getComputedStyle(compactWrapNode);
871
+ var contentWidth = compactWrapNode.clientWidth -
872
+ (parseFloat(style.paddingLeft) || 0) -
873
+ (parseFloat(style.paddingRight) || 0);
874
+ setMountedWrapWidth(function (current) { return (current === contentWidth ? current : contentWidth); });
875
+ }, [compactWrapNode]);
876
+ var compactLaidOutWidth = compactWrapWidth || mountedWrapWidth;
877
+ var compactNarrow = !!compactLaidOutWidth && (0, compactRowStyles_1.isCompactNarrow)(compactLaidOutWidth, compactLabelColumn);
833
878
  /* How much pinned chrome sits above a status-box header.
834
879
 
835
880
  Sticky offsets do not compose on their own: everything pinned in one
@@ -844,7 +889,7 @@ var FormEngineImpl = function (_a) {
844
889
  a search row and a field picker that each hide themselves when they have
845
890
  nothing to say, and what is left wraps differently at every form width.
846
891
  Zero when this form draws no toolbar at all. */
847
- var _10 = (0, react_2.useState)(0), compactToolbarHeight = _10[0], setCompactToolbarHeight = _10[1];
892
+ var _13 = (0, react_2.useState)(0), compactToolbarHeight = _13[0], setCompactToolbarHeight = _13[1];
848
893
  (0, react_2.useLayoutEffect)(function () {
849
894
  var wrap = compactWrapNode;
850
895
  if (!compact || !wrap || compactNested || !compactStickyBoxHeaders) {
@@ -865,7 +910,11 @@ var FormEngineImpl = function (_a) {
865
910
  header's height below the top edge with nothing under it. Read from
866
911
  the element rather than from the props that produced it, so every
867
912
  route to that decision is accounted for. */
868
- var pinned = getComputedStyle(header).position === 'sticky';
913
+ /* A Reqore that pins a header only while its panel is clearly taller than its scroller
914
+ (decision 028, reqore#715) says whether it pins in `data-pins-header`, and decides it
915
+ after it has measured, so the toolbar was not sticky yet when this first read it. */
916
+ var says = header.getAttribute('data-pins-header');
917
+ var pinned = says !== null ? says === 'true' : getComputedStyle(header).position === 'sticky';
869
918
  var next = pinned ? Math.round(header.getBoundingClientRect().height) : 0;
870
919
  return prev === next ? prev : next;
871
920
  });
@@ -873,17 +922,53 @@ var FormEngineImpl = function (_a) {
873
922
  read();
874
923
  /* jsdom and older engines have no ResizeObserver; the one-shot read above
875
924
  still gives the right answer for a form whose toolbar never reflows. */
876
- if (typeof ResizeObserver === 'undefined') {
877
- return undefined;
878
- }
879
- var observer = new ResizeObserver(read);
880
- observer.observe(header);
881
- return function () { return observer.disconnect(); };
925
+ var observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(read);
926
+ observer === null || observer === void 0 ? void 0 : observer.observe(header);
927
+ /* The pin can change without the toolbar's size changing: Reqore measures first and pins
928
+ after, and pins no more once the form is short. */
929
+ var pinWatch = typeof MutationObserver === 'undefined' ? undefined : new MutationObserver(read);
930
+ pinWatch === null || pinWatch === void 0 ? void 0 : pinWatch.observe(header, { attributes: true, attributeFilter: ['data-pins-header'] });
931
+ return function () {
932
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
933
+ pinWatch === null || pinWatch === void 0 ? void 0 : pinWatch.disconnect();
934
+ };
882
935
  /* `compactNarrow` is a dependency, not decoration: crossing the width
883
936
  breakpoint takes the pin OFF the toolbar without changing its height, so
884
937
  the ResizeObserver never fires and a stale 124px would go on offsetting
885
938
  the box headers below a toolbar that is no longer there. */
886
939
  }, [compact, compactNested, compactStickyBoxHeaders, compactNarrow, compactWrapNode, options]);
940
+ /* The color a calm form sits on, for its pinned toolbar's glass.
941
+
942
+ A calm form has no surface of its own, so the toolbar has to paint one to
943
+ keep the rows that scroll under it from showing through the meter and the
944
+ search — and it has to be the host's color, or it draws a band across the
945
+ form before anything has moved. The host is whatever paints first above the
946
+ form: the page, a drawer's panel surface, a card. Read once it mounts (and
947
+ when the theme changes), not assumed from the theme's main color. */
948
+ var _14 = (0, react_2.useState)(), compactHostColour = _14[0], setCompactHostColour = _14[1];
949
+ (0, react_2.useLayoutEffect)(function () {
950
+ if (!calm || !compact || compactNested || !compactWrapNode) {
951
+ setCompactHostColour(undefined);
952
+ return;
953
+ }
954
+ var _loop_1 = function (node) {
955
+ var _a = (getComputedStyle(node).backgroundColor.match(/[\d.]+/g) || [])
956
+ .slice(0, 4)
957
+ .map(Number), r = _a[0], g = _a[1], b = _a[2], _b = _a[3], alpha = _b === void 0 ? 1 : _b;
958
+ if (alpha > 0 && b !== undefined) {
959
+ setCompactHostColour(function (prev) {
960
+ return (prev === null || prev === void 0 ? void 0 : prev[0]) === r && (prev === null || prev === void 0 ? void 0 : prev[1]) === g && (prev === null || prev === void 0 ? void 0 : prev[2]) === b ? prev : [r, g, b];
961
+ });
962
+ return { value: void 0 };
963
+ }
964
+ };
965
+ for (var node = compactWrapNode.parentElement; node; node = node.parentElement) {
966
+ var state_1 = _loop_1(node);
967
+ if (typeof state_1 === "object")
968
+ return state_1.value;
969
+ }
970
+ setCompactHostColour(undefined);
971
+ }, [calm, compact, compactNested, compactWrapNode, theme]);
887
972
  // Global label-column sizing: size the label column to the WIDEST field label
888
973
  // across the whole form, clamped to [MIN, MAX], and publish it as a CSS var on
889
974
  // the scroll wrap. Both the grid column and the value-surface offsets read the
@@ -932,8 +1017,8 @@ var FormEngineImpl = function (_a) {
932
1017
  var readRowHeights = (0, react_2.useRef)({});
933
1018
  // Required-groups linkage: hovering a group chip highlights every member row;
934
1019
  // clicking a sibling in the chip's popover scrolls to it and flashes it.
935
- var _11 = (0, react_2.useState)([]), highlightedOptions = _11[0], setHighlightedOptions = _11[1];
936
- var _12 = (0, react_2.useState)([]), flashedOptions = _12[0], setFlashedOptions = _12[1];
1020
+ var _15 = (0, react_2.useState)([]), highlightedOptions = _15[0], setHighlightedOptions = _15[1];
1021
+ var _16 = (0, react_2.useState)([]), flashedOptions = _16[0], setFlashedOptions = _16[1];
937
1022
  var flashTimeout = (0, react_2.useRef)();
938
1023
  var flashOptions = (0, react_2.useCallback)(function (optionNames, scrollToFirst) {
939
1024
  if (scrollToFirst === void 0) { scrollToFirst = false; }
@@ -968,33 +1053,34 @@ var FormEngineImpl = function (_a) {
968
1053
  // Follow a field across panels: when its status bucket changes — e.g. you fill
969
1054
  // an optional field and it jumps to Set / Needs attention — scroll to its new
970
1055
  // row and flash it so it's easy to keep track of. `settledBucket` holds each
971
- // field's current panel (frozen while the field is being edited, it re-buckets
972
- // on collapse), so diffing it after every render catches the move the instant it
973
- // lands in the new panel. Runs every render; the diff is cheap and only fires a
974
- // scroll on an ACTUAL move of a non-expanded field.
1056
+ // field's current panel, so diffing it after every render catches the move the
1057
+ // instant it lands in the new panel. A field being edited moves as its value
1058
+ // does - the first character typed into an empty required field takes it to Set,
1059
+ // the caret with it (`rowPlaces`) - and is followed the same way. Runs every
1060
+ // render; the diff is cheap and only fires a scroll on an ACTUAL move.
975
1061
  var prevSettledBucket = (0, react_2.useRef)({});
976
1062
  (0, react_2.useEffect)(function () {
977
1063
  if (!compact)
978
1064
  return;
979
1065
  var cur = settledBucket.current;
980
1066
  var prev = prevSettledBucket.current;
981
- var moved = Object.keys(cur).find(function (name) { return prev[name] && prev[name] !== cur[name] && !expandedOptions.includes(name); });
1067
+ var moved = Object.keys(cur).find(function (name) { return prev[name] && prev[name] !== cur[name]; });
982
1068
  prevSettledBucket.current = __assign({}, cur);
983
1069
  if (moved) {
984
1070
  flashOptions([moved], true);
985
1071
  }
986
1072
  });
987
1073
  // Info panels auto-open on Tier-1 content; the per-row user override sticks.
988
- var _13 = (0, react_2.useState)({}), infoPanelOverrides = _13[0], setInfoPanelOverrides = _13[1];
1074
+ var _17 = (0, react_2.useState)({}), infoPanelOverrides = _17[0], setInfoPanelOverrides = _17[1];
989
1075
  // Toolbar filters affect the listed rows only — the meter reflects the full set.
990
- var _14 = (0, react_2.useState)(false), requiredOnly = _14[0], setRequiredOnly = _14[1];
991
- var _15 = (0, react_2.useState)(''), compactQuery = _15[0], setCompactQuery = _15[1];
1076
+ var _18 = (0, react_2.useState)(false), requiredOnly = _18[0], setRequiredOnly = _18[1];
1077
+ var _19 = (0, react_2.useState)(''), compactQuery = _19[0], setCompactQuery = _19[1];
992
1078
  // Compact field sort (Fields menu → "Sort by"); 'schema' = declared order.
993
- var _16 = (0, react_2.useState)('schema'), compactSort = _16[0], setCompactSort = _16[1];
994
- var _17 = (0, react_2.useState)(function () { return ({
1079
+ var _20 = (0, react_2.useState)('schema'), compactSort = _20[0], setCompactSort = _20[1];
1080
+ var _21 = (0, react_2.useState)(function () { return ({
995
1081
  fields: (0, exports.fixOptions)(value, options || {}, undefined, isRendererOnly),
996
1082
  meta: undefined,
997
- }); }), localValue = _17[0], setLocalValue = _17[1];
1083
+ }); }), localValue = _21[0], setLocalValue = _21[1];
998
1084
  var originalValue = (0, react_2.useRef)();
999
1085
  // Track the last value we emitted via onChange so we can skip re-applying fixOptions
1000
1086
  // when the parent echoes it back as the new value prop (controlled component loop prevention)
@@ -1052,7 +1138,7 @@ var FormEngineImpl = function (_a) {
1052
1138
  originalValue.current = localValue.fields;
1053
1139
  }
1054
1140
  var unavailableOptionsCount = (0, react_2.useRef)(0);
1055
- var _18 = (0, useQorusTypes_1.useQorusTypes)(), compactValue = _18.compactValue, typesLoading = _18.loading;
1141
+ var _22 = (0, useQorusTypes_1.useQorusTypes)(), compactValue = _22.compactValue, typesLoading = _22.loading;
1056
1142
  // an option's type in words, while the form shows field types (qorus#646: it said the type's code, `<string>`)
1057
1143
  var typeName = (0, typeSentenceForm_1.useTypeName)();
1058
1144
  var templates = (0, useTemplates_1.useTemplates)(allowTemplates, stringTemplates, interfaceContext);
@@ -1795,6 +1881,11 @@ var FormEngineImpl = function (_a) {
1795
1881
  return newValue;
1796
1882
  }
1797
1883
  if (showInvalidOptionsOnly &&
1884
+ // An open row stays while the reader is in it, as its box does
1885
+ // (`stableBucketOf`): the first character typed into an empty required
1886
+ // field makes it valid, and hiding it then would pull the field out
1887
+ // from under the caret mid-word.
1888
+ !expandedOptions.includes(optionName) &&
1798
1889
  isOptionValid(optionName, (0, exports.getOptionFieldStorageType)(optionName, option.type, options, operators, option.op, isRendererOnly, optionHoldsExpression(option)), option.value)) {
1799
1890
  return newValue;
1800
1891
  }
@@ -1803,6 +1894,7 @@ var FormEngineImpl = function (_a) {
1803
1894
  }, [
1804
1895
  dependencyLockedNames,
1805
1896
  showInvalidOptionsOnly,
1897
+ expandedOptions,
1806
1898
  isRendererOnly,
1807
1899
  JSON.stringify(availableOptions),
1808
1900
  JSON.stringify(options),
@@ -1858,8 +1950,17 @@ var FormEngineImpl = function (_a) {
1858
1950
  covered: covered,
1859
1951
  invalid: invalid,
1860
1952
  warned: msgIntent === 'warning',
1953
+ // a one-of member, once anyone has been to its group (`hasBeenToTheField`)
1954
+ visited: (0, readFirst_1.hasBeenToTheField)(name, {
1955
+ visitedOptions: visitedOptions,
1956
+ revealRequired: revealRequired,
1957
+ requiredGroups: reqGroups,
1958
+ groupMembers: requiredGroupsInfo.members,
1959
+ }),
1861
1960
  });
1862
1961
  }, [
1962
+ revealRequired,
1963
+ visitedOptions,
1863
1964
  isRendererOnly,
1864
1965
  JSON.stringify(options),
1865
1966
  JSON.stringify(availableOptions),
@@ -1889,6 +1990,37 @@ var FormEngineImpl = function (_a) {
1889
1990
  // a hidden field (its `depends_on` does not hold) is not in the form, nor in its counts
1890
1991
  function (name) { return !dependencyLockedNames.includes(name) && getOptionBucket(name) === 'attention'; }).length;
1891
1992
  }, [JSON.stringify(availableOptions), getOptionBucket, dependencyLockedNames]);
1993
+ // How many of those are faults rather than only still to fill in (`pending`). Zero
1994
+ // on a new form, so its first box reads "To fill in" without amber.
1995
+ var readFirstAttentionFaultCount = (0, react_2.useMemo)(function () {
1996
+ return Object.keys(availableOptions || {}).filter(function (name) { return getOptionBucket(name) === 'attention' && getOptionStatus(name) !== 'pending'; }).length;
1997
+ }, [JSON.stringify(availableOptions), getOptionBucket, getOptionStatus]);
1998
+ /* Fields whose value fails but that are not in the first box: an optional field its host says is wrong
1999
+ (`invalid_reason`) stays among the optional ones. They make the form "Incomplete", so the readiness line counts
2000
+ them with the faults: it said "Incomplete" and nothing else, with nothing to tell the reader what. */
2001
+ var readFirstFaultsOutsideBox = (0, react_2.useMemo)(function () {
2002
+ return validityData.invalidFields.filter(function (_a) {
2003
+ var fieldName = _a.fieldName;
2004
+ return !!(availableOptions === null || availableOptions === void 0 ? void 0 : availableOptions[fieldName]) &&
2005
+ !dependencyLockedNames.includes(fieldName) &&
2006
+ getOptionBucket(fieldName) !== 'attention';
2007
+ }).length;
2008
+ }, [validityData, JSON.stringify(availableOptions), dependencyLockedNames, getOptionBucket]);
2009
+ // The same two numbers, to a host that draws its own submit control from them.
2010
+ var onAttentionChangeRef = (0, react_2.useRef)(onAttentionChange);
2011
+ onAttentionChangeRef.current = onAttentionChange;
2012
+ // What the host found wrong outside the fields: in the line and in what the host is told.
2013
+ var outsideAttentionCount = Math.max(0, (_b = outsideAttention === null || outsideAttention === void 0 ? void 0 : outsideAttention.count) !== null && _b !== void 0 ? _b : 0);
2014
+ (0, react_2.useEffect)(function () {
2015
+ var _a;
2016
+ /* The line's numbers, to the one: a field its host says is wrong outside the first box (`readFirstFaultsOutsideBox`)
2017
+ is counted in the line, and so in what the host is told - the host's submit read ready while the line said
2018
+ "Incomplete · 1 need attention". */
2019
+ (_a = onAttentionChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onAttentionChangeRef, {
2020
+ count: readFirstAttentionCount + readFirstFaultsOutsideBox + outsideAttentionCount,
2021
+ faults: readFirstAttentionFaultCount + readFirstFaultsOutsideBox + outsideAttentionCount,
2022
+ });
2023
+ }, [readFirstAttentionCount, readFirstAttentionFaultCount, readFirstFaultsOutsideBox, outsideAttentionCount]);
1892
2024
  var getIntent = (0, react_2.useCallback)(
1893
2025
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
1894
2026
  function (optName, type, optValue, _op) {
@@ -2159,7 +2291,7 @@ var FormEngineImpl = function (_a) {
2159
2291
  }
2160
2292
  hasAutoFocusedRef.current = true;
2161
2293
  var entered = event.target;
2162
- if ((0, rowFocus_1.isTypingControl)(entered)) {
2294
+ if ((0, rowFocus_2.isTypingControl)(entered)) {
2163
2295
  return;
2164
2296
  }
2165
2297
  var target = firstAttentionRow();
@@ -2187,6 +2319,48 @@ var FormEngineImpl = function (_a) {
2187
2319
  compactWrapNode.removeEventListener('focusin', onFocusIn);
2188
2320
  };
2189
2321
  }, [autoFocusFirstRequired, compact, compactWrapNode]);
2322
+ // A submit that could not go is answered with where to type: each new
2323
+ // `focusAttentionRequest` opens the first field that needs attention and puts the
2324
+ // caret in it. The host's submit button holds the caret at that moment, and an open
2325
+ // row never takes a caret held outside it (CompactRow), so the button lets go of it
2326
+ // here first; the person asked to submit, and this is the answer to that. It picks
2327
+ // the field the arrival scan above would (`firstAttentionRow`), and spends that scan:
2328
+ // the person has been taken to a field now.
2329
+ var lastFocusRequest = (0, react_2.useRef)(focusAttentionRequest);
2330
+ (0, react_2.useEffect)(function () {
2331
+ var _a;
2332
+ if (focusAttentionRequest === lastFocusRequest.current) {
2333
+ return;
2334
+ }
2335
+ lastFocusRequest.current = focusAttentionRequest;
2336
+ if (!focusAttentionRequest || !compact || !options) {
2337
+ return;
2338
+ }
2339
+ var target = firstAttentionRow();
2340
+ if (!target) {
2341
+ return;
2342
+ }
2343
+ hasAutoFocusedRef.current = true;
2344
+ var wrap = compactWrapNodeRef.current;
2345
+ var active = document.activeElement;
2346
+ if (active && active !== document.body && !(wrap === null || wrap === void 0 ? void 0 : wrap.contains(active))) {
2347
+ active.blur();
2348
+ }
2349
+ if (!expandedOptions.includes(target)) {
2350
+ // The row's own open effect reveals it and takes the caret.
2351
+ openFirstAttentionRow(target);
2352
+ return;
2353
+ }
2354
+ // Already open (the field the form opened on arrival): its open effect has run,
2355
+ // so the caret goes to its control here.
2356
+ var row = wrap === null || wrap === void 0 ? void 0 : wrap.querySelector("[data-field=\"".concat(target, "\"]"));
2357
+ if (row) {
2358
+ (0, revealRow_1.revealRow)(row, 'auto');
2359
+ (_a = (0, rowFocus_1.findRowFocusTarget)(row.querySelector('.options-readfirst-row-editor'), {
2360
+ textEntryOnly: row.classList.contains('options-readfirst-card'),
2361
+ })) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
2362
+ }
2363
+ }, [focusAttentionRequest]);
2190
2364
  // Read-first completion summary (how many shown options have a value set),
2191
2365
  // surfaced as a progress meter at the top of the compact form.
2192
2366
  var readFirstCompletion = (0, react_2.useMemo)(function () {
@@ -2362,7 +2536,7 @@ var FormEngineImpl = function (_a) {
2362
2536
  return null;
2363
2537
  var items = schemaMsgs.map(function (_a, index) {
2364
2538
  var intent = _a.intent, title = _a.title, content = _a.content;
2365
- return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: intent, title: title, opaque: false, size: 'small',
2539
+ return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: (0, formAppearance_1.calmNoteIntent)(intent, calm), title: title, opaque: false, size: 'small',
2366
2540
  // Compact: flat (no border) to match the read-row info panels;
2367
2541
  // classic forms keep the bordered, bottom-margined message.
2368
2542
  flat: compact || undefined, margin: compact ? undefined : 'bottom', children: content }, title || index));
@@ -2462,7 +2636,10 @@ var FormEngineImpl = function (_a) {
2462
2636
  readOnly ||
2463
2637
  !(0, validations_1.hasAllDependenciesFullfilled)((_v = options === null || options === void 0 ? void 0 : options[optionName]) === null || _v === void 0 ? void 0 : _v.depends_on, availableOptions, options || {}), readOnly: readOnly, size: editorSize || rest.size, menuItems: (0, typeChoices_1.offersTypeChoices)(options === null || options === void 0 ? void 0 : options[optionName], anyLikeUiTypes) ?
2464
2638
  getCustomMenuTemplateItems(optionName)
2465
- : undefined }, templateFieldProps, { forceDropdown: effectiveForceDropdown })), (0, jsx_runtime_1.jsx)(OptionFieldMessages_1.OptionFieldMessages, { schema: options || {}, allOptions: availableOptions, name: optionName, option: __assign({ type: resolvedType }, other), getType: getTypeForOption, isRendererOnly: isRendererOnly }), operators && (0, size_1.default)(operators) && (0, size_1.default)(other.op) ?
2639
+ : undefined }, templateFieldProps, { forceDropdown: effectiveForceDropdown })), (0, jsx_runtime_1.jsx)(OptionFieldMessages_1.OptionFieldMessages, { schema: options || {}, allOptions: availableOptions, name: optionName, option: __assign({ type: resolvedType }, other), getType: getTypeForOption, isRendererOnly: isRendererOnly,
2640
+ // Open is not left: a field the form opened for typing (the first empty
2641
+ // one, on a new form) says what it needs without already being wrong.
2642
+ requirementPending: !(revealRequired || visitedOptions.includes(optionName)) }), operators && (0, size_1.default)(operators) && (0, size_1.default)(other.op) ?
2466
2643
  (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 5 }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', className: 'options-operator-summary', children: (0, operatorSummary_1.operatorSummary)({
2467
2644
  label: (optionSchema === null || optionSchema === void 0 ? void 0 : optionSchema.display_name) || optionName,
2468
2645
  operatorKeys: operatorParts,
@@ -2496,10 +2673,12 @@ var FormEngineImpl = function (_a) {
2496
2673
  getTypeForOption,
2497
2674
  inheritedScopes,
2498
2675
  inheritedFromParent,
2676
+ revealRequired,
2677
+ visitedOptions,
2499
2678
  ]);
2500
2679
  // Compact (read-first) rendering.
2501
2680
  // Theme-derived colors so the flat-row layout adapts to light/dark/custom themes.
2502
- var cText = ((_b = theme === null || theme === void 0 ? void 0 : theme.text) === null || _b === void 0 ? void 0 : _b.color) || '#f1f0ee';
2681
+ var cText = (0, formAppearance_1.getThemeTextColour)(theme, '#f1f0ee');
2503
2682
  // Text emphasis tiers via reqore's readable-color helper (key = full readable
2504
2683
  // text, muted = its dimmed variant, faint = the dimmed variant softened
2505
2684
  // further) instead of hand-rolled hex-alpha suffixes on the raw text color.
@@ -2508,8 +2687,10 @@ var FormEngineImpl = function (_a) {
2508
2687
  var cFaint = "".concat(cMuted, "99");
2509
2688
  var cDivider = "".concat(cText, "14");
2510
2689
  var cHover = "".concat(cText, "0d");
2511
- var cDanger = ((_c = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _c === void 0 ? void 0 : _c.danger) || '#e35a5a';
2512
- var cWarning = ((_d = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _d === void 0 ? void 0 : _d.warning) || '#ffdf34';
2690
+ // Calm: the intents as words that read on the section surface, not the
2691
+ // theme's fills (see `getCalmIntentText`). Dots and edges take them too.
2692
+ var cDanger = calm ? (0, formAppearance_1.getCalmIntentText)(theme, 'danger') : ((_c = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _c === void 0 ? void 0 : _c.danger) || '#e35a5a';
2693
+ var cWarning = calm ? (0, formAppearance_1.getCalmIntentText)(theme, 'warning') : ((_d = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _d === void 0 ? void 0 : _d.warning) || '#ffdf34';
2513
2694
  var cInfo = ((_f = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _f === void 0 ? void 0 : _f.info) || '#3b8eea';
2514
2695
  var cSuccess = ((_g = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _g === void 0 ? void 0 : _g.success) || '#36b37e';
2515
2696
  // the rows' own words and marks, in colors that read on every surface a row is drawn on
@@ -2527,6 +2708,10 @@ var FormEngineImpl = function (_a) {
2527
2708
  // The "N more fields" row's dashed edge. Well above the divider tint: this
2528
2709
  // one is an affordance the reader has to notice, not a hairline between rows.
2529
2710
  var cMoreBorder = "".concat(cText, "4d");
2711
+ // Calm: the section surface and its hairline, from the theme's panel (the
2712
+ // same surface and edge Reqore gives the section panels themselves).
2713
+ var cPanel = (0, formAppearance_1.getCalmPanelSurface)(theme);
2714
+ var cHairline = (0, formAppearance_1.getCalmPanelHairline)(theme);
2530
2715
  // The closure surface the extracted CompactRow reads through context. Refs and
2531
2716
  // setters are stable; the state/memo/handler fields change identity as they do
2532
2717
  // today, so a row re-renders exactly when its inputs do.
@@ -2546,6 +2731,8 @@ var FormEngineImpl = function (_a) {
2546
2731
  cardEditorTypes: cardEditorTypes,
2547
2732
  showAllDescriptions: showAllDescriptions,
2548
2733
  expandedOptions: expandedOptions,
2734
+ visitedOptions: visitedOptions,
2735
+ revealRequired: revealRequired,
2549
2736
  highlightedOptions: highlightedOptions,
2550
2737
  flashedOptions: flashedOptions,
2551
2738
  infoPanelOverrides: infoPanelOverrides,
@@ -2598,6 +2785,8 @@ var FormEngineImpl = function (_a) {
2598
2785
  cardEditorTypes,
2599
2786
  showAllDescriptions,
2600
2787
  expandedOptions,
2788
+ visitedOptions,
2789
+ revealRequired,
2601
2790
  highlightedOptions,
2602
2791
  flashedOptions,
2603
2792
  infoPanelOverrides,
@@ -2641,13 +2830,22 @@ var FormEngineImpl = function (_a) {
2641
2830
  var compactToolbarParts = (0, react_2.useMemo)(function () {
2642
2831
  if (compactToolbar === false)
2643
2832
  return null;
2833
+ // A calm sub-form nested in a row (a list item, a hash field) draws only its
2834
+ // fields. Its readiness is said once, by the item it sits in, and each row
2835
+ // says what it lacks; a search over two to six fields helps nobody, and one
2836
+ // per item stacked a second search box under the form's own for every item.
2837
+ if (calm && compactNested)
2838
+ return null;
2644
2839
  var all = { completion: true, search: true, fields: true, help: true };
2645
2840
  return compactToolbar === true ? all : __assign(__assign({}, all), compactToolbar);
2646
- }, [JSON.stringify(compactToolbar)]);
2841
+ }, [JSON.stringify(compactToolbar), calm, compactNested]);
2647
2842
  var compactToolbarContextValue = (0, react_2.useMemo)(function () { return ({
2648
2843
  readOnly: readOnly,
2649
2844
  invalidCount: (0, size_1.default)(validityData.invalidFields),
2650
- attentionCount: readFirstAttentionCount,
2845
+ attentionCount: readFirstAttentionCount + readFirstFaultsOutsideBox,
2846
+ attentionFaultCount: readFirstAttentionFaultCount + readFirstFaultsOutsideBox,
2847
+ outsideAttentionCount: outsideAttentionCount,
2848
+ onRevealOutside: outsideAttention === null || outsideAttention === void 0 ? void 0 : outsideAttention.onReveal,
2651
2849
  completion: readFirstCompletion,
2652
2850
  showInvalidOnly: showInvalidOptionsOnly,
2653
2851
  onToggleInvalidOnly: handleToggleInvalidOnly,
@@ -2694,6 +2892,8 @@ var FormEngineImpl = function (_a) {
2694
2892
  onReadOnlyActivate,
2695
2893
  validityData,
2696
2894
  readFirstAttentionCount,
2895
+ readFirstAttentionFaultCount,
2896
+ readFirstFaultsOutsideBox,
2697
2897
  readFirstCompletion,
2698
2898
  showInvalidOptionsOnly,
2699
2899
  handleToggleInvalidOnly,
@@ -2723,8 +2923,22 @@ var FormEngineImpl = function (_a) {
2723
2923
  // removes it, and then the header carries just the consumer's own actions.
2724
2924
  var compactHeaderActions = (0, react_2.useMemo)(function () { return __spreadArray(__spreadArray([], (compactToolbarParts ? [{ as: CompactToolbar_1.CompactToolbar, responsive: false }] : []), true), ((compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions) || []), true); }, [compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions, compactToolbarParts]);
2725
2925
  var renderCompact = function () {
2726
- var _a, _b, _c, _d;
2727
- var headerBg = "".concat((0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.02)).concat((0, colors_1.percentToHexAlpha)(88));
2926
+ var _a, _b, _c, _d, _f;
2927
+ /* The rows of this render, each drawn at the stage into its own node; the boxes draw places for them
2928
+ (`renderRow`). A row that changes box is moved, not drawn anew (`rowPlaces`). */
2929
+ var stagedRows = new Map();
2930
+ // Whether the box being drawn shows its rows: a collapsed one keeps only their places (`useOpenBoxes`)
2931
+ var drawingRows = true;
2932
+ // Calm: the host's own color (see `compactHostColour`), so the pinned
2933
+ // toolbar is invisible until something scrolls under it - and opaque, so
2934
+ // what scrolls under it does not read through. At 88% with a blur the rows
2935
+ // still showed through crisply around the readiness line and the search
2936
+ // wherever the blur did not apply (headless captures, a browser or a
2937
+ // compositor without backdrop-filter): the blur was never something to
2938
+ // count on, the host's color is.
2939
+ var headerBg = calm && compactHostColour ? "rgb(".concat(compactHostColour.join(', '), ")")
2940
+ : calm ? (0, colors_1.getMainBackgroundColor)(theme)
2941
+ : "".concat((0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.02)).concat((0, colors_1.percentToHexAlpha)(88));
2728
2942
  // Toolbar filters narrow the listed rows; the meter reflects the full set.
2729
2943
  var query = compactQuery.trim().toLowerCase();
2730
2944
  var matchesQuery = function (optionName) { var _a; return !query || (((_a = options === null || options === void 0 ? void 0 : options[optionName]) === null || _a === void 0 ? void 0 : _a.display_name) || optionName).toLowerCase().includes(query); };
@@ -2858,20 +3072,32 @@ var FormEngineImpl = function (_a) {
2858
3072
  set: [],
2859
3073
  optional: [],
2860
3074
  };
2861
- // Freeze the box of any field currently being edited (or whose one-of group
2862
- // has an edited member) to its last settled box — so finishing an edit that
2863
- // flips its status doesn't remount it in another box and steal focus.
2864
- var stableBucketOf = function (entry) {
3075
+ /* A box a row being edited cannot move into: a closed one - collapsed on screen, by the form or the reader,
3076
+ or not drawn yet and to be drawn collapsed (Optional, with no search). The row's place there is not in the
3077
+ page, so the row would leave it, and the caret with it. */
3078
+ var boxIsClosed = function (box) {
2865
3079
  var _a;
3080
+ if (readOnly || (calm && compactNested))
3081
+ return false;
3082
+ if ((_a = statusBoxRefs.current[box]) === null || _a === void 0 ? void 0 : _a.isConnected)
3083
+ return !openBoxes.isShown(box);
3084
+ return (compactCollapsedGroupsProp !== null && compactCollapsedGroupsProp !== void 0 ? compactCollapsedGroupsProp : ['optional']).includes(box) && !query;
3085
+ };
3086
+ /* A row's box is what it holds now - the one rule the box headers, the readiness line, the meter and the
3087
+ host's numbers count by (`getOptionBucket`). A row being edited moves with it: it is the same row in its new
3088
+ box, its editor and caret kept (`rowPlaces`), where it was kept in the box it was opened in, and counted
3089
+ elsewhere (Qlip build 489). Into a closed box it does not move until it is closed: an optional value cleared
3090
+ as it is edited stays under the caret, not in a collapsed Optional box. `settledBucket` is the box a row is
3091
+ shown in, which is what follows a field across the boxes (the flash below). */
3092
+ var stableBucketOf = function (entry) {
2866
3093
  var fresh = getOptionBucket(entry.name, entry.hidden);
2867
- var groupBeingEdited = !entry.hidden &&
2868
- (((_a = options === null || options === void 0 ? void 0 : options[entry.name]) === null || _a === void 0 ? void 0 : _a.required_groups) || []).some(function (g) {
2869
- return (requiredGroupsInfo.members[g] || []).some(function (m) { return expandedOptions.includes(m); });
2870
- });
2871
- if (!entry.hidden && (expandedOptions.includes(entry.name) || groupBeingEdited)) {
2872
- var memo = settledBucket.current[entry.name];
2873
- if (memo)
2874
- return memo;
3094
+ var shownIn = settledBucket.current[entry.name];
3095
+ if (shownIn &&
3096
+ shownIn !== fresh &&
3097
+ !entry.hidden &&
3098
+ expandedOptions.includes(entry.name) &&
3099
+ boxIsClosed(fresh)) {
3100
+ return shownIn;
2875
3101
  }
2876
3102
  settledBucket.current[entry.name] = fresh;
2877
3103
  return fresh;
@@ -2953,21 +3179,29 @@ var FormEngineImpl = function (_a) {
2953
3179
  var stickyBoxHeaders = compactStickyBoxHeaders && !compactNested;
2954
3180
  var boxStickyOffset = compactStickyOffset + compactToolbarHeight;
2955
3181
  var STATUS_BOXES = [
2956
- {
2957
- key: 'attention',
2958
- label: (_a = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.attention) !== null && _a !== void 0 ? _a : feWords.boxAttention,
2959
- intent: 'warning',
2960
- icon: 'ErrorWarningLine',
2961
- },
3182
+ // The first box is amber only once something in it is a fault. On a new form it
3183
+ // holds the required fields still to fill in, which is not yet anything wrong.
3184
+ readFirstAttentionFaultCount ?
3185
+ {
3186
+ key: 'attention',
3187
+ label: (_a = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.attention) !== null && _a !== void 0 ? _a : feWords.boxAttention,
3188
+ intent: 'warning',
3189
+ icon: 'ErrorWarningLine',
3190
+ }
3191
+ : {
3192
+ key: 'attention',
3193
+ label: (_b = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.pending) !== null && _b !== void 0 ? _b : feWords.boxPending,
3194
+ icon: 'CheckboxBlankCircleLine',
3195
+ },
2962
3196
  {
2963
3197
  key: 'set',
2964
- label: (_b = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.set) !== null && _b !== void 0 ? _b : feWords.boxSet,
3198
+ label: (_c = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.set) !== null && _c !== void 0 ? _c : feWords.boxSet,
2965
3199
  intent: 'success',
2966
3200
  icon: 'CheckLine',
2967
3201
  },
2968
3202
  {
2969
3203
  key: 'optional',
2970
- label: (_c = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.optional) !== null && _c !== void 0 ? _c : feWords.boxOptional,
3204
+ label: (_d = compactBoxLabels === null || compactBoxLabels === void 0 ? void 0 : compactBoxLabels.optional) !== null && _d !== void 0 ? _d : feWords.boxOptional,
2971
3205
  icon: 'CheckboxBlankCircleLine',
2972
3206
  },
2973
3207
  ];
@@ -2981,7 +3215,17 @@ var FormEngineImpl = function (_a) {
2981
3215
  return Object.keys(absorbedBy).filter(function (absorbedName) { return absorbedBy[absorbedName] === hostName; });
2982
3216
  };
2983
3217
  var renderGroupRows = function (names) {
2984
- var renderRow = function (entry, clustered, clusterFirst, clusterLast) { return ((0, jsx_runtime_1.jsx)(CompactRow_1.CompactRow, { optionName: entry.name, optionField: entry.hidden ?
3218
+ var renderRow = function (entry, clustered, clusterFirst, clusterLast) {
3219
+ // a row is in one place at a time
3220
+ if (stagedRows.has(entry.name))
3221
+ return null;
3222
+ var host = rowHosts.hostFor(entry.name);
3223
+ if (drawingRows) {
3224
+ stagedRows.set(entry.name, (0, rowPlaces_1.stagedRow)(drawRow(entry, clustered, clusterFirst, clusterLast), host, entry.name));
3225
+ }
3226
+ return (0, jsx_runtime_1.jsx)(rowPlaces_1.RowPlace, { host: host }, entry.name);
3227
+ };
3228
+ var drawRow = function (entry, clustered, clusterFirst, clusterLast) { return ((0, jsx_runtime_1.jsx)(CompactRow_1.CompactRow, { optionName: entry.name, optionField: entry.hidden ?
2985
3229
  {
2986
3230
  type: getOptionSchemaStorageType(options === null || options === void 0 ? void 0 : options[entry.name], isRendererOnly),
2987
3231
  value: undefined,
@@ -3017,7 +3261,13 @@ var FormEngineImpl = function (_a) {
3017
3261
  // "Covers"/"Covered by" chips already say which member satisfies it.
3018
3262
  if (requiredGroupsInfo.satisfiedBy[grp])
3019
3263
  return railed;
3020
- return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterBox, { className: 'options-readfirst-required-cluster', "$border": "".concat(cWarning, "33"), "$tint": "".concat(cWarning, "0d"), children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterHeader, { "$color": rowInks.warning, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'LinkM', size: '11px', style: { color: rowInks.warning } }), feWords.oneOfRequired] }), railed] }, grp));
3264
+ // Amber once someone has been to the group (or a submit was attempted); until
3265
+ // then it is still to fill in, in the quiet color, like its members.
3266
+ var clusterVisited = memberEntries.some(function (e) { return getOptionStatus(e.name) !== 'pending'; });
3267
+ var clusterColor = clusterVisited ? cWarning : cMuted;
3268
+ // its words and mark: the same color, in the shade of it that reads on the tint
3269
+ var clusterInk = clusterVisited ? rowInks.warning : rowInks.mutedReason;
3270
+ return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterBox, { className: 'options-readfirst-required-cluster', "$border": "".concat(clusterColor, "33"), "$tint": "".concat(clusterColor, "0d"), "$calm": calm, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRequiredClusterHeader, { className: 'options-readfirst-required-cluster-header', "$color": clusterInk, "$calm": calm, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'LinkM', size: calm ? '13px' : '11px', style: { color: clusterInk } }), feWords.oneOfRequired] }), railed] }, grp));
3021
3271
  });
3022
3272
  };
3023
3273
  // One schema group inside a status box: its thin sub-label, the group's
@@ -3028,32 +3278,115 @@ var FormEngineImpl = function (_a) {
3028
3278
  can be split across the shown and folded halves of a capped box, and its
3029
3279
  label must appear above whichever half holds its first row. */
3030
3280
  var renderBoxGroup = function (boxKey, groupName, only) {
3031
- var groupConfig = groups === null || groups === void 0 ? void 0 : groups[groupName];
3032
3281
  var rows = only ?
3033
3282
  (buckets[boxKey][groupName] || []).filter(function (entry) { return only.has(entry.name); })
3034
3283
  : buckets[boxKey][groupName];
3035
3284
  if (only && !rows.length) {
3036
3285
  return null;
3037
3286
  }
3287
+ return renderGroupBlock(groupName, rows);
3288
+ };
3289
+ /** A group's sub-label, subtitle and rows. `key` tells two halves of one
3290
+ group apart when both render in the same body. */
3291
+ var renderGroupBlock = function (groupName, rows, key) {
3292
+ if (key === void 0) { key = groupName; }
3293
+ var groupConfig = groups === null || groups === void 0 ? void 0 : groups[groupName];
3038
3294
  return ((0, jsx_runtime_1.jsxs)(react_2.default.Fragment, { children: [showGroupSubLabel(groupName) ?
3039
- (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBoxGroupLabel, { children: (0, readFirst_1.getOptionGroupLabel)(groupName, groups) })
3295
+ (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBoxGroupLabel, { className: 'options-readfirst-group-label', "$calm": calm, "$color": cKey, children: (0, readFirst_1.getOptionGroupLabel)(groupName, groups) })
3040
3296
  : null, showGroupSubLabel(groupName) && (groupConfig === null || groupConfig === void 0 ? void 0 : groupConfig.subtitle) ?
3041
- (0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.6 }, style: {
3042
- marginTop: 2,
3043
- marginBottom: 8,
3044
- marginLeft: compactRowStyles_1.GROUP_INDENT,
3045
- paddingRight: 10,
3046
- }, children: groupConfig.subtitle })
3047
- : null, renderGroupRows(rows)] }, groupName));
3297
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { className: 'options-readfirst-group-subtitle', size: 'small', effect: { opacity: 0.6 }, style: calm ?
3298
+ // Under the calm heading, at the rows' inset; the space below
3299
+ // it is the next row's own padding.
3300
+ { margin: 0, padding: "2px ".concat(compactRowStyles_1.CALM_INSET, " 4px") }
3301
+ : {
3302
+ marginTop: 2,
3303
+ marginBottom: 8,
3304
+ marginLeft: compactRowStyles_1.GROUP_INDENT,
3305
+ paddingRight: 10,
3306
+ }, children: groupConfig.subtitle })
3307
+ : null, renderGroupRows(rows)] }, key));
3308
+ };
3309
+ /** The "N more fields" control: a quiet last row of the body it folds. */
3310
+ var renderMoreRow = function (boxKey, count, open) { return ((0, jsx_runtime_1.jsxs)("button", { type: 'button', className: 'readfirst-row readfirst-more-row options-readfirst-more', "aria-expanded": open, onClick: function () {
3311
+ return setExpandedMoreBoxes(function (prev) {
3312
+ return prev.includes(boxKey) ? prev.filter(function (k) { return k !== boxKey; }) : __spreadArray(__spreadArray([], prev, true), [boxKey], false);
3313
+ });
3314
+ }, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.8 }, children: open ? feWords.showFewer : feWords.moreFields(count, boxKey === 'optional') }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'ArrowDownSLine', size: 'small', className: 'readfirst-more-chevron', effect: { opacity: 0.8 } })] })); };
3315
+ var groupBodyProps = {
3316
+ $calm: calm,
3317
+ $hairline: cHairline,
3318
+ $divider: cDivider,
3319
+ $hover: cHover,
3320
+ // The keyboard's ring in the one ring color (decision 030); amber said a good row was at fault
3321
+ $focus: (0, readableColors_1.getFocusRingColor)(theme),
3322
+ // Calm: the text color's wash, as a hovered row has; amber would say the group is wrong (a satisfied one
3323
+ // stayed amber under the pointer)
3324
+ $groupHighlight: calm ? cHover : "".concat(cWarning, "1f"),
3325
+ $success: cSuccess,
3326
+ $rowBg: cRowBg,
3327
+ $lineColor: cGroupLine,
3328
+ $moreBorder: cMoreBorder,
3329
+ };
3330
+ /* Calm, nested in a row (a list item, a hash field's sub-form): the item is
3331
+ already the card, so its fields sit in it directly instead of in status
3332
+ boxes, which drew a card inside the card. In schema order, so a row does
3333
+ not move to another box under the caret as it is filled; a row that lacks
3334
+ a value still says so where the value would be. The fields nobody has
3335
+ added fold behind one quiet last row, the same control a capped box ends
3336
+ with — and when nothing else is listed they ARE the form, so they show. */
3337
+ var renderNestedRows = function () {
3338
+ // Fields with no named group are one list here. The engine files them under
3339
+ // two synthetic keys (the required ones and the rest), which the boxes
3340
+ // never showed; in one list that split put a set Description above an
3341
+ // empty Method Name. Named groups keep their sub-labels and their order.
3342
+ var UNLABELLED = '';
3343
+ var keyOf = function (groupName) { return (showGroupSubLabel(groupName) ? groupName : UNLABELLED); };
3344
+ var nestedKeys = (0, lodash_1.uniq)(groupKeys.map(keyOf));
3345
+ var listedByGroup = {};
3346
+ var addableByGroup = {};
3347
+ groupKeys.forEach(function (groupName) {
3348
+ grouped[groupName].forEach(function (entry) {
3349
+ var _a;
3350
+ var target = entry.hidden ? addableByGroup : listedByGroup;
3351
+ (target[_a = keyOf(groupName)] || (target[_a] = [])).push(entry);
3352
+ });
3353
+ });
3354
+ // In the schema's order, not the order the values arrived in.
3355
+ var schemaOrder = Object.keys(options || {});
3356
+ var bySchema = function (a, b) {
3357
+ return schemaOrder.indexOf(a.name) - schemaOrder.indexOf(b.name);
3358
+ };
3359
+ (0, lodash_1.forEach)(listedByGroup, function (rows) { return rows.sort(bySchema); });
3360
+ (0, lodash_1.forEach)(addableByGroup, function (rows) { return rows.sort(bySchema); });
3361
+ var renderNestedGroup = function (key, rows, half) {
3362
+ return key === UNLABELLED ?
3363
+ (0, jsx_runtime_1.jsx)(react_2.default.Fragment, { children: renderGroupRows(rows) }, "".concat(half, "-fields"))
3364
+ : renderGroupBlock(key, rows, "".concat(half, "-").concat(key));
3365
+ };
3366
+ var listedGroups = nestedKeys.filter(function (key) { var _a; return (_a = listedByGroup[key]) === null || _a === void 0 ? void 0 : _a.length; });
3367
+ var addableGroups = nestedKeys.filter(function (key) { var _a; return (_a = addableByGroup[key]) === null || _a === void 0 ? void 0 : _a.length; });
3368
+ var addableCount = addableGroups.reduce(function (total, key) { return total + addableByGroup[key].length; }, 0);
3369
+ var folds = listedGroups.length > 0;
3370
+ var addableOpen = !folds || expandedMoreBoxes.includes('optional');
3371
+ return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupBody, __assign({}, groupBodyProps, { className: "readfirst-nested-list".concat(compactNarrow ? ' readfirst-narrow' : ''), children: [listedGroups.map(function (key) { return renderNestedGroup(key, listedByGroup[key], 'listed'); }), folds && addableCount ? renderMoreRow('optional', addableCount, addableOpen) : null, addableOpen ?
3372
+ addableGroups.map(function (key) { return renderNestedGroup(key, addableByGroup[key], 'addable'); })
3373
+ : null] })));
3048
3374
  };
3049
3375
  return ((0, jsx_runtime_1.jsx)(optionsContext_1.OptionsContext.Provider, { value: { schema: options, value: availableOptions }, children: (0, jsx_runtime_1.jsx)(compactRowContext_1.CompactRowContext.Provider, { value: compactRowContextValue, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreErrorBoundary, { children: [showHelpForOption && ((0, jsx_runtime_1.jsx)(OptionsHelpDialog_1.OptionsHelpDialog, { onClose: function () { return setShowHelpForOption(undefined); }, option: options[showHelpForOption] })), (0, jsx_runtime_1.jsx)(compactToolbarContext_1.CompactToolbarContext.Provider, { value: compactToolbarContextValue, children: (0, jsx_runtime_1.jsxs)(StyledCompactWrap, { ref: setCompactWrap, className: 'options-readfirst-scroll', "$ownScroll": compactScroll === 'own' && !compactNested, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCompactPanel
3050
3376
  // Mirrors the toolbar's own search-row gate: when no search
3051
3377
  // row renders, the header is a thin strip and sits tight to
3052
3378
  // the first status box (see StyledCompactPanel).
3053
- , __assign({ "$tightHeader": !((compactToolbarParts === null || compactToolbarParts === void 0 ? void 0 : compactToolbarParts.search) && (0, size_1.default)(options) > 1), "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, "$stickyBoxes": compactStickyBoxHeaders && !compactNested, "$stackHeader": compactNarrow &&
3379
+ , __assign({ "$tightHeader": !((compactToolbarParts === null || compactToolbarParts === void 0 ? void 0 : compactToolbarParts.search) && (0, size_1.default)(options) > 1), "$headerBg": compactNested ? 'transparent' : headerBg, "$nested": compactNested, "$calm": calm, "$stickyBoxes": compactStickyBoxHeaders && !compactNested, "$stackHeader": compactNarrow &&
3054
3380
  !!((compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.label) ||
3055
3381
  (compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.icon) ||
3056
- ((_d = compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions) === null || _d === void 0 ? void 0 : _d.length)), flat: true, raised: true, minimal: true,
3382
+ ((_f = compactPanelProps === null || compactPanelProps === void 0 ? void 0 : compactPanelProps.actions) === null || _f === void 0 ? void 0 : _f.length)), flat: true,
3383
+ // Calm: no surface and no lift at all. A theme that gives
3384
+ // panels a surface of their own (Reqore's `theme.panel`) would
3385
+ // otherwise paint this wrapper as a card around the section
3386
+ // cards inside it. Transparent and un-raised, Reqore also drops
3387
+ // the wrapper's horizontal padding, so the readiness line, the
3388
+ // search and the sections share one left edge with the host.
3389
+ raised: !calm, minimal: true, transparent: calm || undefined,
3057
3390
  // No panel background: the form sits transparently on whatever
3058
3391
  // hosts it (page, drawer, or — for an arg_schema field — the
3059
3392
  // parent's edit card) instead of stacking its own dark surface.
@@ -3105,117 +3438,163 @@ var FormEngineImpl = function (_a) {
3105
3438
  (0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { flat: true, opaque: false, size: 'small', children: readOnly && !query ? feWords.nothingSet : feWords.noFieldsMatch })
3106
3439
  : null, readOnly ?
3107
3440
  bucketCount('set') ?
3108
- (0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-read', style: { padding: '4px 4px 6px' }, children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledGroupBody, { "$divider": cDivider, "$hover": cHover, "$focus": cWarning, "$success": cSuccess, "$rowBg": cRowBg, "$lineColor": cGroupLine, "$moreBorder": cMoreBorder, className: compactNarrow ? 'readfirst-narrow' : undefined, children: bucketGroups.set.map(function (groupName) { return renderBoxGroup('set', groupName); }) }) })
3441
+ (0, jsx_runtime_1.jsx)("div", { className: 'options-readfirst-read', style: { padding: calm ? 0 : '4px 4px 6px' }, children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledGroupBody, __assign({}, groupBodyProps, { className: "readfirst-read-list".concat(compactNarrow ? ' readfirst-narrow' : ''), children: bucketGroups.set.map(function (groupName) { return renderBoxGroup('set', groupName); }) })) })
3109
3442
  : null
3110
- : STATUS_BOXES.map(function (box) {
3111
- var groupsInBox = bucketGroups[box.key];
3112
- var count = bucketCount(box.key);
3113
- if (!count)
3114
- return null;
3115
- var hasPreselectedRows = boxHasPreselectedRows(box.key);
3116
- var wouldCollapse = compactCollapsedGroups.includes(box.key) &&
3117
- !query &&
3118
- !(box.key === 'optional' && onlyOptionalRows && !collapsedGroupsRequested);
3119
- // Only a box that was opened SOLELY to reveal a preselected
3120
- // row splits its body; a box that renders open anyway shows
3121
- // all of its groups as before.
3122
- var splitForPreselected = wouldCollapse && hasPreselectedRows;
3123
- // Which rows this box shows, and which fold away, decided at
3124
- // ROW level because `maxFieldsShown` counts fields — a
3125
- // group-level split can only ever cut at a group boundary.
3126
- // Group order is preserved so the visible rows read in the
3127
- // same order they would if nothing were folded.
3128
- var orderedRows = groupsInBox.flatMap(function (groupName) { return buckets[box.key][groupName] || []; });
3129
- // Optional's own rule first: a box opened solely to reveal
3130
- // preselected rows offers those, not an arbitrary first-N.
3131
- var candidateRows = splitForPreselected ? orderedRows.filter(isPreselectedRow) : orderedRows;
3132
- // …then the cap applies to whatever that left.
3133
- var capped = maxFieldsShown !== undefined && candidateRows.length > maxFieldsShown;
3134
- var shownRows = capped ? candidateRows.slice(0, maxFieldsShown) : candidateRows;
3135
- var shownRowSet = new Set(shownRows.map(function (entry) { return entry.name; }));
3136
- // Everything the box holds that is not on show. Once the
3137
- // reader asks for more they get the whole box — withholding
3138
- // the non-preselected remainder behind a second control is
3139
- // the same defect one level down.
3140
- var deferredRowSet = new Set(orderedRows
3141
- .filter(function (entry) { return !shownRowSet.has(entry.name); })
3142
- .map(function (entry) { return entry.name; }));
3143
- var deferredCount = deferredRowSet.size;
3144
- var shownGroups = groupsInBox.filter(function (groupName) {
3145
- return (buckets[box.key][groupName] || []).some(function (entry) {
3146
- return shownRowSet.has(entry.name);
3443
+ : calm && compactNested ? renderNestedRows()
3444
+ : STATUS_BOXES.map(function (box) {
3445
+ var groupsInBox = bucketGroups[box.key];
3446
+ var count = bucketCount(box.key);
3447
+ if (!count)
3448
+ return null;
3449
+ /* A row being edited is on show in the box it is in: neither the preselected split
3450
+ nor a cap folds it away (it moves only into an open box - `boxIsClosed`). */
3451
+ var isOpenRow = function (entry) { return expandedOptions.includes(entry.name); };
3452
+ var hasPreselectedRows = boxHasPreselectedRows(box.key);
3453
+ var wouldCollapse = compactCollapsedGroups.includes(box.key) &&
3454
+ !query &&
3455
+ !(box.key === 'optional' && onlyOptionalRows && !collapsedGroupsRequested);
3456
+ // Only a box that was opened SOLELY to reveal a preselected
3457
+ // row splits its body; a box that renders open anyway shows
3458
+ // all of its groups as before.
3459
+ var splitForPreselected = wouldCollapse && hasPreselectedRows;
3460
+ var opensCollapsed = wouldCollapse && !hasPreselectedRows;
3461
+ // Its rows are drawn while it is open: as the form opens it, or as the reader just
3462
+ // did (the reveal below needs them in the box it scrolls to), or as its content says
3463
+ drawingRows = openBoxes.drawsRows(box.key, !opensCollapsed || openedStatusBox === box.key);
3464
+ // Which rows this box shows, and which fold away, decided at
3465
+ // ROW level because `maxFieldsShown` counts fields — a
3466
+ // group-level split can only ever cut at a group boundary.
3467
+ // Group order is preserved so the visible rows read in the
3468
+ // same order they would if nothing were folded.
3469
+ var orderedRows = groupsInBox.flatMap(function (groupName) { return buckets[box.key][groupName] || []; });
3470
+ // The number in the box's header counts the rows in it: what they
3471
+ // hold now, as the line and the host count them (a field being
3472
+ // edited moves box with its value - `stableBucketOf`).
3473
+ var headerCount = readOnly ? count : (orderedRows.filter(function (entry) { return getOptionBucket(entry.name, entry.hidden) === box.key; }).length);
3474
+ // Optional's own rule first: a box opened solely to reveal
3475
+ // preselected rows offers those, not an arbitrary first-N.
3476
+ var candidateRows = splitForPreselected ?
3477
+ orderedRows.filter(function (entry) { return isPreselectedRow(entry) || isOpenRow(entry); })
3478
+ : orderedRows;
3479
+ // …then the cap applies to whatever that left - but for a row being edited.
3480
+ var capped = maxFieldsShown !== undefined && candidateRows.length > maxFieldsShown;
3481
+ var shownRows = capped ?
3482
+ candidateRows.filter(function (entry, index) { return index < maxFieldsShown || isOpenRow(entry); })
3483
+ : candidateRows;
3484
+ var shownRowSet = new Set(shownRows.map(function (entry) { return entry.name; }));
3485
+ // Everything the box holds that is not on show. Once the
3486
+ // reader asks for more they get the whole box — withholding
3487
+ // the non-preselected remainder behind a second control is
3488
+ // the same defect one level down.
3489
+ var deferredRowSet = new Set(orderedRows
3490
+ .filter(function (entry) { return !shownRowSet.has(entry.name); })
3491
+ .map(function (entry) { return entry.name; }));
3492
+ var deferredCount = deferredRowSet.size;
3493
+ var shownGroups = groupsInBox.filter(function (groupName) {
3494
+ return (buckets[box.key][groupName] || []).some(function (entry) {
3495
+ return shownRowSet.has(entry.name);
3496
+ });
3497
+ });
3498
+ var deferredGroups = groupsInBox.filter(function (groupName) {
3499
+ return (buckets[box.key][groupName] || []).some(function (entry) { return !shownRowSet.has(entry.name); });
3147
3500
  });
3148
- });
3149
- var deferredGroups = groupsInBox.filter(function (groupName) {
3150
- return (buckets[box.key][groupName] || []).some(function (entry) { return !shownRowSet.has(entry.name); });
3151
- });
3152
- var moreOpen = Boolean(query) || expandedMoreBoxes.includes(box.key);
3153
- var accent = box.key === 'attention' ? cWarning
3154
- : box.key === 'set' ? cSuccess
3155
- : cMuted;
3156
- // The muted "Optional" box reads as a quieter, recessed
3157
- // surface — a touch darker than the page rather than the
3158
- // faint grey tint the accent would give.
3159
- var boxBg = box.key === 'optional' ?
3160
- (0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.06)
3161
- : undefined;
3162
- return ((0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusBox, { "$accent": accent, "$bg": boxBg, "$surface": stickyBoxHeaders ? (0, colors_1.getMainBackgroundColor)(theme) : undefined, ref: function (node) {
3163
- statusBoxRefs.current[box.key] = node;
3164
- },
3165
- // Opening arms the reveal; collapsing disarms it, so a
3166
- // close never scrolls.
3167
- onCollapseChange: function (collapsed) {
3168
- return setOpenedStatusBox(collapsed ? undefined : box.key);
3169
- }, flat: true, minimal: true,
3170
- /* The header stays on screen while its own box is
3171
- being read — see `compactStickyBoxHeaders`. Sticky
3172
- is bounded by its containing block, so the header
3173
- leaves with its box and only one is ever pinned. */
3174
- stickyHeader: stickyBoxHeaders, stickyHeaderOffset: stickyBoxHeaders ? boxStickyOffset : undefined, collapseButtonProps: { flat: true, minimal: true, size: 'small' }, collapsible: true,
3175
- // Which boxes start closed is the consumer's call
3176
- // (`compactCollapsedGroups`, default `['optional']`: the
3177
- // Optional box holds every not-yet-added field, so a form
3178
- // opens on what is in use). Two rules override it:
3179
- //
3180
- // A SEARCH forces every box open — ReqorePanel unmounts
3181
- // collapsed content, so a match inside a closed box would
3182
- // be unreachable. (isCollapsed is the panel's controllable
3183
- // state; manual toggling still works with no query set.)
3184
- //
3185
- // The Optional box stays open when it is the ONLY box,
3186
- // because collapsing it renders a card that looks empty and
3187
- // broken: an auth profile's Authorization block, whose nine
3188
- // requirement fields are all optional, showed as a titled
3189
- // card containing one collapsed "Optional 9" strip and
3190
- // nothing else. This does not generalise to the other two —
3191
- // a lone Set box collapsed is a deliberate ask, and its
3192
- // header still reports what is in there.
3193
- //
3194
- // A PRESELECTED row overrides it too: the schema asked
3195
- // for that field to be visible on a new form, so the
3196
- // box it lands in opens. The groups it does NOT appear
3197
- // in stay behind an inner collapse below, so opening
3198
- // the box reveals the preselected fields without also
3199
- // dumping every not-yet-added optional field on the
3200
- // author.
3201
- isCollapsed: wouldCollapse && !hasPreselectedRows, label: (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupHeader, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { effect: { weight: 'bold' }, size: 'normal', children: box.label }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, compact: true, intent: box.intent, label: String(count) })] }), icon: box.icon, className: 'options-readfirst-group', padded: false, contentStyle: { padding: '4px 4px 6px' }, children: (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupBody, { "$divider": cDivider, "$hover": cHover, "$focus": cWarning, "$success": cSuccess, "$rowBg": cRowBg, "$lineColor": cGroupLine, "$moreBorder": cMoreBorder, className: compactNarrow ? 'readfirst-narrow' : undefined, children: [shownGroups.map(function (groupName) {
3202
- return renderBoxGroup(box.key, groupName, shownRowSet);
3203
- }), deferredCount ?
3204
- (0, jsx_runtime_1.jsxs)("button", { type: 'button', className: 'readfirst-row readfirst-more-row options-readfirst-more', "aria-expanded": moreOpen, onClick: function () {
3205
- return setExpandedMoreBoxes(function (prev) {
3206
- return prev.includes(box.key) ?
3207
- prev.filter(function (k) { return k !== box.key; })
3208
- : __spreadArray(__spreadArray([], prev, true), [box.key], false);
3209
- });
3210
- }, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', effect: { opacity: 0.8 }, children: moreOpen ?
3211
- feWords.showFewer
3212
- : feWords.moreFields(deferredCount, box.key === 'optional') }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'ArrowDownSLine', size: 'small', className: 'readfirst-more-chevron', effect: { opacity: 0.8 } })] })
3213
- : null, deferredCount && moreOpen ?
3214
- deferredGroups.map(function (groupName) {
3215
- return renderBoxGroup(box.key, groupName, deferredRowSet);
3216
- })
3217
- : null] }) }, box.key));
3218
- })] })), commitMode === 'batched' && !readOnly && dirtyOptionNames.length ?
3501
+ var moreOpen = Boolean(query) || expandedMoreBoxes.includes(box.key);
3502
+ var accent = box.key === 'attention' && readFirstAttentionFaultCount ? cWarning
3503
+ : box.key === 'set' ? cSuccess
3504
+ : cMuted;
3505
+ // The muted "Optional" box reads as a quieter, recessed
3506
+ // surface — a touch darker than the page rather than the
3507
+ // faint grey tint the accent would give.
3508
+ // Calm: every box is the same panel — no recessed one.
3509
+ var boxBg = box.key === 'optional' && !calm ?
3510
+ (0, colors_1.changeDarkness)((0, colors_1.getMainBackgroundColor)(theme), 0.06)
3511
+ : undefined;
3512
+ return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledStatusBox, { "$accent": accent, "$bg": boxBg, "$calm": calm, "$surface": stickyBoxHeaders ?
3513
+ calm ? cPanel
3514
+ : (0, colors_1.getMainBackgroundColor)(theme)
3515
+ : undefined, ref: function (node) {
3516
+ statusBoxRefs.current[box.key] = node;
3517
+ },
3518
+ // Opening arms the reveal; collapsing disarms it, so a
3519
+ // close never scrolls.
3520
+ onCollapseChange: function (collapsed) {
3521
+ return setOpenedStatusBox(collapsed ? undefined : box.key);
3522
+ },
3523
+ // Calm: an ordinary panel — Reqore paints the theme's
3524
+ // panel surface and its hairline edge. The header stays
3525
+ // minimal (no surface or rule of its own); the first
3526
+ // row's hairline is the line under it.
3527
+ flat: !calm, minimal: true,
3528
+ /* The header stays on screen while its own box is
3529
+ being read — see `compactStickyBoxHeaders`. Sticky
3530
+ is bounded by its containing block, so the header
3531
+ leaves with its box and only one is ever pinned. */
3532
+ stickyHeader: stickyBoxHeaders, stickyHeaderOffset: stickyBoxHeaders ? boxStickyOffset : undefined, collapseButtonProps: { flat: true, minimal: true, size: 'small' }, collapsible: true,
3533
+ // Which boxes start closed is the consumer's call
3534
+ // (`compactCollapsedGroups`, default `['optional']`: the
3535
+ // Optional box holds every not-yet-added field, so a form
3536
+ // opens on what is in use). Two rules override it:
3537
+ //
3538
+ // A SEARCH forces every box open — ReqorePanel unmounts
3539
+ // collapsed content, so a match inside a closed box would
3540
+ // be unreachable. (isCollapsed is the panel's controllable
3541
+ // state; manual toggling still works with no query set.)
3542
+ //
3543
+ // The Optional box stays open when it is the ONLY box,
3544
+ // because collapsing it renders a card that looks empty and
3545
+ // broken: an auth profile's Authorization block, whose nine
3546
+ // requirement fields are all optional, showed as a titled
3547
+ // card containing one collapsed "Optional 9" strip and
3548
+ // nothing else. This does not generalise to the other two —
3549
+ // a lone Set box collapsed is a deliberate ask, and its
3550
+ // header still reports what is in there.
3551
+ //
3552
+ // A PRESELECTED row overrides it too: the schema asked
3553
+ // for that field to be visible on a new form, so the
3554
+ // box it lands in opens. The groups it does NOT appear
3555
+ // in stay behind an inner collapse below, so opening
3556
+ // the box reveals the preselected fields without also
3557
+ // dumping every not-yet-added optional field on the
3558
+ // author.
3559
+ isCollapsed: opensCollapsed, label: calm ?
3560
+ // One status dot and a word — and only where a
3561
+ // person is needed. The count is a quiet number.
3562
+ (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupHeader, { "$calm": true, children: [box.key === 'attention' && readFirstAttentionFaultCount ?
3563
+ (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { className: 'options-readfirst-group-dot', "$color": cWarning, "aria-hidden": true })
3564
+ : null, (0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { effect: { weight: 'bold' }, size: 'normal', children: box.label }), headerCount ?
3565
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreSpan, { className: 'options-readfirst-group-count', size: 'small', effect: { opacity: 0.65 }, children: headerCount })
3566
+ : null] })
3567
+ : (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupHeader, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { effect: { weight: 'bold' }, size: 'normal', children: box.label }), headerCount ?
3568
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, compact: true, intent: box.intent, label: String(headerCount) })
3569
+ : null] }), icon: calm ? undefined : box.icon,
3570
+ /* ONE left edge: the title and the rows start where Reqore puts them.
3571
+ Reqore pads the title bar and the padded content by the same amount
3572
+ at their sides - its size's padding, or as much as clears the
3573
+ corner (#715) - and the rows add nothing to it: a calm body draws
3574
+ its rows full-bleed and takes their inset back (`$boxCorners`);
3575
+ a classic row's text sits its own padding into its pill, and the
3576
+ icon that starts the title moves in by as much. Neither knows what
3577
+ Reqore pads by: a title padded for the corner and rows padded by a
3578
+ number of their own were two edges (22px and 17px under a 14px
3579
+ corner). */
3580
+ iconProps: calm ? undefined : { style: { marginLeft: compactRowStyles_1.COMPACT_ROW_PAD_X } }, className: 'options-readfirst-group', contentStyle: calm ?
3581
+ {
3582
+ paddingTop: 0,
3583
+ paddingBottom: 0,
3584
+ // the rows' bands and hairlines reach the box's edges, its
3585
+ // corners too, and no further
3586
+ overflow: 'clip',
3587
+ borderBottomLeftRadius: 'inherit',
3588
+ borderBottomRightRadius: 'inherit',
3589
+ }
3590
+ : { paddingTop: 4, paddingBottom: 6 }, children: [(0, jsx_runtime_1.jsx)(rowPlaces_1.OpenBoxMark, { box: box.key, onShown: openBoxes.onShown }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledGroupBody, __assign({}, groupBodyProps, { "$boxCorners": true, className: compactNarrow ? 'readfirst-narrow' : undefined, children: [shownGroups.map(function (groupName) {
3591
+ return renderBoxGroup(box.key, groupName, shownRowSet);
3592
+ }), deferredCount ? renderMoreRow(box.key, deferredCount, moreOpen) : null, deferredCount && moreOpen ?
3593
+ deferredGroups.map(function (groupName) {
3594
+ return renderBoxGroup(box.key, groupName, deferredRowSet);
3595
+ })
3596
+ : null] }))] }, box.key));
3597
+ })] })), (0, jsx_runtime_1.jsx)(rowPlaces_1.RowStage, { rows: Array.from(stagedRows.values()) }), commitMode === 'batched' && !readOnly && dirtyOptionNames.length ?
3219
3598
  (0, jsx_runtime_1.jsx)(StyledCommitDock, { "$bg": cBg, "$border": cDivider, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { className: 'options-readfirst-commitbar', verticalAlign: 'center', wrap: true, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 }, intent: 'warning', icon: 'EditLine', label: feWords.unsavedChanges(dirtyOptionNames.length) }), validityData.isValid ? null : ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, flat: true, wrap: true, intent: 'danger', icon: 'ErrorWarningLine', className: 'options-readfirst-commit-blocked', label: (0, readFirst_1.describeBlockedSave)(validityData.invalidFields, options) })), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', intent: 'success', icon: 'CheckLine', fixed: true, className: 'options-readfirst-save', disabled: !validityData.isValid, tooltip: validityData.isValid ? feWords.applyChanges : feWords.resolveInvalid, onClick: handleCommitClick, children: feWords.save }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', minimal: true, flat: true, fixed: true, icon: 'HistoryLine', className: 'options-readfirst-discard', onClick: handleRevertChangesClick, children: feWords.discard })] }) })
3220
3599
  : null] }) })] }) }) }));
3221
3600
  };
@@ -3252,7 +3631,7 @@ var FormEngineImpl = function (_a) {
3252
3631
  return renderCompact();
3253
3632
  }
3254
3633
  return ((0, jsx_runtime_1.jsx)(optionsContext_1.OptionsContext.Provider, { value: { schema: options, value: availableOptions }, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreErrorBoundary, { children: [showHelpForOption && ((0, jsx_runtime_1.jsx)(OptionsHelpDialog_1.OptionsHelpDialog, { onClose: function () { return setShowHelpForOption(undefined); }, option: options[showHelpForOption] })), recordRequiresSearchOptions && !readOnly ?
3255
- (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: 'info', children: feWords.searchOptionsRequired }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 })] })
3634
+ (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { intent: (0, formAppearance_1.calmNoteIntent)('info', calm), children: feWords.searchOptionsRequired }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 })] })
3256
3635
  : null, (0, jsx_runtime_1.jsx)(reqore_1.ReqoreCollection, __assign({ minColumnWidth: '350px', flat: true, padded: false, minimal: true }, rest, { label: compact ? undefined : rest.label, responsiveTitle: false, inputProps: {
3257
3636
  disabled: (0, size_1.default)(availableOptions) < 2,
3258
3637
  }, labelSize: 4, filterable: 'filterable' in rest ? rest.filterable : !compact, sortable: 'sortable' in rest ? rest.sortable : !compact && (0, size_1.default)(availableOptions) > 1, defaultSortBy: null, contentRenderer: function (children) { return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, size_1.default)(validityData.invalidFields) && !readOnly ?
@@ -3264,7 +3643,7 @@ var FormEngineImpl = function (_a) {
3264
3643
  : null, (0, jsx_runtime_1.jsx)(HiddenFieldsNote_1.HiddenFieldsNote, { fields: hiddenFieldsWithValues }), children, (0, size_1.default)(filteredOptions) >= 1 && !readOnly ?
3265
3644
  (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 }), (0, jsx_runtime_1.jsx)(Select_1.SelectFormField, { items: optionalFields, onChange: function (val) { return handleAddOptionalFieldChange('options', val); }, placeholder: placeholder || feWords.moreOptions, minimal: true, icon: 'ListView', showDescription: false, fluid: true, size: rest.size })] })
3266
3645
  : null] })); }, sortButtonProps: { minimal: true }, showLayoutSwitch: false, style: { width: '100%' }, items: (0, map_1.default)(shownOptions, function (_a, optionName) {
3267
- var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
3646
+ var _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
3268
3647
  var type = _a.type, other = __rest(_a, ["type"]);
3269
3648
  return ({
3270
3649
  label: ((_b = options[optionName]) === null || _b === void 0 ? void 0 : _b.display_name) || optionName,
@@ -3280,12 +3659,14 @@ var FormEngineImpl = function (_a) {
3280
3659
  cursor: 'help',
3281
3660
  }
3282
3661
  : undefined,
3283
- onClick: ((_f = options[optionName]) === null || _f === void 0 ? void 0 : _f.desc) ? function () { return handleOptionLabelClick(optionName); } : undefined,
3662
+ onClick: (0, fieldDescription_1.fieldHasLongDescription)(options[optionName]) ?
3663
+ function () { return handleOptionLabelClick(optionName); }
3664
+ : undefined,
3284
3665
  },
3285
- showLabelTooltip: !!((_g = options[optionName]) === null || _g === void 0 ? void 0 : _g.short_desc),
3666
+ showLabelTooltip: !!((_f = options[optionName]) === null || _f === void 0 ? void 0 : _f.short_desc),
3286
3667
  customLabelTooltip: {
3287
3668
  delay: 300,
3288
- content: ((0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: "".concat((_h = options[optionName]) === null || _h === void 0 ? void 0 : _h.short_desc).concat(((_j = options[optionName]) === null || _j === void 0 ? void 0 : _j.desc) ? feWords.clickToLearnMore : ''), margin: 'none' })),
3669
+ content: ((0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: "".concat((_g = options[optionName]) === null || _g === void 0 ? void 0 : _g.short_desc).concat((0, fieldDescription_1.fieldHasLongDescription)(options[optionName]) ? feWords.clickToLearnMore : ''), margin: 'none' })),
3289
3670
  },
3290
3671
  description: showFieldTypes ?
3291
3672
  [(0, qorusTypeCatalogue_1.optionTypeWords)(options[optionName], typeName), options[optionName].short_desc]
@@ -3295,7 +3676,7 @@ var FormEngineImpl = function (_a) {
3295
3676
  descriptionEffect: {
3296
3677
  textSize: '11px',
3297
3678
  opacity: optionDescOpacity,
3298
- underline: ((_k = options[optionName]) === null || _k === void 0 ? void 0 : _k.desc) ? 'underline dotted #878787' : undefined,
3679
+ underline: (0, fieldDescription_1.fieldHasLongDescription)(options[optionName]) ? 'underline dotted #878787' : undefined,
3299
3680
  },
3300
3681
  customTheme: {
3301
3682
  main: 'main:darken:1',
@@ -3332,7 +3713,7 @@ var FormEngineImpl = function (_a) {
3332
3713
  menu: [
3333
3714
  !readOnly &&
3334
3715
  type !== 'code-editor' &&
3335
- (((_l = options[optionName]) === null || _l === void 0 ? void 0 : _l.ui_type) || ((_m = options[optionName]) === null || _m === void 0 ? void 0 : _m.type)) !==
3716
+ (((_h = options[optionName]) === null || _h === void 0 ? void 0 : _h.ui_type) || ((_j = options[optionName]) === null || _j === void 0 ? void 0 : _j.type)) !==
3336
3717
  'code-editor' && {
3337
3718
  label: feWords.focusedEditing,
3338
3719
  icon: 'FullscreenLine',
@@ -3352,15 +3733,15 @@ var FormEngineImpl = function (_a) {
3352
3733
  !readOnly &&
3353
3734
  other.value &&
3354
3735
  !(0, lodash_1.isEqual)(other.value, (0, common_1.getDefaultValue)(options[optionName])) &&
3355
- !(((_o = options[optionName]) === null || _o === void 0 ? void 0 : _o.disabled) || ((_p = options[optionName]) === null || _p === void 0 ? void 0 : _p.readonly)) && {
3736
+ !(((_k = options[optionName]) === null || _k === void 0 ? void 0 : _k.disabled) || ((_l = options[optionName]) === null || _l === void 0 ? void 0 : _l.readonly)) && {
3356
3737
  label: feWords.removeValue,
3357
3738
  icon: 'CloseLine',
3358
3739
  className: 'options-item-remove',
3359
3740
  onClick: function () { return handleValueChange(optionName, undefined); },
3360
3741
  },
3361
3742
  !readOnly &&
3362
- !((_q = options[optionName]) === null || _q === void 0 ? void 0 : _q.preselected) &&
3363
- !((_r = options[optionName]) === null || _r === void 0 ? void 0 : _r.required) && {
3743
+ !((_m = options[optionName]) === null || _m === void 0 ? void 0 : _m.preselected) &&
3744
+ !((_o = options[optionName]) === null || _o === void 0 ? void 0 : _o.required) && {
3364
3745
  label: feWords.removeOption,
3365
3746
  icon: 'DeleteBinLine',
3366
3747
  intent: 'danger',
@@ -3376,8 +3757,8 @@ var FormEngineImpl = function (_a) {
3376
3757
  },
3377
3758
  ],
3378
3759
  }),
3379
- content: ((0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (_s = options[optionName]) === null || _s === void 0 ? void 0 : _s.display_name, intent: getIntent(optionName, type, other.value, other.op), children: [focusedEditing === optionName ?
3380
- (0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: (_t = options[optionName]) === null || _t === void 0 ? void 0 : _t.desc, shortDescription: (_u = options[optionName]) === null || _u === void 0 ? void 0 : _u.short_desc, longDescriptionShownByDefault: true })
3760
+ content: ((0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (_p = options[optionName]) === null || _p === void 0 ? void 0 : _p.display_name, intent: getIntent(optionName, type, other.value, other.op), children: [focusedEditing === optionName ?
3761
+ (0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: (_q = options[optionName]) === null || _q === void 0 ? void 0 : _q.desc, shortDescription: (_r = options[optionName]) === null || _r === void 0 ? void 0 : _r.short_desc, longDescriptionShownByDefault: true })
3381
3762
  : null, renderOption(optionName, __assign({ type: type }, other))] })),
3382
3763
  });
3383
3764
  }), defaultZoom: 1, zoomable: false, actions: __spreadArray(__spreadArray([], (rest.actions || []).map(function (action) { return (__assign(__assign({}, action), { minimal: true })); }), true), [
@@ -3415,9 +3796,15 @@ var FormEngineImpl = function (_a) {
3415
3796
  * hand is how one of them gets missed.
3416
3797
  */
3417
3798
  var FormEngine = function (props) {
3799
+ var _a;
3800
+ // The form's own `appearance` wins; without one it follows the form (or the
3801
+ // host's provider) it sits in, so a nested sub-form never changes look
3802
+ // halfway down its parent.
3803
+ var inherited = (0, formAppearance_1.useFormAppearance)();
3804
+ var appearance = (_a = props.appearance) !== null && _a !== void 0 ? _a : inherited;
3418
3805
  // what the host knows of references beyond the catalogue, for every chip the form draws (qorus#646)
3419
3806
  var referenceNames = (0, react_2.useMemo)(function () { var _a; return (_a = props.templateReferences) !== null && _a !== void 0 ? _a : NO_REFERENCE_NAMES; }, [props.templateReferences]);
3420
- return ((0, jsx_runtime_1.jsx)(markdownRendererContext_1.MarkdownRendererContext.Provider, { value: props.markdownRenderer, children: (0, jsx_runtime_1.jsx)(typeSentenceForm_1.TypeSentenceFormProvider, { children: (0, jsx_runtime_1.jsx)(referenceNames_1.TemplateReferenceNamesProvider, { value: referenceNames, children: (0, jsx_runtime_1.jsx)(FormEngineImpl, __assign({}, props)) }) }) }));
3807
+ return ((0, jsx_runtime_1.jsx)(markdownRendererContext_1.MarkdownRendererContext.Provider, { value: props.markdownRenderer, children: (0, jsx_runtime_1.jsx)(formAppearance_1.FormAppearanceProvider, { value: appearance, children: (0, jsx_runtime_1.jsx)(typeSentenceForm_1.TypeSentenceFormProvider, { children: (0, jsx_runtime_1.jsx)(referenceNames_1.TemplateReferenceNamesProvider, { value: referenceNames, children: (0, jsx_runtime_1.jsx)(FormEngineImpl, __assign({}, props)) }) }) }) }));
3421
3808
  };
3422
3809
  exports.FormEngine = FormEngine;
3423
3810
  var NO_REFERENCE_NAMES = {};