@qoretechnologies/reqraft 0.10.66-pr.145.gcb1e59d → 0.10.66

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 (913) hide show
  1. package/README.md +53 -1
  2. package/dist/components/Description/AllowedValuesHelp.d.ts +20 -0
  3. package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -0
  4. package/dist/components/Description/AllowedValuesHelp.js +86 -0
  5. package/dist/components/Description/AllowedValuesHelp.js.map +1 -0
  6. package/dist/components/Description/describedControl.d.ts +54 -0
  7. package/dist/components/Description/describedControl.d.ts.map +1 -0
  8. package/dist/components/Description/describedControl.js +81 -0
  9. package/dist/components/Description/describedControl.js.map +1 -0
  10. package/dist/components/Description/index.d.ts.map +1 -1
  11. package/dist/components/Description/index.js +3 -2
  12. package/dist/components/Description/index.js.map +1 -1
  13. package/dist/components/colorValue/colorValue.d.ts +59 -0
  14. package/dist/components/colorValue/colorValue.d.ts.map +1 -0
  15. package/dist/components/colorValue/colorValue.js +245 -0
  16. package/dist/components/colorValue/colorValue.js.map +1 -0
  17. package/dist/components/colorValue/index.d.ts +34 -0
  18. package/dist/components/colorValue/index.d.ts.map +1 -0
  19. package/dist/components/colorValue/index.js +136 -0
  20. package/dist/components/colorValue/index.js.map +1 -0
  21. package/dist/components/colorValue/labels.d.ts +12 -0
  22. package/dist/components/colorValue/labels.d.ts.map +1 -0
  23. package/dist/components/colorValue/labels.js +11 -0
  24. package/dist/components/colorValue/labels.js.map +1 -0
  25. package/dist/components/composer/Composer.d.ts +1 -1
  26. package/dist/components/composer/Composer.d.ts.map +1 -1
  27. package/dist/components/composer/Composer.js +2 -2
  28. package/dist/components/composer/Composer.js.map +1 -1
  29. package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
  30. package/dist/components/dpqlEditor/DpqlEditor.js +156 -10
  31. package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
  32. package/dist/components/dpqlEditor/dpqlCompletions.d.ts +39 -0
  33. package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -0
  34. package/dist/components/dpqlEditor/dpqlCompletions.js +294 -0
  35. package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -0
  36. package/dist/components/dpqlEditor/dpqlHelpers.d.ts +54 -5
  37. package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
  38. package/dist/components/dpqlEditor/dpqlHelpers.js +420 -63
  39. package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
  40. package/dist/components/dpqlEditor/dpqlInserter.d.ts.map +1 -1
  41. package/dist/components/dpqlEditor/dpqlInserter.js +67 -29
  42. package/dist/components/dpqlEditor/dpqlInserter.js.map +1 -1
  43. package/dist/components/dpqlEditor/dpqlTags.d.ts +17 -7
  44. package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
  45. package/dist/components/dpqlEditor/dpqlTags.js +44 -17
  46. package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
  47. package/dist/components/dpqlEditor/types.d.ts +94 -8
  48. package/dist/components/dpqlEditor/types.d.ts.map +1 -1
  49. package/dist/components/dpqlEditor/useDpqlSession.d.ts +7 -2
  50. package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
  51. package/dist/components/dpqlEditor/useDpqlSession.js +49 -17
  52. package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
  53. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  54. package/dist/components/form/engine/CompactRow.js +336 -243
  55. package/dist/components/form/engine/CompactRow.js.map +1 -1
  56. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  57. package/dist/components/form/engine/CompactToolbar.js +20 -57
  58. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  59. package/dist/components/form/engine/FormEngine.d.ts +67 -59
  60. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  61. package/dist/components/form/engine/FormEngine.js +606 -409
  62. package/dist/components/form/engine/FormEngine.js.map +1 -1
  63. package/dist/components/form/engine/HiddenFieldsNote.d.ts +28 -0
  64. package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -0
  65. package/dist/components/form/engine/HiddenFieldsNote.js +32 -0
  66. package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -0
  67. package/dist/components/form/engine/OptionFieldMessages.d.ts +2 -18
  68. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  69. package/dist/components/form/engine/OptionFieldMessages.js +28 -25
  70. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  71. package/dist/components/form/engine/OptionsHelpDialog.d.ts.map +1 -1
  72. package/dist/components/form/engine/OptionsHelpDialog.js +19 -2
  73. package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
  74. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +2 -2
  75. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  76. package/dist/components/form/engine/_structuredData/SchemaDataView.js +11 -31
  77. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  78. package/dist/components/form/engine/compactRowContext.d.ts +30 -6
  79. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  80. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  81. package/dist/components/form/engine/compactRowStyles.d.ts +56 -31
  82. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  83. package/dist/components/form/engine/compactRowStyles.js +121 -110
  84. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  85. package/dist/components/form/engine/compactToolbarColors.d.ts +16 -0
  86. package/dist/components/form/engine/compactToolbarColors.d.ts.map +1 -0
  87. package/dist/components/form/engine/compactToolbarColors.js +21 -0
  88. package/dist/components/form/engine/compactToolbarColors.js.map +1 -0
  89. package/dist/components/form/engine/compactToolbarContext.d.ts +0 -3
  90. package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
  91. package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
  92. package/dist/components/form/engine/inheritProps.d.ts +29 -0
  93. package/dist/components/form/engine/inheritProps.d.ts.map +1 -0
  94. package/dist/components/form/engine/inheritProps.js +43 -0
  95. package/dist/components/form/engine/inheritProps.js.map +1 -0
  96. package/dist/components/form/engine/operatorSummary.d.ts +26 -0
  97. package/dist/components/form/engine/operatorSummary.d.ts.map +1 -0
  98. package/dist/components/form/engine/operatorSummary.js +35 -0
  99. package/dist/components/form/engine/operatorSummary.js.map +1 -0
  100. package/dist/components/form/engine/readFirst.d.ts +26 -22
  101. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  102. package/dist/components/form/engine/readFirst.js +79 -115
  103. package/dist/components/form/engine/readFirst.js.map +1 -1
  104. package/dist/components/form/engine/readFirstColors.d.ts +30 -0
  105. package/dist/components/form/engine/readFirstColors.d.ts.map +1 -0
  106. package/dist/components/form/engine/readFirstColors.js +51 -0
  107. package/dist/components/form/engine/readFirstColors.js.map +1 -0
  108. package/dist/components/form/engine/rowFocus.d.ts +3 -9
  109. package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
  110. package/dist/components/form/engine/rowFocus.js +30 -19
  111. package/dist/components/form/engine/rowFocus.js.map +1 -1
  112. package/dist/components/form/engine/typeChoices.d.ts +1 -1
  113. package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -1
  114. package/dist/components/form/engine/variants/VariantCalmTable.js +2 -1
  115. package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -1
  116. package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -1
  117. package/dist/components/form/engine/variants/VariantCards.js +2 -1
  118. package/dist/components/form/engine/variants/VariantCards.js.map +1 -1
  119. package/dist/components/form/engine/variants/VariantFocus.js +1 -1
  120. package/dist/components/form/engine/variants/VariantFocus.js.map +1 -1
  121. package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -1
  122. package/dist/components/form/engine/variants/VariantMinimal.js +2 -1
  123. package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -1
  124. package/dist/components/form/engine/variants/variantParts.d.ts +1 -1
  125. package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -1
  126. package/dist/components/form/engine/variants/variantParts.js +25 -17
  127. package/dist/components/form/engine/variants/variantParts.js.map +1 -1
  128. package/dist/components/form/expressions/DpqlRendering.d.ts +1 -1
  129. package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
  130. package/dist/components/form/expressions/DpqlRendering.js +7 -6
  131. package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
  132. package/dist/components/form/expressions/ExpressionField.d.ts +67 -3
  133. package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
  134. package/dist/components/form/expressions/ExpressionField.js +536 -114
  135. package/dist/components/form/expressions/ExpressionField.js.map +1 -1
  136. package/dist/components/form/expressions/argumentPresence.d.ts +14 -0
  137. package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -1
  138. package/dist/components/form/expressions/argumentPresence.js +16 -1
  139. package/dist/components/form/expressions/argumentPresence.js.map +1 -1
  140. package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
  141. package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
  142. package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
  143. package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
  144. package/dist/components/form/expressions/builder/argumentLabel.js +30 -11
  145. package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
  146. package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
  147. package/dist/components/form/expressions/builder/argumentWrapper.js +3 -1
  148. package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
  149. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts +9 -0
  150. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
  151. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +30 -27
  152. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
  153. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts +1 -1
  154. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
  155. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +7 -5
  156. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
  157. package/dist/components/form/expressions/builder/index.d.ts +34 -2
  158. package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
  159. package/dist/components/form/expressions/builder/index.js +170 -80
  160. package/dist/components/form/expressions/builder/index.js.map +1 -1
  161. package/dist/components/form/expressions/builder/item.d.ts +6 -2
  162. package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
  163. package/dist/components/form/expressions/builder/item.js +19 -5
  164. package/dist/components/form/expressions/builder/item.js.map +1 -1
  165. package/dist/components/form/expressions/builder/renderTemplate.js +1 -1
  166. package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
  167. package/dist/components/form/expressions/dpqlMockRecordPath.d.ts +11 -0
  168. package/dist/components/form/expressions/dpqlMockRecordPath.d.ts.map +1 -0
  169. package/dist/components/form/expressions/dpqlMockRecordPath.js +254 -0
  170. package/dist/components/form/expressions/dpqlMockRecordPath.js.map +1 -0
  171. package/dist/components/form/expressions/expressionOperands.d.ts +16 -0
  172. package/dist/components/form/expressions/expressionOperands.d.ts.map +1 -0
  173. package/dist/components/form/expressions/expressionOperands.js +97 -0
  174. package/dist/components/form/expressions/expressionOperands.js.map +1 -0
  175. package/dist/components/form/expressions/fieldPath.d.ts +24 -0
  176. package/dist/components/form/expressions/fieldPath.d.ts.map +1 -0
  177. package/dist/components/form/expressions/fieldPath.js +152 -0
  178. package/dist/components/form/expressions/fieldPath.js.map +1 -0
  179. package/dist/components/form/expressions/loneValue.d.ts +17 -0
  180. package/dist/components/form/expressions/loneValue.d.ts.map +1 -0
  181. package/dist/components/form/expressions/loneValue.js +33 -0
  182. package/dist/components/form/expressions/loneValue.js.map +1 -0
  183. package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
  184. package/dist/components/form/expressions/mockExpressions.js +22 -5
  185. package/dist/components/form/expressions/mockExpressions.js.map +1 -1
  186. package/dist/components/form/expressions/renderExpressionToText.d.ts +2 -0
  187. package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
  188. package/dist/components/form/expressions/renderExpressionToText.js +37 -25
  189. package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
  190. package/dist/components/form/expressions/textOfExpression.d.ts +18 -0
  191. package/dist/components/form/expressions/textOfExpression.d.ts.map +1 -0
  192. package/dist/components/form/expressions/textOfExpression.js +49 -0
  193. package/dist/components/form/expressions/textOfExpression.js.map +1 -0
  194. package/dist/components/form/expressions/types.d.ts +12 -0
  195. package/dist/components/form/expressions/types.d.ts.map +1 -1
  196. package/dist/components/form/expressions/types.js +6 -1
  197. package/dist/components/form/expressions/types.js.map +1 -1
  198. package/dist/components/form/expressions/useExpressionType.d.ts +26 -0
  199. package/dist/components/form/expressions/useExpressionType.d.ts.map +1 -0
  200. package/dist/components/form/expressions/useExpressionType.js +181 -0
  201. package/dist/components/form/expressions/useExpressionType.js.map +1 -0
  202. package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
  203. package/dist/components/form/expressions/useRenderExpression.js +13 -9
  204. package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
  205. package/dist/components/form/expressions/wildcardExpressions.d.ts +27 -0
  206. package/dist/components/form/expressions/wildcardExpressions.d.ts.map +1 -0
  207. package/dist/components/form/expressions/wildcardExpressions.js +101 -0
  208. package/dist/components/form/expressions/wildcardExpressions.js.map +1 -0
  209. package/dist/components/form/fields/Field.d.ts.map +1 -1
  210. package/dist/components/form/fields/Field.js +39 -18
  211. package/dist/components/form/fields/Field.js.map +1 -1
  212. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +0 -7
  213. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  214. package/dist/components/form/fields/allowed-values/AllowedValues.js +46 -35
  215. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  216. package/dist/components/form/fields/allowed-values/choicePicture.d.ts +37 -0
  217. package/dist/components/form/fields/allowed-values/choicePicture.d.ts.map +1 -0
  218. package/dist/components/form/fields/allowed-values/choicePicture.js +64 -0
  219. package/dist/components/form/fields/allowed-values/choicePicture.js.map +1 -0
  220. package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
  221. package/dist/components/form/fields/array/ArrayAuto.js +24 -0
  222. package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
  223. package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
  224. package/dist/components/form/fields/array/ArrayAutoField.js +36 -13
  225. package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
  226. package/dist/components/form/fields/auto/AutoFormField.d.ts +30 -1
  227. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  228. package/dist/components/form/fields/auto/AutoFormField.js +123 -79
  229. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  230. package/dist/components/form/fields/auto/hostEditorValue.d.ts +30 -0
  231. package/dist/components/form/fields/auto/hostEditorValue.d.ts.map +1 -0
  232. package/dist/components/form/fields/auto/hostEditorValue.js +53 -0
  233. package/dist/components/form/fields/auto/hostEditorValue.js.map +1 -0
  234. package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
  235. package/dist/components/form/fields/binary/Binary.js +23 -3
  236. package/dist/components/form/fields/binary/Binary.js.map +1 -1
  237. package/dist/components/form/fields/boolean/Boolean.d.ts +5 -0
  238. package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
  239. package/dist/components/form/fields/boolean/Boolean.js +9 -1
  240. package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
  241. package/dist/components/form/fields/color/Color.d.ts +103 -16
  242. package/dist/components/form/fields/color/Color.d.ts.map +1 -1
  243. package/dist/components/form/fields/color/Color.js +616 -16
  244. package/dist/components/form/fields/color/Color.js.map +1 -1
  245. package/dist/components/form/fields/emittedValues.d.ts +34 -3
  246. package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
  247. package/dist/components/form/fields/emittedValues.js +24 -1
  248. package/dist/components/form/fields/emittedValues.js.map +1 -1
  249. package/dist/components/form/fields/file/File.d.ts +1 -1
  250. package/dist/components/form/fields/file/File.d.ts.map +1 -1
  251. package/dist/components/form/fields/file/File.js +4 -2
  252. package/dist/components/form/fields/file/File.js.map +1 -1
  253. package/dist/components/form/fields/long-string/LongString.d.ts +1 -7
  254. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  255. package/dist/components/form/fields/long-string/LongString.js +30 -13
  256. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  257. package/dist/components/form/fields/markdown/MarkdownView.js +1 -1
  258. package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
  259. package/dist/components/form/fields/multi-select/MultiSelectFormField.js +10 -7
  260. package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
  261. package/dist/components/form/fields/number/Number.d.ts +7 -4
  262. package/dist/components/form/fields/number/Number.d.ts.map +1 -1
  263. package/dist/components/form/fields/number/Number.js +45 -18
  264. package/dist/components/form/fields/number/Number.js.map +1 -1
  265. package/dist/components/form/fields/object/Object.d.ts +1 -1
  266. package/dist/components/form/fields/object/Object.d.ts.map +1 -1
  267. package/dist/components/form/fields/object/Object.js +4 -2
  268. package/dist/components/form/fields/object/Object.js.map +1 -1
  269. package/dist/components/form/fields/pendingEdit.d.ts +52 -0
  270. package/dist/components/form/fields/pendingEdit.d.ts.map +1 -0
  271. package/dist/components/form/fields/pendingEdit.js +79 -0
  272. package/dist/components/form/fields/pendingEdit.js.map +1 -0
  273. package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
  274. package/dist/components/form/fields/radio-group/RadioGroup.js +8 -13
  275. package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
  276. package/dist/components/form/fields/rich-text/RichText.d.ts +20 -1
  277. package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
  278. package/dist/components/form/fields/rich-text/RichText.js +426 -91
  279. package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
  280. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +18 -0
  281. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -0
  282. package/dist/components/form/fields/rich-text/useTemplateTags.js +80 -0
  283. package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
  284. package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
  285. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +4 -1
  286. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
  287. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
  288. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +20 -5
  289. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
  290. package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
  291. package/dist/components/form/fields/schema-definition/TableEditor.js +10 -2
  292. package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
  293. package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
  294. package/dist/components/form/fields/schema-definition/index.js +8 -4
  295. package/dist/components/form/fields/schema-definition/index.js.map +1 -1
  296. package/dist/components/form/fields/select/Select.d.ts +10 -1
  297. package/dist/components/form/fields/select/Select.d.ts.map +1 -1
  298. package/dist/components/form/fields/select/Select.js +28 -14
  299. package/dist/components/form/fields/select/Select.js.map +1 -1
  300. package/dist/components/form/fields/select/SelectCollection.d.ts +5 -0
  301. package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
  302. package/dist/components/form/fields/select/SelectCollection.js +25 -12
  303. package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
  304. package/dist/components/form/fields/select/unavailableRow.d.ts +23 -0
  305. package/dist/components/form/fields/select/unavailableRow.d.ts.map +1 -0
  306. package/dist/components/form/fields/select/unavailableRow.js +55 -0
  307. package/dist/components/form/fields/select/unavailableRow.js.map +1 -0
  308. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +11 -5
  309. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
  310. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +21 -5
  311. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
  312. package/dist/components/form/fields/template/TemplateBrowser.d.ts +16 -0
  313. package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
  314. package/dist/components/form/fields/template/TemplateBrowser.js +89 -0
  315. package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
  316. package/dist/components/form/fields/template/TemplateField.d.ts +105 -1
  317. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  318. package/dist/components/form/fields/template/TemplateField.js +706 -168
  319. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  320. package/dist/components/form/fields/template/TemplatePicker.d.ts +54 -0
  321. package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -0
  322. package/dist/components/form/fields/template/TemplatePicker.js +459 -0
  323. package/dist/components/form/fields/template/TemplatePicker.js.map +1 -0
  324. package/dist/components/form/fields/template/TemplateText.d.ts +0 -17
  325. package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -1
  326. package/dist/components/form/fields/template/TemplateText.js +22 -16
  327. package/dist/components/form/fields/template/TemplateText.js.map +1 -1
  328. package/dist/components/form/fields/template/referenceNames.d.ts +63 -0
  329. package/dist/components/form/fields/template/referenceNames.d.ts.map +1 -0
  330. package/dist/components/form/fields/template/referenceNames.js +69 -0
  331. package/dist/components/form/fields/template/referenceNames.js.map +1 -0
  332. package/dist/components/form/fields/template/writtenAsText.d.ts +61 -0
  333. package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
  334. package/dist/components/form/fields/template/writtenAsText.js +204 -0
  335. package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
  336. package/dist/components/form/index.d.ts +12 -2
  337. package/dist/components/form/index.d.ts.map +1 -1
  338. package/dist/components/form/index.js +25 -3
  339. package/dist/components/form/index.js.map +1 -1
  340. package/dist/components/form/typeSentenceForm.d.ts +17 -0
  341. package/dist/components/form/typeSentenceForm.d.ts.map +1 -0
  342. package/dist/components/form/typeSentenceForm.js +54 -0
  343. package/dist/components/form/typeSentenceForm.js.map +1 -0
  344. package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
  345. package/dist/components/imageLightbox/ImageLightbox.js +19 -9
  346. package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
  347. package/dist/components/log/Log.d.ts.map +1 -1
  348. package/dist/components/log/Log.js +20 -8
  349. package/dist/components/log/Log.js.map +1 -1
  350. package/dist/components/menu/Menu.d.ts.map +1 -1
  351. package/dist/components/menu/Menu.js +19 -10
  352. package/dist/components/menu/Menu.js.map +1 -1
  353. package/dist/components/smartEditor/CompletionMenu.d.ts +53 -0
  354. package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
  355. package/dist/components/smartEditor/CompletionMenu.js +302 -0
  356. package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
  357. package/dist/components/smartEditor/MarkdownDoc.d.ts +1 -1
  358. package/dist/components/smartEditor/MarkdownDoc.js +3 -3
  359. package/dist/components/smartEditor/MarkdownDoc.js.map +1 -1
  360. package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
  361. package/dist/components/smartEditor/SmartEditor.js +616 -190
  362. package/dist/components/smartEditor/SmartEditor.js.map +1 -1
  363. package/dist/components/smartEditor/completionStyle.d.ts +28 -0
  364. package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
  365. package/dist/components/smartEditor/completionStyle.js +79 -0
  366. package/dist/components/smartEditor/completionStyle.js.map +1 -0
  367. package/dist/components/smartEditor/contextTitle.d.ts +10 -0
  368. package/dist/components/smartEditor/contextTitle.d.ts.map +1 -0
  369. package/dist/components/smartEditor/contextTitle.js +21 -0
  370. package/dist/components/smartEditor/contextTitle.js.map +1 -0
  371. package/dist/components/smartEditor/editingAids.d.ts +64 -0
  372. package/dist/components/smartEditor/editingAids.d.ts.map +1 -0
  373. package/dist/components/smartEditor/editingAids.js +213 -0
  374. package/dist/components/smartEditor/editingAids.js.map +1 -0
  375. package/dist/components/smartEditor/index.d.ts +6 -1
  376. package/dist/components/smartEditor/index.d.ts.map +1 -1
  377. package/dist/components/smartEditor/index.js +19 -1
  378. package/dist/components/smartEditor/index.js.map +1 -1
  379. package/dist/components/smartEditor/templateCompletions.d.ts +98 -0
  380. package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
  381. package/dist/components/smartEditor/templateCompletions.js +380 -0
  382. package/dist/components/smartEditor/templateCompletions.js.map +1 -0
  383. package/dist/components/smartEditor/typedReferences.d.ts +34 -0
  384. package/dist/components/smartEditor/typedReferences.d.ts.map +1 -0
  385. package/dist/components/smartEditor/typedReferences.js +179 -0
  386. package/dist/components/smartEditor/typedReferences.js.map +1 -0
  387. package/dist/components/smartEditor/types.d.ts +116 -2
  388. package/dist/components/smartEditor/types.d.ts.map +1 -1
  389. package/dist/components/smartEditor/useEditingAids.d.ts +38 -0
  390. package/dist/components/smartEditor/useEditingAids.d.ts.map +1 -0
  391. package/dist/components/smartEditor/useEditingAids.js +392 -0
  392. package/dist/components/smartEditor/useEditingAids.js.map +1 -0
  393. package/dist/components/smartEditor/useLspAutocomplete.d.ts +106 -3
  394. package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
  395. package/dist/components/smartEditor/useLspAutocomplete.js +592 -149
  396. package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
  397. package/dist/components/smartEditor/useLspHover.d.ts +33 -7
  398. package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
  399. package/dist/components/smartEditor/useLspHover.js +364 -35
  400. package/dist/components/smartEditor/useLspHover.js.map +1 -1
  401. package/dist/components/smartEditor/useLspSemanticTokens.js +1 -1
  402. package/dist/components/smartEditor/useLspSemanticTokens.js.map +1 -1
  403. package/dist/components/smartEditor/useLspSession.d.ts +6 -0
  404. package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
  405. package/dist/components/smartEditor/useLspSession.js +7 -6
  406. package/dist/components/smartEditor/useLspSession.js.map +1 -1
  407. package/dist/components/smartEditor/useLspSignatureHelp.d.ts.map +1 -1
  408. package/dist/components/smartEditor/useLspSignatureHelp.js +6 -11
  409. package/dist/components/smartEditor/useLspSignatureHelp.js.map +1 -1
  410. package/dist/components/smartEditor/useTabCameIn.d.ts +10 -0
  411. package/dist/components/smartEditor/useTabCameIn.d.ts.map +1 -0
  412. package/dist/components/smartEditor/useTabCameIn.js +42 -0
  413. package/dist/components/smartEditor/useTabCameIn.js.map +1 -0
  414. package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
  415. package/dist/components/supportTicket/AttachmentChips.js +15 -5
  416. package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
  417. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +2 -3
  418. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
  419. package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
  420. package/dist/components/supportTicket/ReferencePicker.d.ts +9 -3
  421. package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
  422. package/dist/components/supportTicket/ReferencePicker.js +38 -23
  423. package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
  424. package/dist/components/supportTicket/TicketHeader.d.ts +3 -4
  425. package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
  426. package/dist/components/supportTicket/TicketHeader.js +21 -6
  427. package/dist/components/supportTicket/TicketHeader.js.map +1 -1
  428. package/dist/components/supportTicket/TicketMetaTags.d.ts +1 -1
  429. package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
  430. package/dist/components/supportTicket/TicketReplyBox.js +10 -29
  431. package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
  432. package/dist/components/supportTicket/useLoadedImages.d.ts +0 -10
  433. package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
  434. package/dist/components/supportTicket/useLoadedImages.js +1 -63
  435. package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
  436. package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
  437. package/dist/components/ticketReferences/TicketReferences.js +10 -9
  438. package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
  439. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  440. package/dist/components/ticketThread/TicketThread.js +52 -21
  441. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  442. package/dist/helpers/allowedValues.d.ts +21 -12
  443. package/dist/helpers/allowedValues.d.ts.map +1 -1
  444. package/dist/helpers/allowedValues.js +40 -20
  445. package/dist/helpers/allowedValues.js.map +1 -1
  446. package/dist/helpers/descriptionTooltip.d.ts +46 -0
  447. package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
  448. package/dist/helpers/descriptionTooltip.js +76 -0
  449. package/dist/helpers/descriptionTooltip.js.map +1 -0
  450. package/dist/helpers/domProps.d.ts +5 -0
  451. package/dist/helpers/domProps.d.ts.map +1 -0
  452. package/dist/helpers/domProps.js +47 -0
  453. package/dist/helpers/domProps.js.map +1 -0
  454. package/dist/helpers/expressions.d.ts +115 -4
  455. package/dist/helpers/expressions.d.ts.map +1 -1
  456. package/dist/helpers/expressions.js +247 -29
  457. package/dist/helpers/expressions.js.map +1 -1
  458. package/dist/helpers/hoveringPointer.d.ts +26 -0
  459. package/dist/helpers/hoveringPointer.d.ts.map +1 -0
  460. package/dist/helpers/hoveringPointer.js +29 -0
  461. package/dist/helpers/hoveringPointer.js.map +1 -0
  462. package/dist/helpers/markdownText.d.ts +14 -0
  463. package/dist/helpers/markdownText.d.ts.map +1 -0
  464. package/dist/helpers/markdownText.js +160 -0
  465. package/dist/helpers/markdownText.js.map +1 -0
  466. package/dist/helpers/noDescription.d.ts +9 -0
  467. package/dist/helpers/noDescription.d.ts.map +1 -0
  468. package/dist/helpers/noDescription.js +13 -0
  469. package/dist/helpers/noDescription.js.map +1 -0
  470. package/dist/helpers/optionUiTypes.d.ts +2 -2
  471. package/dist/helpers/qorusTypeCatalogue.d.ts +147 -0
  472. package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -0
  473. package/dist/helpers/qorusTypeCatalogue.js +505 -0
  474. package/dist/helpers/qorusTypeCatalogue.js.map +1 -0
  475. package/dist/helpers/readableColors.d.ts +36 -0
  476. package/dist/helpers/readableColors.d.ts.map +1 -0
  477. package/dist/helpers/readableColors.js +116 -0
  478. package/dist/helpers/readableColors.js.map +1 -0
  479. package/dist/helpers/recordFieldReference.d.ts +15 -0
  480. package/dist/helpers/recordFieldReference.d.ts.map +1 -0
  481. package/dist/helpers/recordFieldReference.js +89 -0
  482. package/dist/helpers/recordFieldReference.js.map +1 -0
  483. package/dist/helpers/singleLineString.d.ts.map +1 -1
  484. package/dist/helpers/singleLineString.js +0 -1
  485. package/dist/helpers/singleLineString.js.map +1 -1
  486. package/dist/helpers/templateCatalogue.d.ts +104 -0
  487. package/dist/helpers/templateCatalogue.d.ts.map +1 -0
  488. package/dist/helpers/templateCatalogue.js +116 -0
  489. package/dist/helpers/templateCatalogue.js.map +1 -0
  490. package/dist/helpers/templateCatalogueContext.d.ts +19 -0
  491. package/dist/helpers/templateCatalogueContext.d.ts.map +1 -0
  492. package/dist/helpers/templateCatalogueContext.js +31 -0
  493. package/dist/helpers/templateCatalogueContext.js.map +1 -0
  494. package/dist/helpers/templateItems.d.ts +2 -2
  495. package/dist/helpers/templateItems.d.ts.map +1 -1
  496. package/dist/helpers/templateItems.js +6 -4
  497. package/dist/helpers/templateItems.js.map +1 -1
  498. package/dist/helpers/templateText.d.ts +1 -0
  499. package/dist/helpers/templateText.d.ts.map +1 -1
  500. package/dist/helpers/templateText.js +7 -3
  501. package/dist/helpers/templateText.js.map +1 -1
  502. package/dist/helpers/templateTree.d.ts +248 -0
  503. package/dist/helpers/templateTree.d.ts.map +1 -0
  504. package/dist/helpers/templateTree.js +892 -0
  505. package/dist/helpers/templateTree.js.map +1 -0
  506. package/dist/helpers/templateType.d.ts +28 -0
  507. package/dist/helpers/templateType.d.ts.map +1 -0
  508. package/dist/helpers/templateType.js +30 -0
  509. package/dist/helpers/templateType.js.map +1 -0
  510. package/dist/helpers/templates.d.ts +86 -16
  511. package/dist/helpers/templates.d.ts.map +1 -1
  512. package/dist/helpers/templates.js +305 -45
  513. package/dist/helpers/templates.js.map +1 -1
  514. package/dist/helpers/validations.d.ts +27 -0
  515. package/dist/helpers/validations.d.ts.map +1 -1
  516. package/dist/helpers/validations.js +169 -39
  517. package/dist/helpers/validations.js.map +1 -1
  518. package/dist/helpers/webLink.d.ts +8 -0
  519. package/dist/helpers/webLink.d.ts.map +1 -0
  520. package/dist/helpers/webLink.js +29 -0
  521. package/dist/helpers/webLink.js.map +1 -0
  522. package/dist/hooks/useQorusTypes.d.ts +12 -17
  523. package/dist/hooks/useQorusTypes.d.ts.map +1 -1
  524. package/dist/hooks/useQorusTypes.js +44 -172
  525. package/dist/hooks/useQorusTypes.js.map +1 -1
  526. package/dist/hooks/useReadableIntentShade.d.ts +9 -0
  527. package/dist/hooks/useReadableIntentShade.d.ts.map +1 -0
  528. package/dist/hooks/useReadableIntentShade.js +23 -0
  529. package/dist/hooks/useReadableIntentShade.js.map +1 -0
  530. package/dist/hooks/useReadableOpacity.d.ts +6 -0
  531. package/dist/hooks/useReadableOpacity.d.ts.map +1 -0
  532. package/dist/hooks/useReadableOpacity.js +17 -0
  533. package/dist/hooks/useReadableOpacity.js.map +1 -0
  534. package/dist/index.d.ts +8 -0
  535. package/dist/index.d.ts.map +1 -1
  536. package/dist/index.js +24 -1
  537. package/dist/index.js.map +1 -1
  538. package/dist/tracking/ui/ExperimentCard.d.ts +1 -1
  539. package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
  540. package/dist/tracking/ui/ExperimentCard.js +26 -10
  541. package/dist/tracking/ui/ExperimentCard.js.map +1 -1
  542. package/dist/tracking/ui/card.d.ts +2 -2
  543. package/dist/tracking/ui/card.d.ts.map +1 -1
  544. package/dist/tracking/ui/card.js +2 -2
  545. package/dist/tracking/ui/card.js.map +1 -1
  546. package/dist/tracking/ui/readable.d.ts +14 -0
  547. package/dist/tracking/ui/readable.d.ts.map +1 -0
  548. package/dist/tracking/ui/readable.js +60 -0
  549. package/dist/tracking/ui/readable.js.map +1 -0
  550. package/dist/utils/fetch.d.ts +9 -2
  551. package/dist/utils/fetch.d.ts.map +1 -1
  552. package/dist/utils/fetch.js +6 -5
  553. package/dist/utils/fetch.js.map +1 -1
  554. package/dist/utils/lspClient.types.d.ts +2 -0
  555. package/dist/utils/lspClient.types.d.ts.map +1 -1
  556. package/dist/utils/websocket.d.ts +65 -2
  557. package/dist/utils/websocket.d.ts.map +1 -1
  558. package/dist/utils/websocket.js +276 -44
  559. package/dist/utils/websocket.js.map +1 -1
  560. package/package.json +14 -6
  561. package/.claude/CLAUDE.md +0 -317
  562. package/.tasks/EXPORT_EXPRESSION_BUILDER.md +0 -38
  563. package/.tasks/EXPRESSION_BUILDER_REPORT.md +0 -149
  564. package/.tasks/EXPRESSION_FIELD_SEAMS.md +0 -66
  565. package/.tasks/FIELD_STACK_REPORT.md +0 -234
  566. package/.tasks/FORM_ENGINE_COMPACT_READ_FIRST.md +0 -558
  567. package/.tasks/FORM_ENGINE_EXPRESSIONS.md +0 -197
  568. package/.tasks/FORM_ENGINE_OPTIONS_SYNC.md +0 -95
  569. package/.tasks/FORM_FIELD_EXTRAS.md +0 -72
  570. package/.tasks/INDEX.md +0 -111
  571. package/.tasks/LSP_SHARED_CONNECTION.md +0 -75
  572. package/.tasks/QONSOLE_ASSIST_FEATURES.md +0 -306
  573. package/.tasks/RENDER_EXPRESSION_LSP.md +0 -159
  574. package/.tasks/REQRAFT_AUTO_FIELD.md +0 -176
  575. package/.tasks/SCHEMA_DEFINITION_FIELD.md +0 -250
  576. package/.tasks/SMART_EDITOR_CONTEXT_AND_POLISH.md +0 -340
  577. package/.tasks/SMART_EDITOR_LSP_FEATURES.md +0 -299
  578. package/.tasks/SMART_EDITOR_REVIEW_FOLLOWUPS.md +0 -280
  579. package/.tasks/SMART_EDITOR_UX_POLISH.md +0 -383
  580. package/.tasks/SMART_EDITOR_VISUAL_POLISH.md +0 -246
  581. package/.tasks/STORY_NETWORK_ISOLATION.md +0 -98
  582. package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +0 -72
  583. package/CODE_OF_CONDUCT.md +0 -105
  584. package/CONTRIBUTING.MD +0 -78
  585. package/SECURITY.md +0 -3
  586. package/chromatic.config.json +0 -5
  587. package/design/COMPACT_ENGINE_REDESIGN.md +0 -156
  588. package/design/COMPACT_INFO_DISPLAY.md +0 -87
  589. package/design/COMPACT_PARITY.md +0 -85
  590. package/design/EXPRESSION_BUILDER_REPORT_STRATEGY.md +0 -92
  591. package/design/FORM_ENGINE_COMPACT.md +0 -300
  592. package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +0 -353
  593. package/design/FORM_ENGINE_EXPRESSIONS.md +0 -257
  594. package/design/FORM_ENGINE_FIELD_MIGRATION.md +0 -419
  595. package/design/IDE_INTEGRATION.md +0 -64
  596. package/design/RENDER_EXPRESSION_TRANSPORT.md +0 -156
  597. package/design/SELECT_DIALOG_FLOOR.md +0 -86
  598. package/design/SMART_EDITOR_UX.md +0 -438
  599. package/design/TRACKING.md +0 -290
  600. package/design/UNAVAILABLE_ALLOWED_VALUES.md +0 -226
  601. package/dist/components/form/engine/formAppearance.d.ts +0 -49
  602. package/dist/components/form/engine/formAppearance.d.ts.map +0 -1
  603. package/dist/components/form/engine/formAppearance.js +0 -50
  604. package/dist/components/form/engine/formAppearance.js.map +0 -1
  605. package/dist/components/form/fields/ChoiceGroupHeading.d.ts +0 -21
  606. package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +0 -1
  607. package/dist/components/form/fields/ChoiceGroupHeading.js +0 -33
  608. package/dist/components/form/fields/ChoiceGroupHeading.js.map +0 -1
  609. package/dist/components/form/fields/allowed-values/savedValues.d.ts +0 -30
  610. package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +0 -1
  611. package/dist/components/form/fields/allowed-values/savedValues.js +0 -39
  612. package/dist/components/form/fields/allowed-values/savedValues.js.map +0 -1
  613. package/dist/helpers/fieldDescription.d.ts +0 -16
  614. package/dist/helpers/fieldDescription.d.ts.map +0 -1
  615. package/dist/helpers/fieldDescription.js +0 -40
  616. package/dist/helpers/fieldDescription.js.map +0 -1
  617. package/src/components/Description/index.tsx +0 -254
  618. package/src/components/Description/markdownRendererContext.tsx +0 -29
  619. package/src/components/FocusedEditing/index.tsx +0 -50
  620. package/src/components/codeSize/index.tsx +0 -79
  621. package/src/components/composer/Composer.stories.tsx +0 -238
  622. package/src/components/composer/Composer.tsx +0 -554
  623. package/src/components/composer/helpers.ts +0 -74
  624. package/src/components/composer/index.ts +0 -2
  625. package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -1183
  626. package/src/components/dpqlEditor/DpqlEditor.tsx +0 -219
  627. package/src/components/dpqlEditor/dpqlHelpers.ts +0 -287
  628. package/src/components/dpqlEditor/dpqlInserter.ts +0 -121
  629. package/src/components/dpqlEditor/dpqlProbe.ts +0 -165
  630. package/src/components/dpqlEditor/dpqlTags.ts +0 -114
  631. package/src/components/dpqlEditor/index.ts +0 -41
  632. package/src/components/dpqlEditor/types.ts +0 -203
  633. package/src/components/dpqlEditor/useDpqlProbe.ts +0 -33
  634. package/src/components/dpqlEditor/useDpqlSession.ts +0 -411
  635. package/src/components/form/engine/CompactRow.tsx +0 -2740
  636. package/src/components/form/engine/CompactToolbar.tsx +0 -399
  637. package/src/components/form/engine/FormEngine.stories.tsx +0 -9934
  638. package/src/components/form/engine/FormEngine.tsx +0 -4891
  639. package/src/components/form/engine/FormEngineAppearance.stories.tsx +0 -609
  640. package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
  641. package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -335
  642. package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
  643. package/src/components/form/engine/OptionFieldMessages.tsx +0 -548
  644. package/src/components/form/engine/OptionsHelpDialog.tsx +0 -29
  645. package/src/components/form/engine/__fixtures__/basicFormOptions.ts +0 -309
  646. package/src/components/form/engine/__fixtures__/fieldChromeOptions.ts +0 -45
  647. package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +0 -233
  648. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +0 -755
  649. package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +0 -85
  650. package/src/components/form/engine/_structuredData/StructuredDataView.tsx +0 -75
  651. package/src/components/form/engine/_structuredData/structuredData.ts +0 -145
  652. package/src/components/form/engine/compactRowContext.ts +0 -153
  653. package/src/components/form/engine/compactRowStyles.ts +0 -1087
  654. package/src/components/form/engine/compactToolbarContext.ts +0 -72
  655. package/src/components/form/engine/formAppearance.ts +0 -79
  656. package/src/components/form/engine/optionActions.ts +0 -128
  657. package/src/components/form/engine/optionsContext.ts +0 -24
  658. package/src/components/form/engine/readFirst.ts +0 -1090
  659. package/src/components/form/engine/rendererTypes.ts +0 -107
  660. package/src/components/form/engine/revealRow.ts +0 -123
  661. package/src/components/form/engine/rowFocus.ts +0 -112
  662. package/src/components/form/engine/rowMenuContext.ts +0 -159
  663. package/src/components/form/engine/rowOpenPicker.ts +0 -27
  664. package/src/components/form/engine/typeChoices.ts +0 -63
  665. package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +0 -159
  666. package/src/components/form/engine/variants/VariantCalmTable.tsx +0 -244
  667. package/src/components/form/engine/variants/VariantCards.tsx +0 -212
  668. package/src/components/form/engine/variants/VariantFocus.tsx +0 -382
  669. package/src/components/form/engine/variants/VariantMinimal.tsx +0 -170
  670. package/src/components/form/engine/variants/focusDemo.ts +0 -145
  671. package/src/components/form/engine/variants/variantModel.ts +0 -223
  672. package/src/components/form/engine/variants/variantParts.tsx +0 -313
  673. package/src/components/form/expressions/DpqlRendering.tsx +0 -85
  674. package/src/components/form/expressions/ExpressionField.stories.tsx +0 -1395
  675. package/src/components/form/expressions/ExpressionField.tsx +0 -503
  676. package/src/components/form/expressions/argumentPresence.ts +0 -213
  677. package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +0 -1683
  678. package/src/components/form/expressions/builder/argumentDetail.tsx +0 -17
  679. package/src/components/form/expressions/builder/argumentLabel.tsx +0 -146
  680. package/src/components/form/expressions/builder/argumentSlot.tsx +0 -101
  681. package/src/components/form/expressions/builder/argumentWrapper.tsx +0 -243
  682. package/src/components/form/expressions/builder/confirmMismatchedTypesModal.tsx +0 -120
  683. package/src/components/form/expressions/builder/confirmUnsupportedTypeModal.tsx +0 -69
  684. package/src/components/form/expressions/builder/index.tsx +0 -1545
  685. package/src/components/form/expressions/builder/item.tsx +0 -89
  686. package/src/components/form/expressions/builder/moveToPositionStrip.tsx +0 -156
  687. package/src/components/form/expressions/builder/renderTemplate.tsx +0 -42
  688. package/src/components/form/expressions/dpqlMockLanguage.ts +0 -566
  689. package/src/components/form/expressions/dpqlMockLsp.ts +0 -126
  690. package/src/components/form/expressions/mockExpressions.ts +0 -317
  691. package/src/components/form/expressions/renderExpressionToText.ts +0 -152
  692. package/src/components/form/expressions/types.ts +0 -110
  693. package/src/components/form/expressions/useExpressions.ts +0 -101
  694. package/src/components/form/expressions/useRenderExpression.ts +0 -165
  695. package/src/components/form/fields/ChoiceGroupHeading.tsx +0 -38
  696. package/src/components/form/fields/Field.stories.tsx +0 -143
  697. package/src/components/form/fields/Field.tsx +0 -734
  698. package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -321
  699. package/src/components/form/fields/allowed-values/savedValues.ts +0 -64
  700. package/src/components/form/fields/array/ArrayAuto.tsx +0 -237
  701. package/src/components/form/fields/array/ArrayAutoField.stories.tsx +0 -475
  702. package/src/components/form/fields/array/ArrayAutoField.tsx +0 -367
  703. package/src/components/form/fields/auto/AutoFormField.stories.tsx +0 -825
  704. package/src/components/form/fields/auto/AutoFormField.tsx +0 -1183
  705. package/src/components/form/fields/binary/Binary.stories.tsx +0 -122
  706. package/src/components/form/fields/binary/Binary.tsx +0 -91
  707. package/src/components/form/fields/boolean/Boolean.stories.tsx +0 -125
  708. package/src/components/form/fields/boolean/Boolean.tsx +0 -34
  709. package/src/components/form/fields/byte-size/ByteSize.stories.tsx +0 -87
  710. package/src/components/form/fields/byte-size/ByteSize.tsx +0 -58
  711. package/src/components/form/fields/color/Color.stories.tsx +0 -99
  712. package/src/components/form/fields/color/Color.tsx +0 -46
  713. package/src/components/form/fields/cron/Cron.stories.tsx +0 -68
  714. package/src/components/form/fields/cron/Cron.tsx +0 -80
  715. package/src/components/form/fields/date/Date.stories.tsx +0 -77
  716. package/src/components/form/fields/date/Date.tsx +0 -55
  717. package/src/components/form/fields/emittedValues.ts +0 -70
  718. package/src/components/form/fields/file/File.stories.tsx +0 -161
  719. package/src/components/form/fields/file/File.tsx +0 -227
  720. package/src/components/form/fields/long-string/LongString.stories.tsx +0 -147
  721. package/src/components/form/fields/long-string/LongString.tsx +0 -141
  722. package/src/components/form/fields/markdown/Markdown.stories.tsx +0 -76
  723. package/src/components/form/fields/markdown/Markdown.tsx +0 -81
  724. package/src/components/form/fields/markdown/MarkdownView.tsx +0 -222
  725. package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +0 -140
  726. package/src/components/form/fields/number/Number.stories.tsx +0 -159
  727. package/src/components/form/fields/number/Number.tsx +0 -175
  728. package/src/components/form/fields/object/Object.stories.tsx +0 -398
  729. package/src/components/form/fields/object/Object.tsx +0 -255
  730. package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +0 -95
  731. package/src/components/form/fields/radio-group/RadioGroup.tsx +0 -52
  732. package/src/components/form/fields/radio-group/images/java-96x128.png +0 -0
  733. package/src/components/form/fields/radio-group/images/python-129x128.png +0 -0
  734. package/src/components/form/fields/radio-group/images/qore-106x128.png +0 -0
  735. package/src/components/form/fields/rich-text/RichText.stories.tsx +0 -260
  736. package/src/components/form/fields/rich-text/RichText.tsx +0 -537
  737. package/src/components/form/fields/schema-definition/CatalogLeafForm.tsx +0 -242
  738. package/src/components/form/fields/schema-definition/CatalogNodeEditor.tsx +0 -758
  739. package/src/components/form/fields/schema-definition/Hint.tsx +0 -22
  740. package/src/components/form/fields/schema-definition/InlineValidationBanner.tsx +0 -138
  741. package/src/components/form/fields/schema-definition/Loader.tsx +0 -20
  742. package/src/components/form/fields/schema-definition/MigrationsTab.tsx +0 -187
  743. package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +0 -286
  744. package/src/components/form/fields/schema-definition/TableEditor.tsx +0 -155
  745. package/src/components/form/fields/schema-definition/TablesTab.tsx +0 -138
  746. package/src/components/form/fields/schema-definition/catalog.ts +0 -237
  747. package/src/components/form/fields/schema-definition/helpers.ts +0 -90
  748. package/src/components/form/fields/schema-definition/index.tsx +0 -418
  749. package/src/components/form/fields/schema-definition/mockCatalog.ts +0 -325
  750. package/src/components/form/fields/schema-definition/mockDefinition.ts +0 -111
  751. package/src/components/form/fields/schema-definition/referenceSuggestions.tsx +0 -152
  752. package/src/components/form/fields/schema-definition/starterTemplate.ts +0 -68
  753. package/src/components/form/fields/schema-definition/types.ts +0 -185
  754. package/src/components/form/fields/schema-definition/useSchemaOptionCatalog.ts +0 -49
  755. package/src/components/form/fields/select/Select.stories.tsx +0 -872
  756. package/src/components/form/fields/select/Select.tsx +0 -624
  757. package/src/components/form/fields/select/SelectCollection.tsx +0 -594
  758. package/src/components/form/fields/string/String.stories.tsx +0 -86
  759. package/src/components/form/fields/string/String.tsx +0 -43
  760. package/src/components/form/fields/template/ExampleValueModal.stories.tsx +0 -114
  761. package/src/components/form/fields/template/ExampleValueModal.tsx +0 -99
  762. package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +0 -47
  763. package/src/components/form/fields/template/TemplateField.stories.tsx +0 -1121
  764. package/src/components/form/fields/template/TemplateField.tsx +0 -1749
  765. package/src/components/form/fields/template/TemplateText.tsx +0 -115
  766. package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +0 -7
  767. package/src/components/form/fields/template/__fixtures__/multiLevelTemplates.json +0 -147
  768. package/src/components/form/fields/template/__fixtures__/templates.json +0 -83
  769. package/src/components/form/fields/timeout/Timeout.stories.tsx +0 -228
  770. package/src/components/form/fields/timeout/Timeout.tsx +0 -87
  771. package/src/components/form/fields/url/Url.stories.tsx +0 -94
  772. package/src/components/form/fields/url/Url.tsx +0 -85
  773. package/src/components/form/index.tsx +0 -49
  774. package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
  775. package/src/components/imageLightbox/ImageLightbox.tsx +0 -238
  776. package/src/components/imageLightbox/index.ts +0 -1
  777. package/src/components/log/Log.stories.tsx +0 -333
  778. package/src/components/log/Log.tsx +0 -285
  779. package/src/components/menu/Menu.stories.tsx +0 -155
  780. package/src/components/menu/Menu.tsx +0 -312
  781. package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +0 -797
  782. package/src/components/qonsoleSmartInput/QonsoleSmartInput.tsx +0 -105
  783. package/src/components/qonsoleSmartInput/index.ts +0 -16
  784. package/src/components/qonsoleSmartInput/qonsoleInserter.ts +0 -77
  785. package/src/components/qonsoleSmartInput/types.ts +0 -133
  786. package/src/components/qonsoleSmartInput/useQonsoleSession.ts +0 -124
  787. package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +0 -62
  788. package/src/components/searchFilterBar/SearchFilterBar.tsx +0 -144
  789. package/src/components/searchFilterBar/index.ts +0 -1
  790. package/src/components/smartEditor/MarkdownDoc.tsx +0 -190
  791. package/src/components/smartEditor/SmartEditor.stories.tsx +0 -475
  792. package/src/components/smartEditor/SmartEditor.tsx +0 -808
  793. package/src/components/smartEditor/__fixtures__/mockLspServer.ts +0 -205
  794. package/src/components/smartEditor/helpers.ts +0 -217
  795. package/src/components/smartEditor/index.ts +0 -35
  796. package/src/components/smartEditor/styling.ts +0 -45
  797. package/src/components/smartEditor/types.ts +0 -211
  798. package/src/components/smartEditor/useLspAutocomplete.ts +0 -758
  799. package/src/components/smartEditor/useLspDiagnosticDecorations.ts +0 -125
  800. package/src/components/smartEditor/useLspHover.ts +0 -230
  801. package/src/components/smartEditor/useLspSemanticTokens.ts +0 -298
  802. package/src/components/smartEditor/useLspSession.ts +0 -231
  803. package/src/components/smartEditor/useLspSignatureHelp.ts +0 -198
  804. package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -171
  805. package/src/components/supportTicket/AttachmentChips.tsx +0 -147
  806. package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -257
  807. package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -130
  808. package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -580
  809. package/src/components/supportTicket/ReferencePicker.tsx +0 -573
  810. package/src/components/supportTicket/TicketConversation.stories.tsx +0 -120
  811. package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
  812. package/src/components/supportTicket/TicketHeader.tsx +0 -248
  813. package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
  814. package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
  815. package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -357
  816. package/src/components/supportTicket/TicketReplyBox.tsx +0 -172
  817. package/src/components/supportTicket/__fixtures__/kindMarks.ts +0 -28
  818. package/src/components/supportTicket/attachmentAccess.ts +0 -97
  819. package/src/components/supportTicket/fileToAttachment.ts +0 -24
  820. package/src/components/supportTicket/index.ts +0 -10
  821. package/src/components/supportTicket/meta.ts +0 -206
  822. package/src/components/supportTicket/ticketModel.ts +0 -131
  823. package/src/components/supportTicket/useLoadedImages.ts +0 -93
  824. package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -341
  825. package/src/components/ticketReferences/TicketReferences.tsx +0 -914
  826. package/src/components/ticketReferences/index.ts +0 -2
  827. package/src/components/ticketThread/TicketThread.stories.tsx +0 -898
  828. package/src/components/ticketThread/TicketThread.tsx +0 -706
  829. package/src/components/ticketThread/index.ts +0 -6
  830. package/src/contexts/FetchContext.tsx +0 -25
  831. package/src/contexts/ReqraftContext.tsx +0 -9
  832. package/src/contexts/StorageContext.tsx +0 -33
  833. package/src/global.d.ts +0 -4
  834. package/src/helpers/allowedValues.ts +0 -268
  835. package/src/helpers/choiceChip.ts +0 -227
  836. package/src/helpers/common.ts +0 -326
  837. package/src/helpers/dpqlDetection.ts +0 -209
  838. package/src/helpers/expressions.ts +0 -140
  839. package/src/helpers/fieldDescription.ts +0 -39
  840. package/src/helpers/optionUiTypes.ts +0 -199
  841. package/src/helpers/options.ts +0 -150
  842. package/src/helpers/providerValue.ts +0 -125
  843. package/src/helpers/scrollbar.ts +0 -32
  844. package/src/helpers/singleLineString.ts +0 -62
  845. package/src/helpers/templateItems.ts +0 -81
  846. package/src/helpers/templateText.ts +0 -350
  847. package/src/helpers/templates.ts +0 -602
  848. package/src/helpers/validations.ts +0 -2085
  849. package/src/hooks/useArgSchema.ts +0 -37
  850. package/src/hooks/useCoarsePointer.ts +0 -30
  851. package/src/hooks/useFetch/useFetch.stories.tsx +0 -379
  852. package/src/hooks/useFetch/useFetch.tsx +0 -154
  853. package/src/hooks/usePhoneViewport.ts +0 -34
  854. package/src/hooks/useQorusTypes.ts +0 -233
  855. package/src/hooks/useReqraftProperty.ts +0 -16
  856. package/src/hooks/useStorage/useStorage.stories.tsx +0 -168
  857. package/src/hooks/useStorage/useStorage.ts +0 -35
  858. package/src/hooks/useTemplates.ts +0 -123
  859. package/src/hooks/useValidation.ts +0 -9
  860. package/src/hooks/useWebSocket/useWebSocket.ts +0 -224
  861. package/src/hooks/useWebSocket/useWebsocket.stories.tsx +0 -640
  862. package/src/hooks/useWhyDidYouUpdate.ts +0 -38
  863. package/src/index.tsx +0 -86
  864. package/src/providers/FetchProvider.tsx +0 -40
  865. package/src/providers/ReqraftProvider.tsx +0 -52
  866. package/src/providers/StorageProvider.tsx +0 -131
  867. package/src/stores/currentUser/currentUser.stories.tsx +0 -100
  868. package/src/stores/currentUser/currentUser.tsx +0 -94
  869. package/src/stories/Data/fileFieldArgSchema.json +0 -86
  870. package/src/stories/Tests/utils.ts +0 -320
  871. package/src/stories/storyNetwork.ts +0 -92
  872. package/src/stories/tracking.tsx +0 -206
  873. package/src/tracking/browser/attach.ts +0 -186
  874. package/src/tracking/browser/env.ts +0 -78
  875. package/src/tracking/core/consent.ts +0 -37
  876. package/src/tracking/core/engagement.ts +0 -47
  877. package/src/tracking/core/experiments.ts +0 -258
  878. package/src/tracking/core/hash.ts +0 -26
  879. package/src/tracking/core/ids.ts +0 -25
  880. package/src/tracking/core/observable.ts +0 -23
  881. package/src/tracking/core/queue.ts +0 -131
  882. package/src/tracking/core/sections.ts +0 -166
  883. package/src/tracking/core/storage.ts +0 -69
  884. package/src/tracking/core/tracker.ts +0 -417
  885. package/src/tracking/core/types.ts +0 -162
  886. package/src/tracking/core/utm.ts +0 -23
  887. package/src/tracking/index.ts +0 -72
  888. package/src/tracking/markup.ts +0 -17
  889. package/src/tracking/react/Experiment.tsx +0 -44
  890. package/src/tracking/react/TrackingProvider.tsx +0 -56
  891. package/src/tracking/react/hooks.ts +0 -106
  892. package/src/tracking/react/index.ts +0 -13
  893. package/src/tracking/testing.ts +0 -108
  894. package/src/tracking/ui/ExperimentCard.stories.tsx +0 -296
  895. package/src/tracking/ui/ExperimentCard.tsx +0 -667
  896. package/src/tracking/ui/ExperimentsOverlay.stories.tsx +0 -155
  897. package/src/tracking/ui/ExperimentsOverlay.tsx +0 -437
  898. package/src/tracking/ui/anchor.ts +0 -180
  899. package/src/tracking/ui/card.ts +0 -464
  900. package/src/tracking/ui/client.ts +0 -117
  901. package/src/tracking/ui/index.ts +0 -77
  902. package/src/tracking/ui/types.ts +0 -110
  903. package/src/tracking/ui/useExperimentsAdmin.ts +0 -103
  904. package/src/types/Form.ts +0 -29
  905. package/src/types.ts +0 -14
  906. package/src/utils/datetime.ts +0 -10
  907. package/src/utils/fetch.ts +0 -457
  908. package/src/utils/lspClient.ts +0 -711
  909. package/src/utils/lspClient.types.ts +0 -211
  910. package/src/utils/queryUnlessCancelled.ts +0 -28
  911. package/src/utils/websocket.ts +0 -293
  912. package/vite.config.ts +0 -58
  913. package/vitest.config.ts +0 -69
@@ -1,1090 +0,0 @@
1
- import {
2
- IQorusFormField,
3
- IQorusFormSchema,
4
- TQorusFormFieldSchema,
5
- TQorusType,
6
- } from '@qoretechnologies/ts-toolkit';
7
- import { isRendererOnlyUiType } from './rendererTypes';
8
- import { isEmptyUiEnvelope, isUiEncodedValue } from './_structuredData/structuredData';
9
- import { renderExpressionToText } from '../expressions/renderExpressionToText';
10
- import { IExpressionValue } from '../expressions/types';
11
- import yaml from 'js-yaml';
12
- import { formatTimeoutValue, richtextToString } from '../../../helpers/common';
13
- import { firstDeclaredType } from '../../../helpers/optionUiTypes';
14
- import { findAllowedValueOption } from '../../../helpers/allowedValues';
15
-
16
- /** "N noun" with naive pluralisation ("1 item", "2 items"). */
17
- const pluralize = (count: number, noun: string): string =>
18
- `${count} ${noun}${count === 1 ? '' : 's'}`;
19
-
20
- // The server's typed-value serialization wraps each value in an envelope —
21
- // `{ type, value }` plus optional descriptive keys. Only this exact shape is
22
- // unwrapped; any foreign key means it's a real user hash, not an envelope.
23
- // One envelope definition for the whole engine: the structured tree and the
24
- // hash summaries must agree on what unwraps (`isUiEncodedValue` carries the
25
- // full server allow-list, incl. keys like `sensitive`/`required`).
26
- const isTypedEnvelope = (raw: unknown): raw is IQorusFormField => isUiEncodedValue(raw);
27
-
28
- /** Reduce ONE list item to a short, human label — never an object. Unwraps a
29
- * typed `{type, value}` envelope, prefers a `name`/`display_name`, and returns
30
- * undefined for a bare object (no name) so the caller falls back to a count
31
- * instead of printing "[object Object]". */
32
- const summarizeListItem = (item: unknown): string | number | undefined => {
33
- if (item === null || item === undefined) return undefined;
34
- if (typeof item !== 'object') return item as string | number;
35
- const obj = item as Record<string, unknown>;
36
- // A named object (or allowed-value) → its label.
37
- if (typeof obj.name === 'string' || typeof obj.name === 'number') return obj.name;
38
- if (typeof obj.display_name === 'string') return obj.display_name;
39
- // A typed envelope ({type, value}) or a {value} wrapper → look inside once.
40
- if ('value' in obj) {
41
- const inner = obj.value;
42
- if (inner === null || inner === undefined) return undefined;
43
- if (typeof inner !== 'object') return inner as string | number;
44
- const innerName = (inner as Record<string, unknown>).name;
45
- return typeof innerName === 'string' || typeof innerName === 'number' ? innerName : undefined;
46
- }
47
- return undefined;
48
- };
49
-
50
- /**
51
- * Label ONE list item from the sub-schema that describes it.
52
- *
53
- * `summarizeListItem` can only read an item that names ITSELF — one carrying a
54
- * `name` or `display_name` key. A hash whose fields are all domain fields names
55
- * itself nowhere: an auth profile's scheme has `type`, `cookie_name`,
56
- * `redirect_url`, and the row fell back to "2 items" — true, and silent about
57
- * which two.
58
- *
59
- * The `arg_schema` is the same description the sub-form was built from, so the
60
- * row can read an item the way the form asked for it: the FIRST declared field
61
- * the item actually has, resolved through that field's allowed values. The
62
- * scheme list then reads "Default RBAC, Cookie" — the words the author picked —
63
- * instead of a count.
64
- *
65
- * Schema order, not value order: the first declared field is the one the form
66
- * puts at the top of the item, which is the one that identifies it to its author.
67
- * Value order is insertion order and would vary between two equal items.
68
- */
69
- const summarizeHashItemFromSchema = (
70
- item: unknown,
71
- argSchema: Record<string, TQorusFormFieldSchema> | undefined
72
- ): string | number | undefined => {
73
- if (!argSchema) {
74
- return undefined;
75
- }
76
- const record = isTypedEnvelope(item) ? item.value : item;
77
- if (!record || typeof record !== 'object' || Array.isArray(record)) {
78
- return undefined;
79
- }
80
- const fields = record as Record<string, unknown>;
81
- const key = Object.keys(argSchema).find((name) => {
82
- const raw = fields[name];
83
- const value = isTypedEnvelope(raw) ? raw.value : raw;
84
- return value !== undefined && value !== null && value !== '';
85
- });
86
- if (!key) {
87
- return undefined;
88
- }
89
- const raw = fields[key];
90
- const value = isTypedEnvelope(raw) ? raw.value : raw;
91
- const label = getAllowedValueLabel(value, argSchema[key]);
92
- if (label) {
93
- return label;
94
- }
95
- // No allowed values (a free-text field): the stored value IS what was typed,
96
- // so it reads correctly as-is. An object at this position has no short form,
97
- // and a count beats printing its shape.
98
- return typeof value === 'string' || typeof value === 'number' ? value : undefined;
99
- };
100
-
101
- /** Summarise a list value: join item labels, or fall back to an "N items" count
102
- * (e.g. a list of anonymous hashes). Never prints raw objects. */
103
- /**
104
- * Join a list into one line, labelling each item from the field's allowed values
105
- * where it has them.
106
- *
107
- * A multi-select stores what the server stores -- a parse option is
108
- * `PO_REQUIRE_TYPES`, a permission is a code -- and the picker is what turns
109
- * that into something readable. The row has the same allowed values the picker
110
- * does, so it can read the same way instead of printing the wire form back.
111
- */
112
- const formatList = (items: unknown[], schema?: TQorusFormFieldSchema): string => {
113
- const argSchema = (schema as { arg_schema?: Record<string, TQorusFormFieldSchema> } | undefined)
114
- ?.arg_schema;
115
- const parts = items
116
- .map(
117
- (item) =>
118
- getAllowedValueLabel(item, schema) ??
119
- summarizeListItem(item) ??
120
- summarizeHashItemFromSchema(item, argSchema)
121
- )
122
- .filter((part) => part !== '' && part !== undefined && part !== null);
123
-
124
- return parts.length ? parts.join(', ') : pluralize(items.length, 'item');
125
- };
126
-
127
- /** "datasource · omquser · /bb_local": the provider's kind, its name and its
128
- * path, as the picker shows them. A read row must say WHICH provider a value
129
- * is, and "11 fields" said only how many keys describe it. Undefined when the
130
- * value is not shaped like a provider, so the caller falls through. */
131
- export const formatDataProviderValue = (value: unknown): string | undefined => {
132
- if (!value || typeof value !== 'object' || Array.isArray(value)) {
133
- return undefined;
134
- }
135
- const { type, name, path } = value as { type?: unknown; name?: unknown; path?: unknown };
136
- const parts = [type, name, path].filter(
137
- (part): part is string => typeof part === 'string' && part.trim() !== ''
138
- );
139
- return parts.length ? parts.join(' · ') : undefined;
140
- };
141
-
142
- /** Summarise a hash/object by its field count ("2 fields"), or "Set" when empty. */
143
- const fieldCountLabel = (obj: object): string => {
144
- const keys = Object.keys(obj);
145
- return keys.length ? pluralize(keys.length, 'field') : 'Set';
146
- };
147
-
148
- /** The object/list editor stores complex values as a serialized YAML string
149
- * (`%YAML 1.2 --- […]`) — parse it back for the summary; undefined when the
150
- * string isn't a serialized structure. */
151
- const parseSerialized = (value: string, type?: string): unknown => {
152
- const looksLikeYamlDoc = /^\s*(%YAML|---)\s/.test(value);
153
- if (type !== 'list' && type !== 'hash' && !looksLikeYamlDoc) {
154
- return undefined;
155
- }
156
- try {
157
- return yaml.load(value);
158
- } catch {
159
- return undefined;
160
- }
161
- };
162
-
163
- /**
164
- * Pure helpers for FormEngine compact (read-first) mode: format an option's
165
- * stored value into a short summary and resolve its group. Unit-testable.
166
- */
167
-
168
- /** A value is "empty" (nothing set) when it is nullish, an empty string, or an empty array. */
169
- export const isOptionValueEmpty = (value: unknown): boolean =>
170
- value === undefined ||
171
- value === null ||
172
- value === '' ||
173
- (Array.isArray(value) && value.length === 0);
174
-
175
- /**
176
- * A schema-declared hash whose every entry is a materialised-but-unset field.
177
- *
178
- * `preselected` on a sub-field means "show this in the form so the author sees
179
- * it exists" — a FORM instruction. Opening the sub-form materialises each one,
180
- * `fixOptions` writes `{type: 'int'}` with no value, and the draft autosaves
181
- * that, so the stored hash permanently carries keys that stand for nothing.
182
- *
183
- * The row then read those keys as content: `Runtime Defaults` listed three
184
- * sub-fields with no values, counted toward "7/12 set", and showed a green
185
- * set-dot — while the sub-form it summarises correctly said 0/3 set. Nothing
186
- * was ever entered.
187
- *
188
- * Requires the sub-schema, and requires each key to be declared by it: without
189
- * that, `{type: 'x'}` could be somebody's data rather than an empty envelope.
190
- */
191
- export const isUnsetSchemaHash = (value: unknown, schema?: TQorusFormFieldSchema): boolean => {
192
- const argSchema = (schema as { arg_schema?: Record<string, unknown> } | undefined)?.arg_schema;
193
- if (!argSchema || typeof argSchema !== 'object') {
194
- return false;
195
- }
196
- const inner =
197
- value && typeof value === 'object' && !Array.isArray(value) && 'value' in (value as object) ?
198
- (value as { value: unknown }).value
199
- : value;
200
- if (!inner || typeof inner !== 'object' || Array.isArray(inner)) {
201
- return false;
202
- }
203
- const keys = Object.keys(inner as object);
204
- return (
205
- keys.length > 0 &&
206
- keys.every(
207
- (key) =>
208
- !!(argSchema as Record<string, unknown>)[key] &&
209
- isEmptyUiEnvelope((inner as Record<string, unknown>)[key])
210
- )
211
- );
212
- };
213
-
214
- export const isFixedCompactAllowedValueOption = (
215
- schema: TQorusFormFieldSchema | undefined
216
- ): boolean => {
217
- if (!schema) {
218
- return false;
219
- }
220
-
221
- const selectableSchema = schema as TQorusFormFieldSchema & { items?: unknown[] };
222
- const options =
223
- selectableSchema.allowed_values?.length ?
224
- selectableSchema.allowed_values
225
- : selectableSchema.items;
226
-
227
- return !!(
228
- options?.length &&
229
- !schema.allowed_values_creatable &&
230
- !schema.multiselect &&
231
- !schema.arg_schema
232
- );
233
- };
234
-
235
- export const shouldAutoCollapseCompactAllowedValueOption = (
236
- schema: TQorusFormFieldSchema | undefined,
237
- value: unknown
238
- ): boolean => !isOptionValueEmpty(value) && isFixedCompactAllowedValueOption(schema);
239
-
240
- /** Boolean fields have three meaningful states: unset, Yes, and No. Once the
241
- * user chooses either boolean value in compact mode, the choice is complete
242
- * and the inline editor can close without a separate confirmation. */
243
- export const isCompactBooleanOption = (schema: TQorusFormFieldSchema | undefined): boolean => {
244
- const type = firstDeclaredType(schema?.ui_type || schema?.type)?.toLowerCase();
245
- return type === 'bool' || type === 'boolean';
246
- };
247
-
248
- /**
249
- * Whether a change completes a compact row, so its editor can close.
250
- *
251
- * Only a VALUE does: Yes or No, or one of a fixed list. An expression is
252
- * built one step at a time - an operation, then each of its arguments - and
253
- * every step is a change; closing the editor on the first one left a bool
254
- * field's condition at `null > null`, with no way to fill in its arguments
255
- * short of opening the row again for each of them.
256
- *
257
- * @param isExpression the row now holds an expression (`is_expression`)
258
- */
259
- export const shouldAutoCollapseCompactOption = (
260
- schema: TQorusFormFieldSchema | undefined,
261
- value: unknown,
262
- isExpression?: boolean
263
- ): boolean =>
264
- !isExpression &&
265
- !isOptionValueEmpty(value) &&
266
- (isCompactBooleanOption(schema) || isFixedCompactAllowedValueOption(schema));
267
-
268
- /**
269
- * Prefer the matching allowed_values entry's display_name (fallback `name`)
270
- * over the raw stored value. The predicate lives in `helpers/allowedValues`,
271
- * where the validator uses it too, so a value the row can name is exactly a
272
- * value the form accepts.
273
- */
274
- export { findAllowedValueOption };
275
-
276
- const getAllowedValueLabel = (
277
- value: unknown,
278
- schema?: TQorusFormFieldSchema
279
- ): string | undefined => {
280
- const match = findAllowedOption(value, schema);
281
- return match ? match.display_name || match.title || match.name || undefined : undefined;
282
- };
283
-
284
- /** Local alias for the module's own callers. */
285
- const findAllowedOption = findAllowedValueOption;
286
-
287
- /** True when the field's selectable options carry images (logos). Such a choice
288
- * renders too tall/rich for an inline row, so compact opens it in the card. */
289
- export const optionHasImages = (schema?: TQorusFormFieldSchema): boolean => {
290
- const s = schema as { allowed_values?: any[]; items?: any[] } | undefined;
291
- const options = s?.allowed_values?.length ? s.allowed_values : s?.items;
292
- return !!options?.some((option) => !!option?.image);
293
- };
294
-
295
- /** The selected option's image (logo), when it carries one — for the value cell. */
296
- export const getAllowedValueImage = (
297
- value: unknown,
298
- schema?: TQorusFormFieldSchema
299
- ): string | undefined => {
300
- const match = findAllowedOption(value, schema);
301
- return (match?.image as string) || undefined;
302
- };
303
-
304
- /**
305
- * The selected option's ICON, when it carries one and no logo — for the value
306
- * cell.
307
- *
308
- * The same idea as {@link getAllowedValueImage} and read for the same reason:
309
- * an option's mark belongs beside the value it names. Only images were rendered,
310
- * so a picker whose entries are distinguished by ICON — an interface-kind list
311
- * where every entry is a bare word, `Service`, `Job`, `Qog` — showed each mark
312
- * while choosing and then dropped it the moment the row went read-only, which is
313
- * the surface a reader spends the most time on.
314
- *
315
- * The image wins where an option has both: a logo is the more specific mark, and
316
- * an icon standing behind it is a fallback rather than a second thing to draw.
317
- */
318
- export const getAllowedValueIcon = (
319
- value: unknown,
320
- schema?: TQorusFormFieldSchema
321
- ): string | undefined => {
322
- const match = findAllowedOption(value, schema);
323
- if (!match || match.image) {
324
- return undefined;
325
- }
326
- return (match.icon as string) || undefined;
327
- };
328
-
329
- /** Clamp an RGB channel to a 0–255 integer. */
330
- const clampChannel = (n: number): number => Math.max(0, Math.min(255, Math.round(n)));
331
- const toHexPart = (n: number): string => clampChannel(n).toString(16).padStart(2, '0');
332
-
333
- /** The shape the rgbcolor field stores (react-color's RGBA result). */
334
- type TColorValue = { r?: number; g?: number; b?: number; a?: number; hex?: string };
335
-
336
- /** Normalised colour parts parsed from any shape the rgbcolor field can store. */
337
- interface IParsedColor {
338
- hex?: string;
339
- r?: number;
340
- g?: number;
341
- b?: number;
342
- a: number;
343
- }
344
-
345
- /** Whether parsed colour parts carry usable RGB channels. */
346
- const hasRgb = (c: IParsedColor): c is IParsedColor & { r: number; g: number; b: number } =>
347
- c.r !== undefined && c.g !== undefined && c.b !== undefined;
348
-
349
- /** Parse an `rgbcolor` into normalised parts: accepts `{ r, g, b, a }` (may
350
- * carry `hex`), `{ hex }`, or a raw hex string; undefined when unrecognisable. */
351
- const parseColor = (value: unknown): IParsedColor | undefined => {
352
- if (typeof value === 'string') {
353
- const trimmed = value.trim();
354
- return trimmed.startsWith('#') ? { hex: trimmed, a: 1 } : undefined;
355
- }
356
- if (value && typeof value === 'object') {
357
- const c = value as TColorValue;
358
- const a = typeof c.a === 'number' ? c.a : 1;
359
- const hex = typeof c.hex === 'string' && c.hex.trim() ? c.hex.trim() : undefined;
360
- if (typeof c.r === 'number' && typeof c.g === 'number' && typeof c.b === 'number') {
361
- return { r: c.r, g: c.g, b: c.b, a, hex };
362
- }
363
- if (hex) {
364
- return { hex, a };
365
- }
366
- }
367
- return undefined;
368
- };
369
-
370
- /** Uppercase hex (`#0000FF`), or `rgba(…)` when non-opaque; undefined when
371
- * unrecognisable (the caller falls back to the generic marker). */
372
- export const formatColorValue = (value: unknown): string | undefined => {
373
- const c = parseColor(value);
374
- if (!c) {
375
- return undefined;
376
- }
377
- // Prefer rgba(…) for non-opaque colours; the hex shortcut would drop alpha.
378
- if (c.a < 1 && hasRgb(c)) {
379
- const alpha = Math.round(c.a * 100) / 100;
380
- return `rgba(${clampChannel(c.r)}, ${clampChannel(c.g)}, ${clampChannel(c.b)}, ${alpha})`;
381
- }
382
- if (c.hex) {
383
- return c.hex.toUpperCase();
384
- }
385
- return hasRgb(c) ?
386
- `#${toHexPart(c.r)}${toHexPart(c.g)}${toHexPart(c.b)}`.toUpperCase()
387
- : undefined;
388
- };
389
-
390
- /** CSS colour for the swatch preview (keeps alpha); undefined when
391
- * unrecognisable. */
392
- export const colorToCss = (value: unknown): string | undefined => {
393
- const c = parseColor(value);
394
- if (!c) {
395
- return undefined;
396
- }
397
- return hasRgb(c) ?
398
- `rgba(${clampChannel(c.r)}, ${clampChannel(c.g)}, ${clampChannel(c.b)}, ${c.a})`
399
- : c.hex;
400
- };
401
-
402
- /** Filename for a `file` value: accepts `{ name, content, size }`, the
403
- * build-tab `{ name: { value } }` shape, or a raw path; undefined when no
404
- * filename resolves. */
405
- export const formatFileValue = (value: unknown): string | undefined => {
406
- if (typeof value === 'string') {
407
- const name = value.trim().split(/[\\/]/).pop();
408
- return name || undefined;
409
- }
410
- if (value && typeof value === 'object') {
411
- const name = (value as { name?: unknown }).name;
412
- if (typeof name === 'string' && name.trim()) {
413
- return name.trim();
414
- }
415
- const nested = (name as { value?: unknown } | undefined)?.value;
416
- if (typeof nested === 'string' && nested.trim()) {
417
- return nested.trim();
418
- }
419
- }
420
- return undefined;
421
- };
422
-
423
- /** The byte size of a `file` value, when present (for the muted size suffix). */
424
- export const getFileSize = (value: unknown): number | undefined => {
425
- const size = (value as { size?: unknown } | undefined)?.size;
426
- return typeof size === 'number' && Number.isFinite(size) && size >= 0 ? size : undefined;
427
- };
428
-
429
- /**
430
- * Effective UI type for DISPLAY — which preview/summary a value renders as.
431
- *
432
- * A renderer-only `ui_type` wins outright: the field's stored `type` holds the
433
- * STORAGE type for those (a `code-editor` stores a string), so consulting the
434
- * stored type here would render the bespoke editor's value as a plain string and
435
- * silently drop its preview. Every other case keeps the stored type first, so an
436
- * `any`/`auto` field still displays as whatever concrete type the user picked.
437
- */
438
- export const getValueType = (
439
- option?: IQorusFormField,
440
- schema?: TQorusFormFieldSchema
441
- ): string | undefined => {
442
- const uiType = (schema as { ui_type?: string } | undefined)?.ui_type;
443
-
444
- if (isRendererOnlyUiType(uiType as TQorusType)) {
445
- return uiType;
446
- }
447
-
448
- return (option?.type || uiType || (schema as { type?: string } | undefined)?.type) as
449
- string | undefined;
450
- };
451
-
452
- /** Human-readable byte count (e.g. `1.2 KB`). */
453
- export const formatBytes = (bytes: number): string => {
454
- if (bytes < 1024) {
455
- return `${bytes} B`;
456
- }
457
- const units = ['KB', 'MB', 'GB', 'TB'];
458
- let size = bytes / 1024;
459
- let unit = 0;
460
- while (size >= 1024 && unit < units.length - 1) {
461
- size /= 1024;
462
- unit += 1;
463
- }
464
- return `${size >= 10 || Number.isInteger(size) ? Math.round(size) : size.toFixed(1)} ${units[unit]}`;
465
- };
466
-
467
- /**
468
- * Short read-first summary of a value; '' when unset (the caller renders the
469
- * placeholder). Bools → Yes/No, allowed_values → display label, colour →
470
- * hex/rgba, file → filename, richtext → plain text, timeout → scaled duration
471
- * ("45 seconds"), list → joined names, hash → "N fields" (generic "Set"
472
- * fallback).
473
- */
474
- /** Read-first summary of a `schema-definition` value: the schema name plus a
475
- * table count (e.g. `orders · 2 tables`). */
476
- const formatSchemaDefinition = (value: unknown): string => {
477
- if (!value || typeof value !== 'object') return 'Schema';
478
- const def = value as { schema?: { name?: string }; tables?: object };
479
- const name = def.schema?.name;
480
- const count = def.tables ? Object.keys(def.tables).length : 0;
481
- const tables = count ? ` · ${count} table${count === 1 ? '' : 's'}` : '';
482
- return name ? `${name}${tables}` : 'Schema';
483
- };
484
-
485
- /**
486
- /**
487
- * How much prose a one-line summary may carry.
488
- *
489
- * The row's value cell is a single CSS-clipped line (`text-overflow: ellipsis`),
490
- * so the CELL needs no cap — the browser does that. The `title` hover does: it
491
- * is handed this same string whole, and a description is a document. Without a
492
- * bound, hovering a 4,000-word description produces a 4,000-word native
493
- * tooltip, which no browser renders usefully and no reader can scroll.
494
- *
495
- * 240 comfortably overfills the widest realistic cell (~80-120 characters), so
496
- * nothing visible is lost, and leaves the hover as what it is useful as — the
497
- * next sentence or two. The whole document is never far away: it renders in the
498
- * row's inset below.
499
- */
500
- export const SUMMARY_MAX_LENGTH = 240;
501
-
502
- /** Clip to {@link SUMMARY_MAX_LENGTH}, on a word boundary where there is one
503
- * close enough to the end, so a hover never stops mid-identifier. */
504
- const capSummary = (text: string): string => {
505
- if (text.length <= SUMMARY_MAX_LENGTH) {
506
- return text;
507
- }
508
-
509
- const cut = text.slice(0, SUMMARY_MAX_LENGTH);
510
- const lastSpace = cut.lastIndexOf(' ');
511
- const body = lastSpace > SUMMARY_MAX_LENGTH * 0.6 ? cut.slice(0, lastSpace) : cut;
512
-
513
- return `${body.trimEnd()}…`;
514
- };
515
-
516
- /**
517
- * Summarise a markdown value as the prose it renders to.
518
- *
519
- * A read-first row has one line to work with, and for markdown that line was
520
- * the SOURCE: a description opening with a heading read as `## Partner portal`,
521
- * which is punctuation where the reader wanted the sentence. The markers are
522
- * stripped rather than the value truncated, because what the row is standing in
523
- * for is the rendered document, not the file behind it.
524
- *
525
- * Deliberately not a markdown parser: this feeds a one-line summary and the
526
- * row's hover title, and the real document renders in the inset below the row.
527
- *
528
- * The inline rules below are CommonMark-shaped on purpose, because the naive
529
- * versions corrupt exactly the text these descriptions are full of. `(\*|_)(.*?)\1`
530
- * turns "2 * 3 * 4 items" into "2 3 4 items" and `retry_count_max` into
531
- * `retrycountmax`: emphasis delimiters have to hug the text they wrap, and an
532
- * underscore must not be intraword, or an option key loses its underscores.
533
- */
534
- export const summariseMarkdown = (value: unknown): string => {
535
- if (typeof value !== 'string') {
536
- return '';
537
- }
538
-
539
- const prose = value
540
- // a fenced block is never the summary of the thing it sits in
541
- .replace(/```[\s\S]*?```/g, ' ')
542
- // images before links — an image's `!` prefix would otherwise survive
543
- .replace(/!\[([^\]]*)\]\([^)]*\)/g, '$1')
544
- .replace(/\[([^\]]*)\]\([^)]*\)/g, '$1')
545
- // autolinks: <https://example.com> → https://example.com
546
- .replace(/<((?:https?|mailto):[^>\s]+)>/g, '$1')
547
- // leading block markers: heading hashes, blockquote carets, list bullets
548
- .replace(/^\s{0,3}(?:#{1,6}\s+|>\s?|[-*+]\s+|\d+[.)]\s+)/gm, '')
549
- // setext underlines and thematic breaks carry no prose
550
- .replace(/^\s{0,3}(?:={2,}|-{2,}|\*{3,}|_{3,})\s*$/gm, '')
551
- // Emphasis / strong / strikethrough markers around their own text. The
552
- // delimiters must hug the text they wrap, as CommonMark requires, and
553
- // underscores additionally must not be intraword.
554
- .replace(/(\*\*\*)(?=\S)([\s\S]+?)(?<=\S)\1/g, '$2')
555
- .replace(/(?<![A-Za-z0-9])(___)(?=\S)([\s\S]+?)(?<=\S)\1(?![A-Za-z0-9])/g, '$2')
556
- .replace(/(\*\*)(?=\S)([\s\S]+?)(?<=\S)\1/g, '$2')
557
- .replace(/(?<![A-Za-z0-9])(__)(?=\S)([\s\S]+?)(?<=\S)\1(?![A-Za-z0-9])/g, '$2')
558
- .replace(/(\*)(?=\S)([\s\S]+?)(?<=\S)\1/g, '$2')
559
- .replace(/(?<![A-Za-z0-9])(_)(?=\S)([\s\S]+?)(?<=\S)\1(?![A-Za-z0-9])/g, '$2')
560
- .replace(/~~(?=\S)([\s\S]+?)(?<=\S)~~/g, '$1')
561
- // inline code spans
562
- .replace(/`+([^`]+)`+/g, '$1')
563
- .replace(/\s+/g, ' ')
564
- .trim();
565
-
566
- return capSummary(prose);
567
- };
568
-
569
- /**
570
- * The expression AST a field holds, whichever shape it arrived in.
571
- *
572
- * An expression arrives in TWO shapes, and only the flat one used to be
573
- * checked. At runtime the editor writes the flag onto the option
574
- * (`{ is_expression: true, value: ast }`); a value read back from a saved draft
575
- * carries the envelope NESTED (`{ value: { is_expression: true, value: ast } }`)
576
- * with no flag on the option at all. Missing the nested shape sent a reloaded
577
- * expression to the generic formatter, which printed the AST — the row showed
578
- * `is_expression true / value / exp + / args 1 2` where the expression should
579
- * be.
580
- *
581
- * Exported because the SUMMARY is not the only place that has to know. The AST
582
- * is how an expression is stored, not what it is, so nothing may draw it as
583
- * data: `CompactRow` asks this before deciding a hash-shaped value has earned a
584
- * structured inset. Answering it in one place is what keeps the row's two
585
- * halves — the line and the inset under it — talking about the same value.
586
- */
587
- export const getExpressionAst = (option?: {
588
- is_expression?: boolean;
589
- value?: unknown;
590
- }): IExpressionValue | undefined =>
591
- option?.is_expression ? (option?.value as IExpressionValue | undefined)
592
- : (
593
- (option?.value as { is_expression?: boolean; value?: IExpressionValue } | undefined)
594
- ?.is_expression
595
- ) ?
596
- (option?.value as { value?: IExpressionValue }).value
597
- : undefined;
598
-
599
- export const formatOptionValue = (
600
- option?: IQorusFormField,
601
- schema?: TQorusFormFieldSchema
602
- ): string => {
603
- const value = option?.value;
604
-
605
- if (isOptionValueEmpty(value) || isUnsetSchemaHash(value, schema)) {
606
- return '';
607
- }
608
-
609
- // A sensitive option (passwords, tokens) must never print its value in the
610
- // read-first row — the formatted string also feeds the row's hover title.
611
- if ((schema as { sensitive?: boolean } | undefined)?.sensitive) {
612
- return '••••••';
613
- }
614
-
615
- const expressionAst = getExpressionAst(option);
616
-
617
- if (expressionAst !== undefined) {
618
- // Offline summary of the {exp,args} AST already in the form value — the
619
- // same client-side renderer the editor's "Explain" seam falls back to when
620
- // the LSP is unreachable. The drill-in editor shows the canonical DPQL.
621
- return renderExpressionToText(expressionAst) || 'Expression';
622
- }
623
-
624
- // schema-definition is stored as a hash envelope; summarise it as the schema
625
- // name + table count rather than a meaningless top-level key count.
626
- if ((schema as { ui_type?: string } | undefined)?.ui_type === 'schema-definition') {
627
- return formatSchemaDefinition(value);
628
- }
629
-
630
- // Same reasoning, different notation: show what the markdown says, not how it
631
- // is written.
632
- if ((schema as { ui_type?: string } | undefined)?.ui_type === 'markdown') {
633
- // `|| 'Set'` is not defensive padding. A description that is ONLY a fenced
634
- // code block summarises to the empty string — the block is dropped, and
635
- // there is no prose behind it — and CompactRow reads `formatted === ''` as
636
- // "no value" and renders a faint em-dash. A field holding a whole code
637
- // block would show as empty. `'Set'` is this file's established answer for
638
- // "there is a value here that does not reduce to a line" (colours, files,
639
- // richtext all use it), and the block itself still renders in the inset.
640
- return summariseMarkdown(value) || 'Set';
641
- }
642
-
643
- const type = getValueType(option, schema);
644
-
645
- if (type === 'bool' || type === 'boolean') {
646
- return value ? 'Yes' : 'No';
647
- }
648
-
649
- const allowedLabel = getAllowedValueLabel(value, schema);
650
- if (allowedLabel) {
651
- return allowedLabel;
652
- }
653
-
654
- if (type === 'rgbcolor') {
655
- return formatColorValue(value) ?? 'Set';
656
- }
657
-
658
- // Raw milliseconds read poorly at a glance — scale to the largest exact
659
- // unit, matching what the expanded TimeoutFormField shows.
660
- if (type === 'timeout' && typeof value === 'number') {
661
- return formatTimeoutValue(value);
662
- }
663
-
664
- if (type === 'file') {
665
- return formatFileValue(value) ?? 'Set';
666
- }
667
-
668
- if (type === 'richtext') {
669
- const text = richtextToString(value as any);
670
- return text && text.trim() ? text : 'Set';
671
- }
672
-
673
- // A markdown value reads as prose, not as source: the row's one line — and
674
- // the hover title built from it — would otherwise open with `# ` or spend its
675
- // width on `[label](https://…)`. The rendered document itself is drawn in the
676
- // row's inset below.
677
- if (type === 'markdown' && typeof value === 'string') {
678
- const text = summariseMarkdown(value);
679
- return text || 'Set';
680
- }
681
-
682
- if (Array.isArray(value)) {
683
- return formatList(value, schema);
684
- }
685
-
686
- // A serialized list/hash (the object editor stores them as a YAML string):
687
- // parse it back and summarise rather than showing the raw `%YAML 1.2 --- …`.
688
- if (typeof value === 'string') {
689
- const parsed = parseSerialized(value, type);
690
- if (Array.isArray(parsed)) {
691
- return formatList(parsed, schema);
692
- }
693
- if (parsed && typeof parsed === 'object') {
694
- return fieldCountLabel(parsed as object);
695
- }
696
- if (parsed !== undefined && parsed !== null && typeof parsed !== 'object') {
697
- return String(parsed);
698
- }
699
- }
700
-
701
- // A provider is an object, but the count of its keys is not what the reader
702
- // asked: name it. (The structured preview under the row shows the keys.)
703
- if (type === 'data-provider') {
704
- const provider = formatDataProviderValue(value);
705
- if (provider) {
706
- return provider;
707
- }
708
- }
709
-
710
- if (typeof value === 'object') {
711
- return fieldCountLabel(value as object);
712
- }
713
-
714
- return String(value);
715
- };
716
-
717
- /** One sub-field of a hash value, summarised for a read-first sub-row. */
718
- export interface IReadFirstHashEntry {
719
- /** The raw key in the hash. */
720
- name: string;
721
- /** Display label — the sub-field's `display_name` (from `arg_schema`) or the key. */
722
- label: string;
723
- /** The sub-field's value formatted via `formatOptionValue` ('' when unset). */
724
- value: string;
725
- }
726
-
727
- /**
728
- * Expand a hash into sub-fields for the "view more" sub-rows. Handles the three
729
- * hash shapes: arg_schema descriptors, serialized-YAML string, plain object.
730
- * [] when not expandable; entry values format via `formatOptionValue`.
731
- */
732
- export const getHashEntries = (
733
- option?: IQorusFormField,
734
- schema?: TQorusFormFieldSchema
735
- ): IReadFirstHashEntry[] => {
736
- const value = option?.value;
737
- if (isOptionValueEmpty(value)) {
738
- return [];
739
- }
740
-
741
- let hashObject: Record<string, unknown> | undefined;
742
- if (typeof value === 'string') {
743
- const parsed = parseSerialized(value, 'hash');
744
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
745
- hashObject = parsed as Record<string, unknown>;
746
- }
747
- } else if (value && typeof value === 'object' && !Array.isArray(value)) {
748
- hashObject = value as Record<string, unknown>;
749
- }
750
-
751
- if (!hashObject) {
752
- return [];
753
- }
754
-
755
- const argSchema = (schema as { arg_schema?: Record<string, TQorusFormFieldSchema> } | undefined)
756
- ?.arg_schema;
757
-
758
- return Object.keys(hashObject)
759
- .filter((key) => {
760
- // Only sub-fields with a value belong in a read view. `preselected`
761
- // materialises a field so the FORM shows it; that is not a statement
762
- // that the object has one, and listing it here says the opposite of
763
- // what the sub-form says.
764
- const subSchema = argSchema?.[key];
765
- return !(subSchema && isEmptyUiEnvelope(hashObject![key]));
766
- })
767
- .map((key) => {
768
- const raw = hashObject![key];
769
- const subSchema = argSchema?.[key];
770
- // A schema-declared (`arg_schema`) hash stores each entry as a
771
- // `{ type, value }` field descriptor — gate on the sub-schema's presence.
772
- // A schema-less hash *usually* stores raw values, but the server's typed
773
- // serialization can nest envelopes there too (e.g. a hash default_value
774
- // whose entries are `{ type: 'string', value: 'x' }`) — recognise those by
775
- // their strict shape (a string `type`, a `value`, and no foreign keys) so
776
- // the sub-row shows 'x' rather than counting the envelope's own keys.
777
- // `'value' in raw` is FALSE for a materialised-but-unset field: `fixOptions`
778
- // omits the key entirely when the value is undefined, leaving `{type: 'x'}`.
779
- // Requiring `value` therefore classed that envelope as a raw hash VALUE and
780
- // counted its own `type` key, so an untouched Runtime Defaults collapsed to
781
- // "Timeout (Seconds) 1 field" three times over while the sub-form correctly
782
- // said 0/3 set. With a sub-schema present, a `type`-only object is an empty
783
- // envelope, never content.
784
- // Shared with SchemaDataView, which previews this same value one level
785
- // down: two renderers disagreeing about what an unset field looks like is
786
- // how the row said "1 field" long after this one stopped.
787
- const isEmptyEnvelope = !!subSchema && isEmptyUiEnvelope(raw);
788
- const isFieldShape =
789
- (!!subSchema &&
790
- !!raw &&
791
- typeof raw === 'object' &&
792
- !Array.isArray(raw) &&
793
- 'value' in (raw as object)) ||
794
- isEmptyEnvelope ||
795
- isTypedEnvelope(raw);
796
- const subOption: IQorusFormField =
797
- isFieldShape ?
798
- (raw as IQorusFormField)
799
- : ({ type: subSchema?.type as IQorusFormField['type'], value: raw } as IQorusFormField);
800
-
801
- return {
802
- name: key,
803
- label: subSchema?.display_name || key,
804
- value: formatOptionValue(subOption, subSchema),
805
- };
806
- });
807
- };
808
-
809
- const titleCase = (value: string): string =>
810
- value
811
- .replace(/[_-]+/g, ' ')
812
- .trim()
813
- .replace(/\b\w/g, (char) => char.toUpperCase());
814
-
815
- /**
816
- * Raw group key for an option: the server's `group`, else "general" for
817
- * required/preselected (never buried — `group` is still rolling out
818
- * server-side, qorus #259) and "optional" for the rest.
819
- */
820
- export const getOptionGroup = (schema?: TQorusFormFieldSchema): string => {
821
- const group = (schema as { group?: string } | undefined)?.group;
822
-
823
- if (typeof group === 'string' && group.trim()) {
824
- return group.trim();
825
- }
826
-
827
- return (
828
- schema?.required ||
829
- (schema as { required_groups?: string[] } | undefined)?.required_groups ||
830
- (schema as { preselected?: boolean } | undefined)?.preselected
831
- ) ?
832
- 'general'
833
- : 'optional';
834
- };
835
-
836
- /** Display label for a group key: the consumer-supplied label (FormEngine
837
- * `groups` prop) or the title-cased key. */
838
- export const getOptionGroupLabel = (
839
- key: string,
840
- groups?: Record<string, { label?: string } | undefined>
841
- ): string => groups?.[key]?.label ?? titleCase(key);
842
-
843
- /** Completion summary for the read-first progress meter. */
844
- export interface IReadFirstCompletion {
845
- total: number;
846
- /** Fields holding a value, whether or not anything is wrong with it. */
847
- set: number;
848
- /** Fields holding a value that nothing is flagging — what the meter fills. */
849
- done: number;
850
- pct: number;
851
- }
852
-
853
- /** Read-first row status, shared by the status DOT (CompactRow) and the
854
- * status BOX bucketing (FormEngine) so the two can never disagree:
855
- * invalid — a value fails validation, or a danger message is present (red)
856
- * todo — empty & required (or has a warning message), needs a value (amber)
857
- * pending — empty & required, but the person has not been to it yet: still to
858
- * fill in, not yet a fault (neutral). A new form is not already wrong;
859
- * the field becomes `todo` once they open it and leave it empty, or the
860
- * host reports a submit attempt (`revealRequired`)
861
- * set — has a valid value (green)
862
- * optional — empty & not required, or covered by a one-of sibling (calm) */
863
- export type TReadFirstStatus = 'invalid' | 'todo' | 'pending' | 'set' | 'optional';
864
-
865
- export const getReadFirstStatus = (s: {
866
- empty: boolean;
867
- required: boolean;
868
- /** Empty member of a one-of required group already satisfied by a sibling. */
869
- covered: boolean;
870
- /** Non-empty value fails validation, or a danger message is attached. */
871
- invalid: boolean;
872
- /** A warning message is attached (surfaces an empty field for attention). */
873
- warned: boolean;
874
- /**
875
- * Whether the person has been to this field (opened it and left it), or the host
876
- * reported a submit attempt. Until then an empty required field is `pending`, not
877
- * `todo`. Unset means visited, the behaviour before this existed.
878
- */
879
- visited?: boolean;
880
- }): TReadFirstStatus => {
881
- if (s.invalid) return 'invalid';
882
- if (!s.empty) return 'set';
883
- // A one-of member covered by a satisfied sibling reads as "set" (green) — the
884
- // requirement is met; the row just shows a "Covered by …" note.
885
- if (s.covered) return 'set';
886
- if (s.warned) return 'todo';
887
- if (s.required) return s.visited === false ? 'pending' : 'todo';
888
- return 'optional';
889
- };
890
-
891
- /** Coarse bucket for the three status boxes (Needs attention / Set / Optional). A
892
- * `pending` field is in the first box too: it still has to be filled in. The box only
893
- * reads "To fill in" instead of "Needs attention" while nothing in it is a fault. */
894
- export const getReadFirstBucket = (status: TReadFirstStatus): 'attention' | 'set' | 'optional' =>
895
- status === 'set' ? 'set'
896
- : status === 'optional' ? 'optional'
897
- : 'attention';
898
-
899
- /** Count how many of the shown options have a value set, for the progress meter. */
900
- export const getReadFirstCompletion = (
901
- shownOptions: Record<string, IQorusFormField | undefined> = {},
902
- /**
903
- * Whether the form flags this field as needing attention. Optional: without
904
- * it the meter falls back to counting values alone, which is what a caller
905
- * with no bucketing of its own can honestly say.
906
- */
907
- needsAttention?: (name: string) => boolean
908
- ): IReadFirstCompletion => {
909
- const names = Object.keys(shownOptions);
910
- const total = names.length;
911
- const hasValue = (name: string) => !isOptionValueEmpty(shownOptions[name]?.value);
912
- const set = names.filter(hasValue).length;
913
- /* "Set" and "needs attention" are not opposites. A field can hold a value and
914
- still be wrong — one that fails validation, or one the host has flagged
915
- because something INSIDE it is unfinished — and counting those as progress
916
- is how a form comes to report 100% while the box beneath it says a field
917
- needs attention.
918
-
919
- It also cost the meter its amber run: the bar draws attention from `set%`
920
- onward, so a field counted in both pushed that run past the right edge,
921
- where `overflow: hidden` swallowed it. The one visual signal that something
922
- was outstanding was the one thing the double-count hid. */
923
- const done =
924
- needsAttention ? names.filter((name) => hasValue(name) && !needsAttention(name)).length : set;
925
- const pct = total ? Math.round((done / total) * 100) : 0;
926
-
927
- return { total, set, done, pct };
928
- };
929
-
930
- /** What the "first field to fix" selector needs to know about one field.
931
- * Kept deliberately minimal — both verdicts are supplied by the caller — so the
932
- * selector is decoupled from the engine's value/schema shapes and unit-testable
933
- * in isolation. */
934
- export interface IFirstAttentionFieldMeta {
935
- /** Whether the field can actually receive focus — the caller folds in
936
- * disabled / readonly / read-only-form / unmet-dependency gating here. */
937
- focusable: boolean;
938
- /** Whether the form considers this field to "need attention". The caller
939
- * supplies this from the SAME `getOptionBucket` the read-first status boxes
940
- * use, so it covers every attention case — empty-required, an unsatisfied
941
- * one-of group, AND a filled-but-invalid value — and the autofocus target can
942
- * never drift from the visible needs-attention set. */
943
- needsAttention: boolean;
944
- }
945
-
946
- /**
947
- * Pick the first field the user must fix: the first focusable field — in the
948
- * supplied (already ordered) name list — that the form buckets as "needs
949
- * attention".
950
- *
951
- * Pure and side-effect free. It deliberately does NOT re-derive emptiness /
952
- * required / validity itself; the caller passes `needsAttention` straight from
953
- * the engine's own `getOptionBucket`, so there is a single source of truth and
954
- * the "focus the first field to fix" affordance can never disagree with the
955
- * per-row status the user sees (including filled-but-invalid rows). Returns
956
- * `undefined` when nothing needs attention.
957
- */
958
- export const getFirstAttentionOptionName = (
959
- orderedNames: string[],
960
- getFieldMeta: (name: string) => IFirstAttentionFieldMeta | undefined
961
- ): string | undefined => {
962
- for (const name of orderedNames) {
963
- const meta = getFieldMeta(name);
964
- if (meta?.focusable && meta.needsAttention) {
965
- return name;
966
- }
967
- }
968
-
969
- return undefined;
970
- };
971
-
972
- /* ------------------------------------------------------------------------- */
973
- /* Record identity — which field says WHICH item this is */
974
- /* */
975
- /* Lives here, beside the formatters it uses, rather than in the view that */
976
- /* first needed it: it is data logic, not rendering, and BOTH list renderers */
977
- /* plus their tests import it. Keeping it in `SchemaDataView` dragged React, */
978
- /* styled-components and every Reqore component it renders into any module */
979
- /* that only wanted to know an item's name — which broke `arrayAutoField`'s */
980
- /* mocked-Reqore test the moment the editable list started using it. */
981
- /* ------------------------------------------------------------------------- */
982
-
983
- /** A UI-encoded value carries its type alongside it; the record's own value is inside. */
984
- const unwrap = (value: unknown): unknown =>
985
- isUiEncodedValue(value) ? (value as { value: unknown }).value : value;
986
-
987
- /** Whether a value is worth a row of its own. `false` and `0` are values. */
988
- export const isSet = (value: unknown): boolean =>
989
- value !== undefined && value !== null && value !== '' && !(Array.isArray(value) && !value.length);
990
-
991
- /**
992
- * The keys to render, in the order to render them: the schema's own order first
993
- * (that is the order the form puts the fields in), then anything stored that the
994
- * schema does not mention, so undescribed data is shown rather than dropped.
995
- */
996
- export const orderedKeys = (
997
- record: Record<string, unknown>,
998
- schema: IQorusFormSchema
999
- ): string[] => {
1000
- const described = Object.keys(schema).filter((key) => isSet(unwrap(record[key])));
1001
- const extra = Object.keys(record).filter((key) => !(key in schema) && isSet(unwrap(record[key])));
1002
- return [...described, ...extra];
1003
- };
1004
-
1005
- /** A field whose content is source code. `ui_type` is what the form renders by,
1006
- * so it is what the preview reads by too — the storage type is just `string`. */
1007
- export const isCodeField = (fieldSchema: TQorusFormFieldSchema | undefined): boolean => {
1008
- const uiType = (fieldSchema as { ui_type?: string } | undefined)?.ui_type;
1009
- return uiType === 'code-editor';
1010
- };
1011
-
1012
- /**
1013
- * The field whose value heads the item — the first DECLARED one holding a plain
1014
- * scalar.
1015
- *
1016
- * Schema order, not value order: the first declared field is the one the form
1017
- * puts at the top of an item, which is the one that says which item it is. A
1018
- * code body or a nested level is skipped, not because it is unimportant but
1019
- * because it has no one-line form — it belongs in the rows below where it can
1020
- * actually be read.
1021
- *
1022
- * One definition, used both to RENDER the heading and to omit that field from
1023
- * the rows. Computing it twice is how the heading and the rows start disagreeing
1024
- * about which field was promoted, and the item shows its name twice or not at
1025
- * all.
1026
- */
1027
- export const titleKeyFor = (
1028
- record: Record<string, unknown>,
1029
- schema: IQorusFormSchema
1030
- ): string | undefined =>
1031
- orderedKeys(record, schema).find((key) => {
1032
- const fieldSchema = schema[key] as TQorusFormFieldSchema | undefined;
1033
- if (isCodeField(fieldSchema)) {
1034
- return false;
1035
- }
1036
- const raw = unwrap(record[key]);
1037
- return typeof raw === 'string' || typeof raw === 'number';
1038
- });
1039
-
1040
- /** What identifies one record: which field was promoted, and how to draw it. */
1041
- export interface IRecordIdentity {
1042
- /** The promoted field's key, so a caller can omit it from the rows below. */
1043
- key: string;
1044
- /** The value, formatted the way its own row would format it. */
1045
- text: string;
1046
- /** The promoted field's label — a caption for the heading, not a second line. */
1047
- label: string;
1048
- /** A literal keeps its mono face; a chosen label is prose. */
1049
- mono: boolean;
1050
- }
1051
-
1052
- /**
1053
- * The identity of one record, for any surface that heads a list item with it.
1054
- *
1055
- * Exported because the preview is not the only place a list of records is shown:
1056
- * the editable list (`ArrayAuto`) heads the same records, and it must promote the
1057
- * same field and format it the same way. Two implementations would drift the
1058
- * moment one of them learned about a new field type, and the reader would meet
1059
- * an item called `init` in the preview and `#1` in the editor.
1060
- */
1061
- export const recordIdentity = (
1062
- record: Record<string, unknown>,
1063
- schema: IQorusFormSchema | undefined
1064
- ): IRecordIdentity | undefined => {
1065
- if (!schema) {
1066
- return undefined;
1067
- }
1068
-
1069
- const key = titleKeyFor(record, schema);
1070
-
1071
- if (!key) {
1072
- return undefined;
1073
- }
1074
-
1075
- const fieldSchema = schema[key] as TQorusFormFieldSchema | undefined;
1076
- const raw = unwrap(record[key]);
1077
-
1078
- return {
1079
- key,
1080
- text: formatOptionValue(
1081
- { type: fieldSchema?.type, value: raw } as IQorusFormField,
1082
- fieldSchema
1083
- ),
1084
- label: fieldLabel(key, fieldSchema),
1085
- mono: !findAllowedValueOption(raw, fieldSchema),
1086
- };
1087
- };
1088
-
1089
- export const fieldLabel = (key: string, fieldSchema: TQorusFormFieldSchema | undefined): string =>
1090
- (fieldSchema as { display_name?: string } | undefined)?.display_name || key;