@qoretechnologies/reqraft 0.10.62 → 0.10.63-pr.142.g0b675cd

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 (736) hide show
  1. package/README.md +21 -1
  2. package/dist/components/Description/describedControl.d.ts +48 -0
  3. package/dist/components/Description/describedControl.d.ts.map +1 -0
  4. package/dist/components/Description/describedControl.js +81 -0
  5. package/dist/components/Description/describedControl.js.map +1 -0
  6. package/dist/components/Description/index.d.ts.map +1 -1
  7. package/dist/components/Description/index.js +3 -2
  8. package/dist/components/Description/index.js.map +1 -1
  9. package/dist/components/colorValue/colorValue.d.ts +59 -0
  10. package/dist/components/colorValue/colorValue.d.ts.map +1 -0
  11. package/dist/components/colorValue/colorValue.js +245 -0
  12. package/dist/components/colorValue/colorValue.js.map +1 -0
  13. package/dist/components/colorValue/index.d.ts +34 -0
  14. package/dist/components/colorValue/index.d.ts.map +1 -0
  15. package/dist/components/colorValue/index.js +136 -0
  16. package/dist/components/colorValue/index.js.map +1 -0
  17. package/dist/components/colorValue/labels.d.ts +12 -0
  18. package/dist/components/colorValue/labels.d.ts.map +1 -0
  19. package/dist/components/colorValue/labels.js +11 -0
  20. package/dist/components/colorValue/labels.js.map +1 -0
  21. package/dist/components/composer/Composer.d.ts +1 -1
  22. package/dist/components/composer/Composer.d.ts.map +1 -1
  23. package/dist/components/composer/Composer.js +2 -2
  24. package/dist/components/composer/Composer.js.map +1 -1
  25. package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
  26. package/dist/components/dpqlEditor/DpqlEditor.js +25 -5
  27. package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
  28. package/dist/components/dpqlEditor/dpqlHelpers.d.ts +10 -1
  29. package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
  30. package/dist/components/dpqlEditor/dpqlHelpers.js +30 -13
  31. package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
  32. package/dist/components/dpqlEditor/dpqlTags.d.ts +11 -7
  33. package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
  34. package/dist/components/dpqlEditor/dpqlTags.js +11 -6
  35. package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
  36. package/dist/components/dpqlEditor/types.d.ts +47 -8
  37. package/dist/components/dpqlEditor/types.d.ts.map +1 -1
  38. package/dist/components/dpqlEditor/useDpqlSession.d.ts +2 -2
  39. package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
  40. package/dist/components/dpqlEditor/useDpqlSession.js +16 -7
  41. package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
  42. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  43. package/dist/components/form/engine/CompactRow.js +151 -83
  44. package/dist/components/form/engine/CompactRow.js.map +1 -1
  45. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  46. package/dist/components/form/engine/CompactToolbar.js +29 -3
  47. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  48. package/dist/components/form/engine/FormEngine.d.ts +34 -1
  49. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  50. package/dist/components/form/engine/FormEngine.js +487 -87
  51. package/dist/components/form/engine/FormEngine.js.map +1 -1
  52. package/dist/components/form/engine/HiddenFieldsNote.d.ts +28 -0
  53. package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -0
  54. package/dist/components/form/engine/HiddenFieldsNote.js +32 -0
  55. package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -0
  56. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  57. package/dist/components/form/engine/OptionFieldMessages.js +24 -3
  58. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  59. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +2 -2
  60. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  61. package/dist/components/form/engine/_structuredData/SchemaDataView.js +12 -6
  62. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  63. package/dist/components/form/engine/compactRowContext.d.ts +19 -0
  64. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  65. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  66. package/dist/components/form/engine/compactRowStyles.d.ts +0 -1
  67. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  68. package/dist/components/form/engine/compactRowStyles.js +12 -20
  69. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  70. package/dist/components/form/engine/compactToolbarColors.d.ts +16 -0
  71. package/dist/components/form/engine/compactToolbarColors.d.ts.map +1 -0
  72. package/dist/components/form/engine/compactToolbarColors.js +21 -0
  73. package/dist/components/form/engine/compactToolbarColors.js.map +1 -0
  74. package/dist/components/form/engine/readFirst.d.ts +24 -8
  75. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  76. package/dist/components/form/engine/readFirst.js +77 -109
  77. package/dist/components/form/engine/readFirst.js.map +1 -1
  78. package/dist/components/form/engine/readFirstColors.d.ts +30 -0
  79. package/dist/components/form/engine/readFirstColors.d.ts.map +1 -0
  80. package/dist/components/form/engine/readFirstColors.js +51 -0
  81. package/dist/components/form/engine/readFirstColors.js.map +1 -0
  82. package/dist/components/form/engine/rowFocus.d.ts +2 -0
  83. package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
  84. package/dist/components/form/engine/rowFocus.js +26 -3
  85. package/dist/components/form/engine/rowFocus.js.map +1 -1
  86. package/dist/components/form/engine/typeChoices.d.ts +1 -1
  87. package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -1
  88. package/dist/components/form/engine/variants/VariantCalmTable.js +2 -1
  89. package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -1
  90. package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -1
  91. package/dist/components/form/engine/variants/VariantCards.js +2 -1
  92. package/dist/components/form/engine/variants/VariantCards.js.map +1 -1
  93. package/dist/components/form/engine/variants/VariantFocus.js +1 -1
  94. package/dist/components/form/engine/variants/VariantFocus.js.map +1 -1
  95. package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -1
  96. package/dist/components/form/engine/variants/VariantMinimal.js +2 -1
  97. package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -1
  98. package/dist/components/form/engine/variants/variantParts.d.ts +1 -1
  99. package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -1
  100. package/dist/components/form/engine/variants/variantParts.js +25 -17
  101. package/dist/components/form/engine/variants/variantParts.js.map +1 -1
  102. package/dist/components/form/expressions/DpqlRendering.d.ts +1 -1
  103. package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
  104. package/dist/components/form/expressions/DpqlRendering.js +3 -3
  105. package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
  106. package/dist/components/form/expressions/ExpressionField.d.ts +41 -3
  107. package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
  108. package/dist/components/form/expressions/ExpressionField.js +396 -99
  109. package/dist/components/form/expressions/ExpressionField.js.map +1 -1
  110. package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
  111. package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
  112. package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
  113. package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
  114. package/dist/components/form/expressions/builder/argumentLabel.js +27 -9
  115. package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
  116. package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
  117. package/dist/components/form/expressions/builder/argumentWrapper.js +4 -2
  118. package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
  119. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
  120. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +5 -4
  121. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
  122. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts +1 -1
  123. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
  124. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +6 -3
  125. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
  126. package/dist/components/form/expressions/builder/index.d.ts +24 -2
  127. package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
  128. package/dist/components/form/expressions/builder/index.js +121 -77
  129. package/dist/components/form/expressions/builder/index.js.map +1 -1
  130. package/dist/components/form/expressions/builder/item.d.ts +6 -2
  131. package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
  132. package/dist/components/form/expressions/builder/item.js +19 -5
  133. package/dist/components/form/expressions/builder/item.js.map +1 -1
  134. package/dist/components/form/expressions/builder/renderTemplate.js +1 -1
  135. package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
  136. package/dist/components/form/expressions/expressionOperands.d.ts +16 -0
  137. package/dist/components/form/expressions/expressionOperands.d.ts.map +1 -0
  138. package/dist/components/form/expressions/expressionOperands.js +97 -0
  139. package/dist/components/form/expressions/expressionOperands.js.map +1 -0
  140. package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
  141. package/dist/components/form/expressions/mockExpressions.js +22 -5
  142. package/dist/components/form/expressions/mockExpressions.js.map +1 -1
  143. package/dist/components/form/expressions/renderExpressionToText.d.ts +2 -0
  144. package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
  145. package/dist/components/form/expressions/renderExpressionToText.js +35 -9
  146. package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
  147. package/dist/components/form/expressions/textOfExpression.d.ts +18 -0
  148. package/dist/components/form/expressions/textOfExpression.d.ts.map +1 -0
  149. package/dist/components/form/expressions/textOfExpression.js +37 -0
  150. package/dist/components/form/expressions/textOfExpression.js.map +1 -0
  151. package/dist/components/form/expressions/useExpressionType.d.ts +26 -0
  152. package/dist/components/form/expressions/useExpressionType.d.ts.map +1 -0
  153. package/dist/components/form/expressions/useExpressionType.js +181 -0
  154. package/dist/components/form/expressions/useExpressionType.js.map +1 -0
  155. package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
  156. package/dist/components/form/expressions/useRenderExpression.js +7 -7
  157. package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
  158. package/dist/components/form/fields/Field.d.ts.map +1 -1
  159. package/dist/components/form/fields/Field.js +20 -7
  160. package/dist/components/form/fields/Field.js.map +1 -1
  161. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  162. package/dist/components/form/fields/allowed-values/AllowedValues.js +17 -4
  163. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  164. package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
  165. package/dist/components/form/fields/array/ArrayAuto.js +24 -0
  166. package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
  167. package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
  168. package/dist/components/form/fields/array/ArrayAutoField.js +36 -13
  169. package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
  170. package/dist/components/form/fields/auto/AutoFormField.d.ts +20 -1
  171. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  172. package/dist/components/form/fields/auto/AutoFormField.js +81 -36
  173. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  174. package/dist/components/form/fields/auto/hostEditorValue.d.ts +30 -0
  175. package/dist/components/form/fields/auto/hostEditorValue.d.ts.map +1 -0
  176. package/dist/components/form/fields/auto/hostEditorValue.js +53 -0
  177. package/dist/components/form/fields/auto/hostEditorValue.js.map +1 -0
  178. package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
  179. package/dist/components/form/fields/binary/Binary.js +23 -3
  180. package/dist/components/form/fields/binary/Binary.js.map +1 -1
  181. package/dist/components/form/fields/boolean/Boolean.d.ts +5 -0
  182. package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
  183. package/dist/components/form/fields/boolean/Boolean.js +9 -1
  184. package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
  185. package/dist/components/form/fields/color/Color.d.ts +103 -16
  186. package/dist/components/form/fields/color/Color.d.ts.map +1 -1
  187. package/dist/components/form/fields/color/Color.js +611 -16
  188. package/dist/components/form/fields/color/Color.js.map +1 -1
  189. package/dist/components/form/fields/emittedValues.d.ts +34 -3
  190. package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
  191. package/dist/components/form/fields/emittedValues.js +24 -1
  192. package/dist/components/form/fields/emittedValues.js.map +1 -1
  193. package/dist/components/form/fields/file/File.d.ts +1 -1
  194. package/dist/components/form/fields/file/File.d.ts.map +1 -1
  195. package/dist/components/form/fields/file/File.js +4 -2
  196. package/dist/components/form/fields/file/File.js.map +1 -1
  197. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  198. package/dist/components/form/fields/long-string/LongString.js +17 -3
  199. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  200. package/dist/components/form/fields/markdown/MarkdownView.js +1 -1
  201. package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
  202. package/dist/components/form/fields/multi-select/MultiSelectFormField.js +4 -1
  203. package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
  204. package/dist/components/form/fields/number/Number.d.ts +6 -0
  205. package/dist/components/form/fields/number/Number.d.ts.map +1 -1
  206. package/dist/components/form/fields/number/Number.js +41 -6
  207. package/dist/components/form/fields/number/Number.js.map +1 -1
  208. package/dist/components/form/fields/object/Object.d.ts +1 -1
  209. package/dist/components/form/fields/object/Object.d.ts.map +1 -1
  210. package/dist/components/form/fields/object/Object.js +4 -2
  211. package/dist/components/form/fields/object/Object.js.map +1 -1
  212. package/dist/components/form/fields/pendingEdit.d.ts +52 -0
  213. package/dist/components/form/fields/pendingEdit.d.ts.map +1 -0
  214. package/dist/components/form/fields/pendingEdit.js +79 -0
  215. package/dist/components/form/fields/pendingEdit.js.map +1 -0
  216. package/dist/components/form/fields/rich-text/RichText.d.ts +8 -1
  217. package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
  218. package/dist/components/form/fields/rich-text/RichText.js +190 -81
  219. package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
  220. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +18 -0
  221. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -0
  222. package/dist/components/form/fields/rich-text/useTemplateTags.js +49 -0
  223. package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
  224. package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
  225. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +4 -1
  226. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
  227. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
  228. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +20 -5
  229. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
  230. package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
  231. package/dist/components/form/fields/schema-definition/TableEditor.js +10 -2
  232. package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
  233. package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
  234. package/dist/components/form/fields/schema-definition/index.js +8 -4
  235. package/dist/components/form/fields/schema-definition/index.js.map +1 -1
  236. package/dist/components/form/fields/select/Select.d.ts +2 -0
  237. package/dist/components/form/fields/select/Select.d.ts.map +1 -1
  238. package/dist/components/form/fields/select/Select.js +19 -10
  239. package/dist/components/form/fields/select/Select.js.map +1 -1
  240. package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
  241. package/dist/components/form/fields/select/SelectCollection.js +8 -2
  242. package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
  243. package/dist/components/form/fields/select/unavailableRow.d.ts +23 -0
  244. package/dist/components/form/fields/select/unavailableRow.d.ts.map +1 -0
  245. package/dist/components/form/fields/select/unavailableRow.js +55 -0
  246. package/dist/components/form/fields/select/unavailableRow.js.map +1 -0
  247. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +5 -5
  248. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
  249. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +11 -4
  250. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
  251. package/dist/components/form/fields/template/TemplateBrowser.d.ts +22 -0
  252. package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
  253. package/dist/components/form/fields/template/TemplateBrowser.js +54 -0
  254. package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
  255. package/dist/components/form/fields/template/TemplateField.d.ts +83 -1
  256. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  257. package/dist/components/form/fields/template/TemplateField.js +535 -85
  258. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  259. package/dist/components/form/fields/template/TemplateText.d.ts +0 -17
  260. package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -1
  261. package/dist/components/form/fields/template/TemplateText.js +8 -4
  262. package/dist/components/form/fields/template/TemplateText.js.map +1 -1
  263. package/dist/components/form/fields/template/writtenAsText.d.ts +55 -0
  264. package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
  265. package/dist/components/form/fields/template/writtenAsText.js +188 -0
  266. package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
  267. package/dist/components/form/index.d.ts +10 -0
  268. package/dist/components/form/index.d.ts.map +1 -1
  269. package/dist/components/form/index.js +23 -1
  270. package/dist/components/form/index.js.map +1 -1
  271. package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
  272. package/dist/components/imageLightbox/ImageLightbox.js +19 -7
  273. package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
  274. package/dist/components/log/Log.d.ts.map +1 -1
  275. package/dist/components/log/Log.js +15 -7
  276. package/dist/components/log/Log.js.map +1 -1
  277. package/dist/components/menu/Menu.d.ts.map +1 -1
  278. package/dist/components/menu/Menu.js +19 -10
  279. package/dist/components/menu/Menu.js.map +1 -1
  280. package/dist/components/smartEditor/CompletionMenu.d.ts +43 -0
  281. package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
  282. package/dist/components/smartEditor/CompletionMenu.js +196 -0
  283. package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
  284. package/dist/components/smartEditor/MarkdownDoc.d.ts +1 -1
  285. package/dist/components/smartEditor/MarkdownDoc.js +1 -1
  286. package/dist/components/smartEditor/MarkdownDoc.js.map +1 -1
  287. package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
  288. package/dist/components/smartEditor/SmartEditor.js +51 -136
  289. package/dist/components/smartEditor/SmartEditor.js.map +1 -1
  290. package/dist/components/smartEditor/completionStyle.d.ts +27 -0
  291. package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
  292. package/dist/components/smartEditor/completionStyle.js +66 -0
  293. package/dist/components/smartEditor/completionStyle.js.map +1 -0
  294. package/dist/components/smartEditor/index.d.ts +5 -1
  295. package/dist/components/smartEditor/index.d.ts.map +1 -1
  296. package/dist/components/smartEditor/index.js +19 -1
  297. package/dist/components/smartEditor/index.js.map +1 -1
  298. package/dist/components/smartEditor/templateCompletions.d.ts +18 -0
  299. package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
  300. package/dist/components/smartEditor/templateCompletions.js +94 -0
  301. package/dist/components/smartEditor/templateCompletions.js.map +1 -0
  302. package/dist/components/smartEditor/types.d.ts +12 -1
  303. package/dist/components/smartEditor/types.d.ts.map +1 -1
  304. package/dist/components/smartEditor/useLspAutocomplete.d.ts +32 -0
  305. package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
  306. package/dist/components/smartEditor/useLspAutocomplete.js +228 -118
  307. package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
  308. package/dist/components/smartEditor/useLspHover.d.ts +22 -7
  309. package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
  310. package/dist/components/smartEditor/useLspHover.js +86 -17
  311. package/dist/components/smartEditor/useLspHover.js.map +1 -1
  312. package/dist/components/smartEditor/useLspSemanticTokens.js +1 -1
  313. package/dist/components/smartEditor/useLspSemanticTokens.js.map +1 -1
  314. package/dist/components/smartEditor/useLspSession.d.ts +6 -0
  315. package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
  316. package/dist/components/smartEditor/useLspSession.js +7 -6
  317. package/dist/components/smartEditor/useLspSession.js.map +1 -1
  318. package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
  319. package/dist/components/supportTicket/AttachmentChips.js +15 -5
  320. package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
  321. package/dist/components/supportTicket/ReferencePicker.d.ts +9 -2
  322. package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
  323. package/dist/components/supportTicket/ReferencePicker.js +27 -6
  324. package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
  325. package/dist/components/supportTicket/TicketHeader.d.ts +3 -4
  326. package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
  327. package/dist/components/supportTicket/TicketHeader.js +20 -2
  328. package/dist/components/supportTicket/TicketHeader.js.map +1 -1
  329. package/dist/components/supportTicket/TicketMetaTags.d.ts +1 -1
  330. package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
  331. package/dist/components/ticketReferences/TicketReferences.js +9 -4
  332. package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
  333. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  334. package/dist/components/ticketThread/TicketThread.js +36 -11
  335. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  336. package/dist/helpers/descriptionTooltip.d.ts +43 -0
  337. package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
  338. package/dist/helpers/descriptionTooltip.js +70 -0
  339. package/dist/helpers/descriptionTooltip.js.map +1 -0
  340. package/dist/helpers/domProps.d.ts +5 -0
  341. package/dist/helpers/domProps.d.ts.map +1 -0
  342. package/dist/helpers/domProps.js +47 -0
  343. package/dist/helpers/domProps.js.map +1 -0
  344. package/dist/helpers/expressions.d.ts +107 -2
  345. package/dist/helpers/expressions.d.ts.map +1 -1
  346. package/dist/helpers/expressions.js +223 -8
  347. package/dist/helpers/expressions.js.map +1 -1
  348. package/dist/helpers/hoveringPointer.d.ts +26 -0
  349. package/dist/helpers/hoveringPointer.d.ts.map +1 -0
  350. package/dist/helpers/hoveringPointer.js +29 -0
  351. package/dist/helpers/hoveringPointer.js.map +1 -0
  352. package/dist/helpers/markdownText.d.ts +14 -0
  353. package/dist/helpers/markdownText.d.ts.map +1 -0
  354. package/dist/helpers/markdownText.js +160 -0
  355. package/dist/helpers/markdownText.js.map +1 -0
  356. package/dist/helpers/qorusTypeCatalogue.d.ts +53 -0
  357. package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -0
  358. package/dist/helpers/qorusTypeCatalogue.js +262 -0
  359. package/dist/helpers/qorusTypeCatalogue.js.map +1 -0
  360. package/dist/helpers/readableColors.d.ts +36 -0
  361. package/dist/helpers/readableColors.d.ts.map +1 -0
  362. package/dist/helpers/readableColors.js +116 -0
  363. package/dist/helpers/readableColors.js.map +1 -0
  364. package/dist/helpers/templateItems.d.ts +2 -2
  365. package/dist/helpers/templateItems.d.ts.map +1 -1
  366. package/dist/helpers/templateItems.js +6 -4
  367. package/dist/helpers/templateItems.js.map +1 -1
  368. package/dist/helpers/templates.d.ts +26 -1
  369. package/dist/helpers/templates.d.ts.map +1 -1
  370. package/dist/helpers/templates.js +41 -6
  371. package/dist/helpers/templates.js.map +1 -1
  372. package/dist/helpers/validations.d.ts +9 -0
  373. package/dist/helpers/validations.d.ts.map +1 -1
  374. package/dist/helpers/validations.js +139 -33
  375. package/dist/helpers/validations.js.map +1 -1
  376. package/dist/hooks/useQorusTypes.d.ts +7 -15
  377. package/dist/hooks/useQorusTypes.d.ts.map +1 -1
  378. package/dist/hooks/useQorusTypes.js +25 -166
  379. package/dist/hooks/useQorusTypes.js.map +1 -1
  380. package/dist/hooks/useReadableIntentShade.d.ts +9 -0
  381. package/dist/hooks/useReadableIntentShade.d.ts.map +1 -0
  382. package/dist/hooks/useReadableIntentShade.js +23 -0
  383. package/dist/hooks/useReadableIntentShade.js.map +1 -0
  384. package/dist/hooks/useReadableOpacity.d.ts +6 -0
  385. package/dist/hooks/useReadableOpacity.d.ts.map +1 -0
  386. package/dist/hooks/useReadableOpacity.js +17 -0
  387. package/dist/hooks/useReadableOpacity.js.map +1 -0
  388. package/dist/index.d.ts +1 -0
  389. package/dist/index.d.ts.map +1 -1
  390. package/dist/index.js +1 -0
  391. package/dist/index.js.map +1 -1
  392. package/dist/tracking/ui/ExperimentCard.d.ts +1 -1
  393. package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
  394. package/dist/tracking/ui/ExperimentCard.js +26 -10
  395. package/dist/tracking/ui/ExperimentCard.js.map +1 -1
  396. package/dist/tracking/ui/card.d.ts +2 -2
  397. package/dist/tracking/ui/card.d.ts.map +1 -1
  398. package/dist/tracking/ui/card.js +2 -2
  399. package/dist/tracking/ui/card.js.map +1 -1
  400. package/dist/tracking/ui/readable.d.ts +14 -0
  401. package/dist/tracking/ui/readable.d.ts.map +1 -0
  402. package/dist/tracking/ui/readable.js +60 -0
  403. package/dist/tracking/ui/readable.js.map +1 -0
  404. package/package.json +14 -5
  405. package/.claude/CLAUDE.md +0 -317
  406. package/.tasks/EXPORT_EXPRESSION_BUILDER.md +0 -38
  407. package/.tasks/EXPRESSION_BUILDER_REPORT.md +0 -149
  408. package/.tasks/EXPRESSION_FIELD_SEAMS.md +0 -66
  409. package/.tasks/FIELD_STACK_REPORT.md +0 -234
  410. package/.tasks/FORM_ENGINE_COMPACT_READ_FIRST.md +0 -558
  411. package/.tasks/FORM_ENGINE_EXPRESSIONS.md +0 -197
  412. package/.tasks/FORM_ENGINE_OPTIONS_SYNC.md +0 -95
  413. package/.tasks/FORM_FIELD_EXTRAS.md +0 -72
  414. package/.tasks/INDEX.md +0 -111
  415. package/.tasks/LSP_SHARED_CONNECTION.md +0 -75
  416. package/.tasks/QONSOLE_ASSIST_FEATURES.md +0 -306
  417. package/.tasks/RENDER_EXPRESSION_LSP.md +0 -159
  418. package/.tasks/REQRAFT_AUTO_FIELD.md +0 -176
  419. package/.tasks/SCHEMA_DEFINITION_FIELD.md +0 -250
  420. package/.tasks/SMART_EDITOR_CONTEXT_AND_POLISH.md +0 -340
  421. package/.tasks/SMART_EDITOR_LSP_FEATURES.md +0 -299
  422. package/.tasks/SMART_EDITOR_REVIEW_FOLLOWUPS.md +0 -280
  423. package/.tasks/SMART_EDITOR_UX_POLISH.md +0 -383
  424. package/.tasks/SMART_EDITOR_VISUAL_POLISH.md +0 -246
  425. package/.tasks/STORY_NETWORK_ISOLATION.md +0 -98
  426. package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +0 -72
  427. package/CODE_OF_CONDUCT.md +0 -105
  428. package/CONTRIBUTING.MD +0 -78
  429. package/SECURITY.md +0 -3
  430. package/chromatic.config.json +0 -5
  431. package/design/COMPACT_ENGINE_REDESIGN.md +0 -156
  432. package/design/COMPACT_INFO_DISPLAY.md +0 -87
  433. package/design/COMPACT_PARITY.md +0 -85
  434. package/design/EXPRESSION_BUILDER_REPORT_STRATEGY.md +0 -92
  435. package/design/FORM_ENGINE_COMPACT.md +0 -300
  436. package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +0 -353
  437. package/design/FORM_ENGINE_EXPRESSIONS.md +0 -257
  438. package/design/FORM_ENGINE_FIELD_MIGRATION.md +0 -419
  439. package/design/IDE_INTEGRATION.md +0 -64
  440. package/design/RENDER_EXPRESSION_TRANSPORT.md +0 -156
  441. package/design/SELECT_DIALOG_FLOOR.md +0 -86
  442. package/design/SMART_EDITOR_UX.md +0 -438
  443. package/design/TRACKING.md +0 -290
  444. package/design/UNAVAILABLE_ALLOWED_VALUES.md +0 -226
  445. package/src/components/Description/index.tsx +0 -254
  446. package/src/components/Description/markdownRendererContext.tsx +0 -29
  447. package/src/components/FocusedEditing/index.tsx +0 -50
  448. package/src/components/codeSize/index.tsx +0 -79
  449. package/src/components/composer/Composer.stories.tsx +0 -238
  450. package/src/components/composer/Composer.tsx +0 -554
  451. package/src/components/composer/helpers.ts +0 -74
  452. package/src/components/composer/index.ts +0 -2
  453. package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -1183
  454. package/src/components/dpqlEditor/DpqlEditor.tsx +0 -219
  455. package/src/components/dpqlEditor/dpqlHelpers.ts +0 -287
  456. package/src/components/dpqlEditor/dpqlInserter.ts +0 -121
  457. package/src/components/dpqlEditor/dpqlProbe.ts +0 -165
  458. package/src/components/dpqlEditor/dpqlTags.ts +0 -114
  459. package/src/components/dpqlEditor/index.ts +0 -41
  460. package/src/components/dpqlEditor/types.ts +0 -203
  461. package/src/components/dpqlEditor/useDpqlProbe.ts +0 -33
  462. package/src/components/dpqlEditor/useDpqlSession.ts +0 -411
  463. package/src/components/form/engine/CompactRow.tsx +0 -2620
  464. package/src/components/form/engine/CompactToolbar.tsx +0 -330
  465. package/src/components/form/engine/FormEngine.stories.tsx +0 -9920
  466. package/src/components/form/engine/FormEngine.tsx +0 -4569
  467. package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
  468. package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -331
  469. package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
  470. package/src/components/form/engine/OptionFieldMessages.tsx +0 -477
  471. package/src/components/form/engine/OptionsHelpDialog.tsx +0 -29
  472. package/src/components/form/engine/__fixtures__/basicFormOptions.ts +0 -309
  473. package/src/components/form/engine/__fixtures__/fieldChromeOptions.ts +0 -45
  474. package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +0 -233
  475. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +0 -742
  476. package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +0 -85
  477. package/src/components/form/engine/_structuredData/StructuredDataView.tsx +0 -75
  478. package/src/components/form/engine/_structuredData/structuredData.ts +0 -145
  479. package/src/components/form/engine/compactRowContext.ts +0 -148
  480. package/src/components/form/engine/compactRowStyles.ts +0 -898
  481. package/src/components/form/engine/compactToolbarContext.ts +0 -69
  482. package/src/components/form/engine/optionActions.ts +0 -128
  483. package/src/components/form/engine/optionsContext.ts +0 -24
  484. package/src/components/form/engine/readFirst.ts +0 -1077
  485. package/src/components/form/engine/rendererTypes.ts +0 -107
  486. package/src/components/form/engine/revealRow.ts +0 -123
  487. package/src/components/form/engine/rowFocus.ts +0 -101
  488. package/src/components/form/engine/rowMenuContext.ts +0 -159
  489. package/src/components/form/engine/rowOpenPicker.ts +0 -27
  490. package/src/components/form/engine/typeChoices.ts +0 -63
  491. package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +0 -159
  492. package/src/components/form/engine/variants/VariantCalmTable.tsx +0 -244
  493. package/src/components/form/engine/variants/VariantCards.tsx +0 -212
  494. package/src/components/form/engine/variants/VariantFocus.tsx +0 -382
  495. package/src/components/form/engine/variants/VariantMinimal.tsx +0 -170
  496. package/src/components/form/engine/variants/focusDemo.ts +0 -145
  497. package/src/components/form/engine/variants/variantModel.ts +0 -223
  498. package/src/components/form/engine/variants/variantParts.tsx +0 -313
  499. package/src/components/form/expressions/DpqlRendering.tsx +0 -85
  500. package/src/components/form/expressions/ExpressionField.stories.tsx +0 -1395
  501. package/src/components/form/expressions/ExpressionField.tsx +0 -503
  502. package/src/components/form/expressions/argumentPresence.ts +0 -213
  503. package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +0 -1683
  504. package/src/components/form/expressions/builder/argumentDetail.tsx +0 -17
  505. package/src/components/form/expressions/builder/argumentLabel.tsx +0 -146
  506. package/src/components/form/expressions/builder/argumentSlot.tsx +0 -101
  507. package/src/components/form/expressions/builder/argumentWrapper.tsx +0 -243
  508. package/src/components/form/expressions/builder/confirmMismatchedTypesModal.tsx +0 -120
  509. package/src/components/form/expressions/builder/confirmUnsupportedTypeModal.tsx +0 -69
  510. package/src/components/form/expressions/builder/index.tsx +0 -1545
  511. package/src/components/form/expressions/builder/item.tsx +0 -89
  512. package/src/components/form/expressions/builder/moveToPositionStrip.tsx +0 -156
  513. package/src/components/form/expressions/builder/renderTemplate.tsx +0 -42
  514. package/src/components/form/expressions/dpqlMockLanguage.ts +0 -566
  515. package/src/components/form/expressions/dpqlMockLsp.ts +0 -126
  516. package/src/components/form/expressions/mockExpressions.ts +0 -317
  517. package/src/components/form/expressions/renderExpressionToText.ts +0 -137
  518. package/src/components/form/expressions/types.ts +0 -110
  519. package/src/components/form/expressions/useExpressions.ts +0 -101
  520. package/src/components/form/expressions/useRenderExpression.ts +0 -165
  521. package/src/components/form/fields/Field.stories.tsx +0 -143
  522. package/src/components/form/fields/Field.tsx +0 -732
  523. package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -297
  524. package/src/components/form/fields/array/ArrayAuto.tsx +0 -237
  525. package/src/components/form/fields/array/ArrayAutoField.stories.tsx +0 -475
  526. package/src/components/form/fields/array/ArrayAutoField.tsx +0 -367
  527. package/src/components/form/fields/auto/AutoFormField.stories.tsx +0 -825
  528. package/src/components/form/fields/auto/AutoFormField.tsx +0 -1164
  529. package/src/components/form/fields/binary/Binary.stories.tsx +0 -122
  530. package/src/components/form/fields/binary/Binary.tsx +0 -91
  531. package/src/components/form/fields/boolean/Boolean.stories.tsx +0 -125
  532. package/src/components/form/fields/boolean/Boolean.tsx +0 -34
  533. package/src/components/form/fields/byte-size/ByteSize.stories.tsx +0 -87
  534. package/src/components/form/fields/byte-size/ByteSize.tsx +0 -58
  535. package/src/components/form/fields/color/Color.stories.tsx +0 -99
  536. package/src/components/form/fields/color/Color.tsx +0 -46
  537. package/src/components/form/fields/cron/Cron.stories.tsx +0 -68
  538. package/src/components/form/fields/cron/Cron.tsx +0 -80
  539. package/src/components/form/fields/date/Date.stories.tsx +0 -77
  540. package/src/components/form/fields/date/Date.tsx +0 -55
  541. package/src/components/form/fields/emittedValues.ts +0 -70
  542. package/src/components/form/fields/file/File.stories.tsx +0 -161
  543. package/src/components/form/fields/file/File.tsx +0 -227
  544. package/src/components/form/fields/long-string/LongString.stories.tsx +0 -120
  545. package/src/components/form/fields/long-string/LongString.tsx +0 -130
  546. package/src/components/form/fields/markdown/Markdown.stories.tsx +0 -76
  547. package/src/components/form/fields/markdown/Markdown.tsx +0 -81
  548. package/src/components/form/fields/markdown/MarkdownView.tsx +0 -222
  549. package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +0 -139
  550. package/src/components/form/fields/number/Number.stories.tsx +0 -159
  551. package/src/components/form/fields/number/Number.tsx +0 -160
  552. package/src/components/form/fields/object/Object.stories.tsx +0 -398
  553. package/src/components/form/fields/object/Object.tsx +0 -255
  554. package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +0 -95
  555. package/src/components/form/fields/radio-group/RadioGroup.tsx +0 -46
  556. package/src/components/form/fields/radio-group/images/java-96x128.png +0 -0
  557. package/src/components/form/fields/radio-group/images/python-129x128.png +0 -0
  558. package/src/components/form/fields/radio-group/images/qore-106x128.png +0 -0
  559. package/src/components/form/fields/rich-text/RichText.stories.tsx +0 -260
  560. package/src/components/form/fields/rich-text/RichText.tsx +0 -537
  561. package/src/components/form/fields/schema-definition/CatalogLeafForm.tsx +0 -242
  562. package/src/components/form/fields/schema-definition/CatalogNodeEditor.tsx +0 -758
  563. package/src/components/form/fields/schema-definition/Hint.tsx +0 -22
  564. package/src/components/form/fields/schema-definition/InlineValidationBanner.tsx +0 -138
  565. package/src/components/form/fields/schema-definition/Loader.tsx +0 -20
  566. package/src/components/form/fields/schema-definition/MigrationsTab.tsx +0 -187
  567. package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +0 -286
  568. package/src/components/form/fields/schema-definition/TableEditor.tsx +0 -155
  569. package/src/components/form/fields/schema-definition/TablesTab.tsx +0 -138
  570. package/src/components/form/fields/schema-definition/catalog.ts +0 -237
  571. package/src/components/form/fields/schema-definition/helpers.ts +0 -90
  572. package/src/components/form/fields/schema-definition/index.tsx +0 -418
  573. package/src/components/form/fields/schema-definition/mockCatalog.ts +0 -325
  574. package/src/components/form/fields/schema-definition/mockDefinition.ts +0 -111
  575. package/src/components/form/fields/schema-definition/referenceSuggestions.tsx +0 -152
  576. package/src/components/form/fields/schema-definition/starterTemplate.ts +0 -68
  577. package/src/components/form/fields/schema-definition/types.ts +0 -185
  578. package/src/components/form/fields/schema-definition/useSchemaOptionCatalog.ts +0 -49
  579. package/src/components/form/fields/select/Select.stories.tsx +0 -872
  580. package/src/components/form/fields/select/Select.tsx +0 -624
  581. package/src/components/form/fields/select/SelectCollection.tsx +0 -594
  582. package/src/components/form/fields/string/String.stories.tsx +0 -86
  583. package/src/components/form/fields/string/String.tsx +0 -43
  584. package/src/components/form/fields/template/ExampleValueModal.stories.tsx +0 -114
  585. package/src/components/form/fields/template/ExampleValueModal.tsx +0 -99
  586. package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +0 -47
  587. package/src/components/form/fields/template/TemplateField.stories.tsx +0 -1121
  588. package/src/components/form/fields/template/TemplateField.tsx +0 -1717
  589. package/src/components/form/fields/template/TemplateText.tsx +0 -115
  590. package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +0 -7
  591. package/src/components/form/fields/template/__fixtures__/multiLevelTemplates.json +0 -147
  592. package/src/components/form/fields/template/__fixtures__/templates.json +0 -83
  593. package/src/components/form/fields/timeout/Timeout.stories.tsx +0 -228
  594. package/src/components/form/fields/timeout/Timeout.tsx +0 -87
  595. package/src/components/form/fields/url/Url.stories.tsx +0 -94
  596. package/src/components/form/fields/url/Url.tsx +0 -85
  597. package/src/components/form/index.tsx +0 -47
  598. package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
  599. package/src/components/imageLightbox/ImageLightbox.tsx +0 -236
  600. package/src/components/imageLightbox/index.ts +0 -1
  601. package/src/components/log/Log.stories.tsx +0 -333
  602. package/src/components/log/Log.tsx +0 -285
  603. package/src/components/menu/Menu.stories.tsx +0 -155
  604. package/src/components/menu/Menu.tsx +0 -312
  605. package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +0 -797
  606. package/src/components/qonsoleSmartInput/QonsoleSmartInput.tsx +0 -105
  607. package/src/components/qonsoleSmartInput/index.ts +0 -16
  608. package/src/components/qonsoleSmartInput/qonsoleInserter.ts +0 -77
  609. package/src/components/qonsoleSmartInput/types.ts +0 -133
  610. package/src/components/qonsoleSmartInput/useQonsoleSession.ts +0 -124
  611. package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +0 -62
  612. package/src/components/searchFilterBar/SearchFilterBar.tsx +0 -144
  613. package/src/components/searchFilterBar/index.ts +0 -1
  614. package/src/components/smartEditor/MarkdownDoc.tsx +0 -190
  615. package/src/components/smartEditor/SmartEditor.stories.tsx +0 -475
  616. package/src/components/smartEditor/SmartEditor.tsx +0 -808
  617. package/src/components/smartEditor/__fixtures__/mockLspServer.ts +0 -205
  618. package/src/components/smartEditor/helpers.ts +0 -217
  619. package/src/components/smartEditor/index.ts +0 -35
  620. package/src/components/smartEditor/styling.ts +0 -45
  621. package/src/components/smartEditor/types.ts +0 -211
  622. package/src/components/smartEditor/useLspAutocomplete.ts +0 -758
  623. package/src/components/smartEditor/useLspDiagnosticDecorations.ts +0 -125
  624. package/src/components/smartEditor/useLspHover.ts +0 -230
  625. package/src/components/smartEditor/useLspSemanticTokens.ts +0 -298
  626. package/src/components/smartEditor/useLspSession.ts +0 -231
  627. package/src/components/smartEditor/useLspSignatureHelp.ts +0 -198
  628. package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -171
  629. package/src/components/supportTicket/AttachmentChips.tsx +0 -147
  630. package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -257
  631. package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -129
  632. package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -584
  633. package/src/components/supportTicket/ReferencePicker.tsx +0 -563
  634. package/src/components/supportTicket/TicketConversation.stories.tsx +0 -121
  635. package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
  636. package/src/components/supportTicket/TicketHeader.tsx +0 -247
  637. package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
  638. package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
  639. package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -354
  640. package/src/components/supportTicket/TicketReplyBox.tsx +0 -150
  641. package/src/components/supportTicket/__fixtures__/kindMarks.ts +0 -28
  642. package/src/components/supportTicket/attachmentAccess.ts +0 -97
  643. package/src/components/supportTicket/fileToAttachment.ts +0 -24
  644. package/src/components/supportTicket/index.ts +0 -10
  645. package/src/components/supportTicket/meta.ts +0 -206
  646. package/src/components/supportTicket/ticketModel.ts +0 -131
  647. package/src/components/supportTicket/useLoadedImages.ts +0 -73
  648. package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -315
  649. package/src/components/ticketReferences/TicketReferences.tsx +0 -906
  650. package/src/components/ticketReferences/index.ts +0 -2
  651. package/src/components/ticketThread/TicketThread.stories.tsx +0 -829
  652. package/src/components/ticketThread/TicketThread.tsx +0 -719
  653. package/src/components/ticketThread/index.ts +0 -6
  654. package/src/contexts/FetchContext.tsx +0 -25
  655. package/src/contexts/ReqraftContext.tsx +0 -9
  656. package/src/contexts/StorageContext.tsx +0 -33
  657. package/src/global.d.ts +0 -4
  658. package/src/helpers/allowedValues.ts +0 -249
  659. package/src/helpers/choiceChip.ts +0 -227
  660. package/src/helpers/common.ts +0 -326
  661. package/src/helpers/dpqlDetection.ts +0 -209
  662. package/src/helpers/expressions.ts +0 -140
  663. package/src/helpers/optionUiTypes.ts +0 -199
  664. package/src/helpers/options.ts +0 -150
  665. package/src/helpers/providerValue.ts +0 -125
  666. package/src/helpers/scrollbar.ts +0 -32
  667. package/src/helpers/singleLineString.ts +0 -61
  668. package/src/helpers/templateItems.ts +0 -81
  669. package/src/helpers/templateText.ts +0 -350
  670. package/src/helpers/templates.ts +0 -602
  671. package/src/helpers/validations.ts +0 -2085
  672. package/src/hooks/useArgSchema.ts +0 -37
  673. package/src/hooks/useCoarsePointer.ts +0 -30
  674. package/src/hooks/useFetch/useFetch.stories.tsx +0 -379
  675. package/src/hooks/useFetch/useFetch.tsx +0 -154
  676. package/src/hooks/usePhoneViewport.ts +0 -34
  677. package/src/hooks/useQorusTypes.ts +0 -233
  678. package/src/hooks/useReqraftProperty.ts +0 -16
  679. package/src/hooks/useStorage/useStorage.stories.tsx +0 -168
  680. package/src/hooks/useStorage/useStorage.ts +0 -35
  681. package/src/hooks/useTemplates.ts +0 -123
  682. package/src/hooks/useValidation.ts +0 -9
  683. package/src/hooks/useWebSocket/useWebSocket.ts +0 -224
  684. package/src/hooks/useWebSocket/useWebsocket.stories.tsx +0 -640
  685. package/src/hooks/useWhyDidYouUpdate.ts +0 -38
  686. package/src/index.tsx +0 -86
  687. package/src/providers/FetchProvider.tsx +0 -40
  688. package/src/providers/ReqraftProvider.tsx +0 -52
  689. package/src/providers/StorageProvider.tsx +0 -131
  690. package/src/stores/currentUser/currentUser.stories.tsx +0 -100
  691. package/src/stores/currentUser/currentUser.tsx +0 -94
  692. package/src/stories/Data/fileFieldArgSchema.json +0 -86
  693. package/src/stories/Tests/utils.ts +0 -320
  694. package/src/stories/storyNetwork.ts +0 -92
  695. package/src/stories/tracking.tsx +0 -206
  696. package/src/tracking/browser/attach.ts +0 -186
  697. package/src/tracking/browser/env.ts +0 -78
  698. package/src/tracking/core/consent.ts +0 -37
  699. package/src/tracking/core/engagement.ts +0 -47
  700. package/src/tracking/core/experiments.ts +0 -258
  701. package/src/tracking/core/hash.ts +0 -26
  702. package/src/tracking/core/ids.ts +0 -25
  703. package/src/tracking/core/observable.ts +0 -23
  704. package/src/tracking/core/queue.ts +0 -131
  705. package/src/tracking/core/sections.ts +0 -166
  706. package/src/tracking/core/storage.ts +0 -69
  707. package/src/tracking/core/tracker.ts +0 -417
  708. package/src/tracking/core/types.ts +0 -162
  709. package/src/tracking/core/utm.ts +0 -23
  710. package/src/tracking/index.ts +0 -72
  711. package/src/tracking/markup.ts +0 -17
  712. package/src/tracking/react/Experiment.tsx +0 -44
  713. package/src/tracking/react/TrackingProvider.tsx +0 -56
  714. package/src/tracking/react/hooks.ts +0 -106
  715. package/src/tracking/react/index.ts +0 -13
  716. package/src/tracking/testing.ts +0 -108
  717. package/src/tracking/ui/ExperimentCard.stories.tsx +0 -296
  718. package/src/tracking/ui/ExperimentCard.tsx +0 -667
  719. package/src/tracking/ui/ExperimentsOverlay.stories.tsx +0 -155
  720. package/src/tracking/ui/ExperimentsOverlay.tsx +0 -437
  721. package/src/tracking/ui/anchor.ts +0 -180
  722. package/src/tracking/ui/card.ts +0 -464
  723. package/src/tracking/ui/client.ts +0 -117
  724. package/src/tracking/ui/index.ts +0 -77
  725. package/src/tracking/ui/types.ts +0 -110
  726. package/src/tracking/ui/useExperimentsAdmin.ts +0 -103
  727. package/src/types/Form.ts +0 -29
  728. package/src/types.ts +0 -14
  729. package/src/utils/datetime.ts +0 -10
  730. package/src/utils/fetch.ts +0 -457
  731. package/src/utils/lspClient.ts +0 -711
  732. package/src/utils/lspClient.types.ts +0 -211
  733. package/src/utils/queryUnlessCancelled.ts +0 -28
  734. package/src/utils/websocket.ts +0 -293
  735. package/vite.config.ts +0 -58
  736. package/vitest.config.ts +0 -69
@@ -1,1395 +0,0 @@
1
- import { ReqoreButton } from '@qoretechnologies/reqore';
2
- import type { IReqoreEffect } from '@qoretechnologies/reqore/dist/components/Effect';
3
- import { StoryObj } from '@storybook/react-vite';
4
- import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
5
- import { useEffect, useMemo, useState } from 'react';
6
-
7
- import { storyApiUrl } from '../../../stories/storyNetwork';
8
- import { StoryMeta } from '../../../types';
9
- import { FormEngine } from '../engine/FormEngine';
10
- import { dpqlMockParseCalls } from './dpqlMockLsp';
11
- import { ExpressionField } from './ExpressionField';
12
- import { mockExpressions } from './mockExpressions';
13
- import { IExpression } from './types';
14
-
15
- /** The IDE's AI-assist button, as it renders on every expression card there
16
- * (qorus-ide `src/components/AiButton` + `src/constants/effects.ts`
17
- * `SynthColorEffect`, resolved): a `ReqoreButton` carrying the Qorus AI
18
- * gradient. Only the click is stubbed — the real one opens a Qonsole session,
19
- * which is the IDE's to own and the reason the seam exists. */
20
- const IDE_AI_BUTTON_EFFECT: IReqoreEffect = {
21
- gradient: {
22
- colors: { 0: '#13163a', 100: '#5c1976' },
23
- animate: 'hover',
24
- animationSpeed: 5,
25
- },
26
- };
27
-
28
- /** A stable `onChange` for stories that own their value themselves. */
29
- const noopChange = (): void => undefined;
30
-
31
- const SAMPLE: IExpression = {
32
- is_expression: true,
33
- value: {
34
- exp: '==',
35
- args: [
36
- { type: 'string', value: '$local:name' },
37
- { type: 'string', value: 'John' },
38
- ],
39
- },
40
- };
41
-
42
- const meta = {
43
- component: ExpressionField,
44
- title: 'Components/Form/Expressions/ExpressionField',
45
- parameters: {
46
- mockData: [
47
- {
48
- url: storyApiUrl('system?action=expressions&context=ui'),
49
- method: 'GET',
50
- status: 200,
51
- response: mockExpressions,
52
- },
53
- ],
54
- },
55
- args: {
56
- onChange: fn(),
57
- expressions: mockExpressions,
58
- },
59
- render(args) {
60
- const [value, setValue] = useState<IExpression | undefined>(args.value);
61
- return (
62
- <ExpressionField
63
- {...args}
64
- value={value}
65
- onChange={(v) => {
66
- args.onChange?.(v);
67
- setValue(v);
68
- }}
69
- />
70
- );
71
- },
72
- } as StoryMeta<typeof ExpressionField>;
73
-
74
- export default meta;
75
- type Story = StoryObj<typeof meta>;
76
-
77
- /** The DPQL editor overlays "Connecting to language server…" / "Loading
78
- * schema…" while its LSP session starts — a snapshot must never catch that
79
- * transient, so every Text-mode play ends by waiting the overlay out. */
80
- const waitForLspIdle = (canvasElement: HTMLElement) =>
81
- waitFor(
82
- () => {
83
- expect(canvasElement.querySelector('[contenteditable="true"]')).toBeInTheDocument();
84
- expect(canvasElement.textContent).not.toContain('Connecting to language server');
85
- expect(canvasElement.textContent).not.toContain('Loading schema');
86
- },
87
- { timeout: 10000 }
88
- );
89
-
90
- /** The shell with a populated expression — the Visual/Text mode toggle. */
91
- export const Default: Story = {
92
- args: {
93
- value: SAMPLE,
94
- },
95
- parameters: {
96
- docs: {
97
- description: {
98
- story:
99
- 'Renders ExpressionField holding a "$local:name == John" expression — the Visual builder shows the Logical Equals operator with its two operands and the Visual/Text mode toggle.',
100
- },
101
- },
102
- },
103
- async play({ canvasElement }) {
104
- const canvas = within(canvasElement);
105
-
106
- // Visual mode renders the ported builder (with its own Explain); the shell
107
- // adds only the Visual/Text toggle.
108
- await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
109
- timeout: 6000,
110
- });
111
- await expect(await canvas.findByText('Logical Equals')).toBeInTheDocument();
112
- },
113
- };
114
-
115
- /**
116
- * Empty expression — an empty AST renders no "Preview" box at all (nothing to
117
- * parse), just the bare editor waiting for input.
118
- */
119
- export const Empty: Story = {
120
- args: {
121
- value: { is_expression: true, value: { args: [] } },
122
- defaultMode: 'text',
123
- },
124
- parameters: {
125
- docs: {
126
- description: {
127
- story:
128
- 'Renders ExpressionField in Text mode with an empty expression AST — only the DPQL editor shows; the "Preview" box stays hidden until there is something to show.',
129
- },
130
- },
131
- },
132
- async play({ canvasElement }) {
133
- const canvas = within(canvasElement);
134
- await waitForLspIdle(canvasElement);
135
- /* An empty query has nothing to render — no Preview box.
136
- The testid is the assertion that matters: after the rename a
137
- `queryByText('Parsed')` would be null whatever the box did, and an
138
- assertion that cannot fail is worse than no assertion. */
139
- await expect(canvas.queryByTestId('expression-preview')).toBeNull();
140
- await expect(canvas.queryByText('Preview')).toBeNull();
141
- },
142
- };
143
-
144
- /**
145
- * The round-trip: a `FormEngine` field with `supports_expressions` whose
146
- * stored value is an expression (`{ type, value:<AST>, is_expression:true }`)
147
- * renders the `ExpressionField` shell (FormEngine sets
148
- * `allowTextExpressions` on TemplateField) — Visual mode shows the ported
149
- * builder, and the Visual/Text toggle is present.
150
- */
151
- /**
152
- * The seam a host actually reaches. The builder's own `WithInjectedExtraActions`
153
- * story proves the `extraActions` slot on `&&` / `||` group children, which the
154
- * group recursion forwards; this one proves the two hops that used to drop it —
155
- * the shell hosts mount, and an operand that is itself an expression (rendered
156
- * through an operand `TemplateField`, not the group recursion).
157
- */
158
- export const NestedOperandKeepsInjectedActions: Story = {
159
- args: {
160
- value: {
161
- is_expression: true,
162
- value: {
163
- exp: 'contains',
164
- args: [
165
- { type: 'string', value: '$local:input' },
166
- {
167
- is_expression: true,
168
- value: {
169
- exp: 'contains',
170
- args: [
171
- { type: 'string', value: '$local:other' },
172
- { type: 'string', value: 'es' },
173
- ],
174
- },
175
- },
176
- ],
177
- },
178
- },
179
- extraActions: () => [
180
- {
181
- as: ReqoreButton,
182
- props: {
183
- icon: 'ChatAiFill',
184
- fixed: true,
185
- compact: true,
186
- minimal: true,
187
- transparent: true,
188
- effect: IDE_AI_BUTTON_EFFECT,
189
- className: 'expression-ai-assist',
190
- onClick: fn(),
191
- },
192
- // Always visible here, unlike the IDE's hover-revealed original: the
193
- // point of this story is to count which cards received the seam, and
194
- // hovering a nested card bubbles to the outer one, which would make a
195
- // hover-gated count ambiguous (and put a hover popover in the snapshot).
196
- show: true,
197
- size: 'tiny',
198
- },
199
- ],
200
- },
201
- parameters: {
202
- docs: {
203
- description: {
204
- story:
205
- 'Renders ExpressionField holding a String Contains expression whose second operand is itself a String Contains expression, with an extraActions factory that injects an AI-assist button per card. Both cards show the injected action, the nested operand\'s included.',
206
- },
207
- },
208
- },
209
- play: async () => {
210
- const cards = () => document.querySelectorAll('.expression');
211
- // Outer card plus the nested operand's card. The nested builder fetches
212
- // the (mocked) catalogue on its own, so it mounts a beat after the outer.
213
- await waitFor(() => expect(cards().length).toBe(2), { timeout: 10000 });
214
-
215
- // Scoped to the NESTED card, so the outer card's action cannot satisfy it.
216
- await waitFor(() =>
217
- expect(cards()[1].querySelector('.expression-ai-assist')).toBeInTheDocument()
218
- );
219
- // And the seam reached every card, not just one.
220
- expect(document.querySelectorAll('.expression-ai-assist').length).toBe(2);
221
- },
222
- };
223
-
224
- export const ViaFormEngine: Story = {
225
- parameters: {
226
- docs: {
227
- description: {
228
- story:
229
- 'Renders a FormEngine schema with a bool option that carries supports_expressions and a stored expression value — the engine routes through TemplateField and mounts the ExpressionField shell with the Visual builder and the Visual/Text toggle.',
230
- },
231
- },
232
- },
233
- render: () => {
234
- const [value, setValue] = useState<any>({
235
- condition: { type: 'bool', value: SAMPLE.value, is_expression: true },
236
- });
237
- return (
238
- <FormEngine
239
- name='exprForm'
240
- options={
241
- {
242
- condition: {
243
- type: 'bool',
244
- ui_type: 'bool',
245
- display_name: 'Condition',
246
- preselected: true,
247
- supports_expressions: true,
248
- expressions: mockExpressions,
249
- },
250
- } as any
251
- }
252
- value={value}
253
- onChange={(_n, v) => setValue(v)}
254
- />
255
- );
256
- },
257
- async play({ canvasElement }) {
258
- const canvas = within(canvasElement);
259
- // The ported builder rendered inside the engine-driven form.
260
- await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
261
- timeout: 6000,
262
- });
263
- await expect(await canvas.findByText('Logical Equals')).toBeInTheDocument();
264
- // The ExpressionField shell wraps it: the Visual/Text toggle is present.
265
- await expect(await canvas.findByText('Visual')).toBeInTheDocument();
266
- await expect(canvas.getByText('Text')).toBeInTheDocument();
267
- // A valid expression is validated as an expression, not as the base
268
- // `bool` type — no "must be True or False" error.
269
- await expect(canvas.queryByText(/True or False/)).not.toBeInTheDocument();
270
- },
271
- };
272
-
273
- /**
274
- * FormEngine → Text mode, the serialize direction: switching the
275
- * engine-driven expression field to Text seeds the DPQL editor from the
276
- * stored AST (`dpql/serialize` over the mock LSP) and the "Preview" box
277
- * renders the same AST.
278
- */
279
- export const ViaFormEngineTextMode: Story = {
280
- parameters: {
281
- docs: {
282
- description: {
283
- story:
284
- 'Renders the FormEngine expression field, then switches to Text mode — the DPQL editor seeds from the stored AST via the mock LSP\'s dpql/serialize call, highlighted like typed text. The server\'s rendering reads exactly as that text, so no "Preview" box repeats it.',
285
- },
286
- },
287
- },
288
- render: ViaFormEngine.render,
289
- async play({ canvasElement }) {
290
- const canvas = within(canvasElement);
291
-
292
- // Visual (the builder) renders first.
293
- await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
294
- timeout: 6000,
295
- });
296
-
297
- // Switch to Text — the DPQL editor mounts and seeds from the AST
298
- // (`dpql/serialize` over the mock LSP).
299
- await userEvent.click(await canvas.findByText('Text'));
300
- const editable = (await waitFor(
301
- () => {
302
- const el = canvasElement.querySelector('[contenteditable="true"]');
303
- if (!el) throw new Error('editor not ready');
304
- return el as HTMLElement;
305
- },
306
- { timeout: 10000 }
307
- )) as HTMLElement;
308
- // The template ref renders as a chip ("local: name" + zero-width marks)
309
- // and the literal gets quoted — assert the seeded content, not raw DPQL.
310
- await waitFor(
311
- () => {
312
- expect(editable.textContent).toMatch(/local:?\s*name/);
313
- expect(editable.textContent).toContain('John');
314
- },
315
- { timeout: 10000 }
316
- );
317
- // …and highlighted: the server colours its own copy of the text, which it
318
- // only holds if a value SET after mount reaches it as well as typing does.
319
- await waitFor(
320
- () => {
321
- const literal = Array.from(editable.querySelectorAll<HTMLElement>('span[style]')).find(
322
- (span) => span.textContent === '"John"' && !!span.style.color
323
- );
324
- expect(literal, 'the seeded text is coloured by the server').toBeTruthy();
325
- },
326
- { timeout: 10000 }
327
- );
328
- /* The server renders `$local:name == "John"`, which reads exactly as the
329
- text above it — the chip draws over the quotes — so there is no Preview. */
330
- await waitFor(
331
- () =>
332
- expect(canvasElement.querySelector('.expression-field')?.getAttribute('data-preview')).toBe(
333
- 'repeats'
334
- ),
335
- { timeout: 10000 }
336
- );
337
- await expect(canvas.queryByTestId('expression-preview')).toBeNull();
338
- await waitForLspIdle(canvasElement);
339
- },
340
- };
341
-
342
- /**
343
- * FormEngine → Text mode, the parse direction: typing DPQL into an (empty)
344
- * engine-driven expression field parses to the AST (`dpql/parse` over the
345
- * mock LSP) and lands in the form value with `is_expression` — the 4-arg
346
- * `isFunction` onChange flow end-to-end. (Typing starts from an empty
347
- * expression: synthetic keystrokes only land in an empty Slate document;
348
- * the seeded direction is covered by `ViaFormEngineTextMode` above.)
349
- */
350
- export const ViaFormEngineTextTyping: Story = {
351
- parameters: {
352
- docs: {
353
- description: {
354
- story:
355
- "Renders the FormEngine expression field with an empty AST in Text mode. Typing DPQL text triggers the mock LSP's dpql/parse and the parsed expression lands in the form value with is_expression set.",
356
- },
357
- },
358
- },
359
- render: (args) => {
360
- const [value, setValue] = useState<any>({
361
- condition: { type: 'bool', value: { args: [] }, is_expression: true },
362
- });
363
- return (
364
- <FormEngine
365
- name='exprForm'
366
- options={
367
- {
368
- condition: {
369
- type: 'bool',
370
- ui_type: 'bool',
371
- display_name: 'Condition',
372
- preselected: true,
373
- supports_expressions: true,
374
- expressions: mockExpressions,
375
- },
376
- } as any
377
- }
378
- value={value}
379
- onChange={(_n, v) => {
380
- args.onChange?.(v as any);
381
- setValue(v);
382
- }}
383
- />
384
- );
385
- },
386
- async play({ canvasElement, args }) {
387
- const canvas = within(canvasElement);
388
-
389
- // Switch the form field to Text — empty expression, so the editor
390
- // starts blank.
391
- await userEvent.click(await canvas.findByText('Text'));
392
- const editable = (await waitFor(
393
- () => {
394
- const el = canvasElement.querySelector('[contenteditable="true"]');
395
- if (!el) throw new Error('editor not ready');
396
- return el as HTMLElement;
397
- },
398
- { timeout: 10000 }
399
- )) as HTMLElement;
400
-
401
- // Type DPQL — the debounced `dpql/parse` (mock echoes the text into an
402
- // `==` AST) flows through TemplateField's `handleExpressionChange` into
403
- // FormEngine's 4-arg `handleValueChange`.
404
- await userEvent.click(editable);
405
- await userEvent.type(editable, 'name');
406
-
407
- await waitFor(
408
- () => {
409
- const calls = (args.onChange as ReturnType<typeof fn>).mock.calls;
410
- const last = calls[calls.length - 1]?.[0] as any;
411
- expect(last?.condition?.is_expression).toBe(true);
412
- },
413
- { timeout: 10000 }
414
- );
415
- await waitFor(() => expect(canvas.getByTestId('expression-preview')).toBeInTheDocument(), {
416
- timeout: 10000,
417
- });
418
- await waitForLspIdle(canvasElement);
419
- },
420
- };
421
-
422
- /**
423
- * A field's declared type travels with every parse, and the answer is shown
424
- * only where there is something to decide.
425
- *
426
- * The mock returns type analysis ONLY when the request carried a
427
- * `target_type`, exactly as the server does - so these stories fail if the
428
- * field stops sending it, rather than passing on a fixture.
429
- */
430
- /* `text` is per-story, and that is not cosmetic. `DpqlProbe` caches parse
431
- results in a session-wide singleton keyed by the TEXT ALONE, so two stories
432
- typing the same string share one answer: the second gets a cache HIT, sends
433
- no request at all, and is handed the answer computed for the OTHER field's
434
- type. That is order-dependent, so it passed locally and failed on CI, where
435
- the two ran the other way round — and the instrumentation proved it by
436
- reporting `parses=[]` for a field that was nonetheless showing a parsed
437
- value. Distinct text per story keeps them independent. */
438
- const typedExpressionStory = (
439
- fieldType: string,
440
- text: string,
441
- description: string,
442
- expectation: (canvasElement: HTMLElement) => Promise<void>
443
- ): Story => ({
444
- parameters: {
445
- docs: { description: { story: description } },
446
- },
447
- render: () => {
448
- const [value, setValue] = useState<any>({
449
- amount: { type: fieldType, value: { args: [] }, is_expression: true },
450
- });
451
- return (
452
- <FormEngine
453
- name='typedExprForm'
454
- options={
455
- {
456
- amount: {
457
- type: fieldType,
458
- ui_type: fieldType,
459
- display_name: 'Amount',
460
- preselected: true,
461
- supports_expressions: true,
462
- expressions: mockExpressions,
463
- },
464
- } as any
465
- }
466
- value={value}
467
- onChange={(_n, v) => setValue(v)}
468
- />
469
- );
470
- },
471
- async play({ canvasElement }) {
472
- const canvas = within(canvasElement);
473
- await userEvent.click(await canvas.findByText('Text'));
474
- const editable = (await waitFor(
475
- () => {
476
- const el = canvasElement.querySelector('[contenteditable="true"]');
477
- if (!el) throw new Error('editor not ready');
478
- return el as HTMLElement;
479
- },
480
- { timeout: 10000 }
481
- )) as HTMLElement;
482
- /* The editor mounting is NOT the same as the language server being ready,
483
- and typing into it before the socket is up loses the parse: no request is
484
- sent, so no `target_type` answer ever comes back and the fit message is
485
- never rendered. That is a race, not a slow response — raising the
486
- expectation's timeout would not have helped.
487
-
488
- It cost a red CI run that was green locally, where the mock connects
489
- immediately. Worse, it is silent in the sibling story: one that asserts
490
- the ABSENCE of the message passes for the wrong reason under exactly the
491
- same race. */
492
- await waitForLspIdle(canvasElement);
493
- await userEvent.click(editable);
494
- await userEvent.type(editable, text);
495
- await expectation(canvasElement);
496
- await waitForLspIdle(canvasElement);
497
- },
498
- });
499
-
500
- /**
501
- * Text used as a number: the conversion is attempted, not guaranteed, so the
502
- * field says so and offers the conversion. The value itself is checked again
503
- * server-side when the expression actually runs.
504
- */
505
- export const TextModeTypeMayNotFit: Story = typedExpressionStory(
506
- 'int',
507
- '"a" + 1',
508
- 'Types `"a" + 1` into the Text view of an int field. The expression returns text, so the field warns "This may not fit" and offers the `toInt(…)` conversion.',
509
- async (canvasElement) => {
510
- /* Matched against the rendered TEXT, not with `getByText`. `ReqoreMessage`
511
- renders its title through nested nodes, so an exact single-element match
512
- reports "unable to find" for a message that is demonstrably on screen —
513
- the very failure testing-library's own error describes ("the text is
514
- broken up by multiple elements"). A unit test against this component
515
- reproduced that directly: the container held the title, the message and
516
- the fix chip, and `getByText` still could not find it.
517
-
518
- The assertion stays meaningful: the title has to be present AND the
519
- suggested conversion has to be the one for this field's type. */
520
- /* The assertion carries the diagnosis with it. A DOM dump is truncated by
521
- testing-library and a `console.log` does not reliably reach a CI log, but
522
- a custom matcher message always does — and the one thing worth knowing
523
- here is whether the front end SENT `target_type` at all, because the mock
524
- answers with analysis only when it did. Without this the failure looks
525
- identical whether the request lacked a target or the answer went
526
- unrendered. */
527
- const why = () =>
528
- `parses=${JSON.stringify(dpqlMockParseCalls)} text=${JSON.stringify(
529
- (canvasElement.textContent || '').slice(0, 400)
530
- )}`;
531
- await waitFor(
532
- () => {
533
- expect(canvasElement.textContent, why()).toContain('This may not fit');
534
- expect(
535
- canvasElement.querySelector('[data-testid="expression-type-fix"]')?.textContent,
536
- why()
537
- ).toContain('toInt(');
538
- },
539
- { timeout: 10000 }
540
- );
541
- }
542
- );
543
-
544
- /**
545
- * Text used as text needs no conversion at all, so nothing is said. A warning
546
- * here would be noise, and noise is what teaches people to ignore the
547
- * warnings that matter.
548
- */
549
- export const TextModeTypeFits: Story = typedExpressionStory(
550
- 'string',
551
- '"a" + "b"',
552
- 'Types `"a" + "b"` into the Text view of a string field. The expression already returns text, so no fit message is shown.',
553
- async (canvasElement) => {
554
- /* Settled when the server has analysed the WHOLE text against this field's
555
- type — not when a Preview appears, which is shown only when the rendering
556
- differs from what was typed and so says nothing about the analysis. */
557
- await waitFor(
558
- () =>
559
- expect(
560
- dpqlMockParseCalls.some((call) => call.text === '"a" + "b"' && call.target === 'string'),
561
- `parses=${JSON.stringify(dpqlMockParseCalls)}`
562
- ).toBe(true),
563
- { timeout: 10000 }
564
- );
565
- await waitForLspIdle(canvasElement);
566
- /* Absence, checked against the rendered text for the same reason its sibling
567
- checks presence that way: `queryByText` returns null for a message that IS
568
- on screen but split across nodes, so it would report "no warning" whether
569
- or not one was drawn — passing for the wrong reason is worse here than
570
- failing, because absence is the whole claim. */
571
- expect(canvasElement.textContent).not.toContain('This may not fit');
572
- expect(canvasElement.textContent).not.toContain('This does not fit');
573
- }
574
- );
575
-
576
- /**
577
- * An `auto` field accepts anything, so there is nothing to check the
578
- * expression's return type against and no target is sent at all.
579
- *
580
- * This is not a hypothetical. An expression VALUE is
581
- * `{ is_expression: true, value: {...} }` — a hash whatever the expression
582
- * computes — and the auto field used to infer its type from that envelope, so
583
- * writing an expression made the field decide it held a `hash`. That inferred
584
- * type was then handed back as the return type to check against, and `1 + 2`
585
- * was rejected on a test assertion's Value with "The expression returns int,
586
- * and this field holds hash": the field disagreeing with itself about a value
587
- * the author had just written.
588
- */
589
- export const TextModeAutoAsksNothing: Story = typedExpressionStory(
590
- 'auto',
591
- '1 + 2',
592
- 'Types `1 + 2` into the Text view of an `auto` field. The field accepts any result, so no return type is sent to the server and no fit message is shown.',
593
- async (canvasElement) => {
594
- await waitFor(
595
- () => {
596
- expect(canvasElement.querySelector('[contenteditable="true"]')).toBeTruthy();
597
- },
598
- { timeout: 10000 }
599
- );
600
- /* The contract, not just the symptom: the mock answers with analysis only
601
- when a target was sent, so asserting the MESSAGE is absent would also
602
- pass if the request simply never happened. Assert what was asked. */
603
- await waitFor(
604
- () => {
605
- expect(
606
- dpqlMockParseCalls.length,
607
- `parses=${JSON.stringify(dpqlMockParseCalls)}`
608
- ).toBeGreaterThan(0);
609
- },
610
- { timeout: 10000 }
611
- );
612
- expect(
613
- dpqlMockParseCalls.every((call) => !call.target),
614
- `an auto field must send no target_type: ${JSON.stringify(dpqlMockParseCalls)}`
615
- ).toBe(true);
616
- expect(canvasElement.textContent).not.toContain('This does not fit');
617
- expect(canvasElement.textContent).not.toContain('This may not fit');
618
- }
619
- );
620
-
621
- /**
622
- * Text (DPQL) mode, backed by a mock-socket LSP. Typing DPQL parses to the
623
- * AST (`dpql/parse`); the "Preview" box reflects it. (Slate typing is
624
- * driven live; the play test asserts the editor mounted + connected.)
625
- */
626
- export const TextMode: Story = {
627
- args: {
628
- value: { is_expression: true, value: { args: [] } },
629
- defaultMode: 'text',
630
- },
631
- parameters: {
632
- docs: {
633
- description: {
634
- story:
635
- 'Renders ExpressionField in Text (DPQL) mode over a mock-socket LSP. Typing DPQL text triggers dpql/parse and the "Preview" box reflects the resulting AST.',
636
- },
637
- },
638
- },
639
- async play({ canvasElement }) {
640
- const canvas = within(canvasElement);
641
- const editable = (await waitFor(
642
- () => {
643
- const el = canvasElement.querySelector('[contenteditable="true"]');
644
- if (!el) throw new Error('editor not ready');
645
- return el as HTMLElement;
646
- },
647
- { timeout: 6000 }
648
- )) as HTMLElement;
649
-
650
- // Type DPQL → debounced `dpql/parse` → AST → the "Preview" box
651
- // reflects it (the mock echoes the typed text into an `==` expression).
652
- await userEvent.click(editable);
653
- await userEvent.type(editable, 'name');
654
- await waitFor(
655
- () => expect(canvas.getByTestId('expression-preview').textContent).toContain('name'),
656
- { timeout: 6000 }
657
- );
658
- await waitForLspIdle(canvasElement);
659
- },
660
- };
661
-
662
- /**
663
- * A plain `bool` field with `supports_expressions` and no value — starts as
664
- * the normal field; the "Use Expression" toggle (More menu) switches it.
665
- * Driven live for the toggle interaction.
666
- */
667
- export const ToggleInFormEngine: Story = {
668
- parameters: {
669
- docs: {
670
- description: {
671
- story:
672
- 'Renders a FormEngine schema with a plain bool option (supports_expressions, no value). Clicking More then "Use Expression" flips the field to expression mode and the ExpressionField shell with the Visual builder mounts in place of the checkbox.',
673
- },
674
- },
675
- },
676
- render: () => {
677
- const [value, setValue] = useState<any>({});
678
- return (
679
- <FormEngine
680
- name='exprToggle'
681
- options={
682
- {
683
- flag: {
684
- type: 'bool',
685
- ui_type: 'bool',
686
- display_name: 'Flag',
687
- preselected: true,
688
- supports_expressions: true,
689
- expressions: mockExpressions,
690
- },
691
- } as any
692
- }
693
- value={value}
694
- onChange={(_n, v) => setValue(v)}
695
- />
696
- );
697
- },
698
- async play({ canvasElement }) {
699
- const canvas = within(canvasElement);
700
-
701
- // Starts as the normal bool field — its "More" menu (TemplateField's
702
- // `.template-more`) is the entry point to expression mode.
703
- const more = (await waitFor(
704
- () => {
705
- const el = canvasElement.querySelector('.template-more') as HTMLElement | null;
706
- if (!el) throw new Error('More menu not ready');
707
- return el;
708
- },
709
- { timeout: 6000 }
710
- )) as HTMLElement;
711
- await userEvent.click(more);
712
-
713
- // "Use Expression" (`.function-selector`) flips the field into expression
714
- // mode.
715
- await userEvent.click(await canvas.findByText('Use Expression'));
716
-
717
- // The ExpressionField shell mounts: its `.expression-field` wrapper, the
718
- // ported builder (`.expression`), and the Visual/Text toggle.
719
- await waitFor(
720
- () => {
721
- expect(canvasElement.querySelector('.expression-field')).toBeInTheDocument();
722
- expect(canvasElement.querySelector('.expression')).toBeInTheDocument();
723
- },
724
- { timeout: 6000 }
725
- );
726
- await expect(await canvas.findByText('Visual')).toBeInTheDocument();
727
- },
728
- };
729
-
730
- /**
731
- * Wait for the DOM to stop changing.
732
- *
733
- * Both stories below assert a NEGATIVE — that the view the author was put in
734
- * is not swapped out from under them — and a swap lands a render or two after
735
- * the interaction that causes it. `waitFor` is therefore no help at all: it
736
- * passes on the transient state BEFORE the swap and proves nothing. Settling
737
- * on the DOM going quiet is what makes the assertion mean something.
738
- */
739
- const settle = (root: HTMLElement, quietMs = 400): Promise<void> =>
740
- new Promise<void>((resolve) => {
741
- let quiet: ReturnType<typeof setTimeout>;
742
- const stop = (): void => {
743
- observer.disconnect();
744
- resolve();
745
- };
746
- const observer = new MutationObserver(() => {
747
- clearTimeout(quiet);
748
- quiet = setTimeout(stop, quietMs);
749
- });
750
- observer.observe(root, {
751
- attributes: true,
752
- characterData: true,
753
- childList: true,
754
- subtree: true,
755
- });
756
- quiet = setTimeout(stop, quietMs);
757
- });
758
-
759
- /** Open a compact row — a read-first row shows its label, not its editor. */
760
- const openCompactRow = async (canvasElement: HTMLElement): Promise<void> => {
761
- const label = (await waitFor(
762
- () => {
763
- const el = within(canvasElement).queryByText('Value');
764
- if (!el) throw new Error('row not rendered');
765
- return el as HTMLElement;
766
- },
767
- { timeout: 10000 }
768
- )) as HTMLElement;
769
- if (!canvasElement.querySelector('input[type="text"], textarea, [contenteditable="true"]')) {
770
- await userEvent.click(label);
771
- }
772
- };
773
-
774
- /**
775
- * Type an expression into a plain field, accept the offer, and assert the
776
- * shell opens on TEXT and stays there.
777
- *
778
- * Shared so that each story below differs only in the FORM around the field —
779
- * which is the variable under test, the plain engine being healthy and the
780
- * arrangements a real consumer builds being the ones that break it.
781
- */
782
- const acceptTypedExpression = async (canvasElement: HTMLElement): Promise<void> => {
783
- const input = (await waitFor(
784
- () => {
785
- const el = canvasElement.querySelector(
786
- 'input[type="text"], textarea, [contenteditable="true"]'
787
- );
788
- if (!el) throw new Error('field not ready');
789
- return el as HTMLElement;
790
- },
791
- { timeout: 10000 }
792
- )) as HTMLElement;
793
-
794
- await userEvent.click(input);
795
- await userEvent.type(input, '1 + 2');
796
-
797
- // The offer appears only after the server (here the mock) has said the text
798
- // really is an expression — a successful parse alone means nothing.
799
- const offer = (await waitFor(
800
- () => {
801
- const el = canvasElement.querySelector('.dpql-detected-offer');
802
- if (!el) throw new Error('offer not made');
803
- return el as HTMLElement;
804
- },
805
- { timeout: 10000 }
806
- )) as HTMLElement;
807
-
808
- await userEvent.click(offer);
809
-
810
- await waitFor(() => expect(canvasElement.querySelector('.expression-field')).toBeInTheDocument(), {
811
- timeout: 10000,
812
- });
813
-
814
- await settle(canvasElement);
815
-
816
- // Text, not Visual: the DPQL editor is mounted and the builder is not.
817
- const editable = canvasElement.querySelector(
818
- '.expression-field [contenteditable="true"]'
819
- ) as HTMLElement | null;
820
- expect(editable).toBeInTheDocument();
821
- expect(canvasElement.querySelector('.expression-field .expression')).not.toBeInTheDocument();
822
-
823
- /* And it holds the author's own sentence.
824
- *
825
- * Landing in Text mode with an EMPTY editor is barely better than landing in
826
- * the builder: what the author typed is not on screen either way, and a
827
- * Preview of it sitting beside an empty box reads as the text having been
828
- * thrown away. The AST reaches this shell one render after the mode does, so
829
- * this is exactly the assertion that fails when seeding only ever gets one
830
- * turn. */
831
- await waitFor(() => expect(editable?.textContent).toContain('1 + 2'), { timeout: 10000 });
832
- };
833
-
834
- /**
835
- * Accepting "Use as expression" lands in TEXT mode, and STAYS there.
836
- *
837
- * An author who typed `1 + 2` into a plain field and accepted the offer is
838
- * already writing in that language: `TemplateField` hands the shell
839
- * `defaultMode='text'` for exactly that reason. Landing them in the visual
840
- * builder instead makes them find their own sentence again — and the sentence
841
- * they typed is not shown anywhere, because the builder renders operands, not
842
- * text.
843
- *
844
- * The whole path is covered deliberately: the offer is the ONLY entry that
845
- * asks for Text mode, so a story that enters expression mode through the More
846
- * menu (`ToggleInFormEngine`) cannot guard it — that route never sets
847
- * `expressionFromText` and correctly lands on Visual.
848
- */
849
- export const OfferAcceptedOpensTextMode: Story = {
850
- parameters: {
851
- docs: {
852
- description: {
853
- story:
854
- 'Types DPQL into a plain string field, accepts the "Use as expression" offer, and asserts the expression shell opens on Text (the DPQL editor seeded with the typed text) rather than on the visual builder — and stays there once the DOM settles.',
855
- },
856
- },
857
- },
858
- render: () => {
859
- const [value, setValue] = useState<any>({});
860
- return (
861
- <FormEngine
862
- name='dpqlOfferForm'
863
- options={
864
- {
865
- expected: {
866
- type: 'string',
867
- ui_type: 'string',
868
- display_name: 'Value',
869
- preselected: true,
870
- supports_expressions: true,
871
- expressions: mockExpressions,
872
- },
873
- } as any
874
- }
875
- value={value}
876
- onChange={(_n, v) => setValue(v)}
877
- />
878
- );
879
- },
880
- async play({ canvasElement }) {
881
- await acceptTypedExpression(canvasElement);
882
- },
883
- };
884
-
885
- /**
886
- * The accepted offer survives a host that rebuilds the field's schema.
887
- *
888
- * A consumer form does not hand the engine one frozen schema. qorus-ide's test
889
- * step drawer derives the schema it passes FROM the current value — a path that
890
- * holds a reference is given the reference editor, a compared value is typed by
891
- * the path it is compared against — so the engine is handed a brand-new options
892
- * object on every change, including the one the accepted offer itself causes.
893
- *
894
- * The offer's whole promise is that the author keeps writing where they were
895
- * writing. If a re-derived schema takes that away, the promise is only kept on
896
- * forms simple enough not to have one, which is not the form this feature was
897
- * built for.
898
- */
899
- export const OfferSurvivesARederivedSchema: Story = {
900
- parameters: {
901
- docs: {
902
- description: {
903
- story:
904
- "Repeats the accepted-offer flow against a host that rebuilds the options schema from the value on every change (as qorus-ide's step drawer does) — the Text view the offer opened must survive the churn.",
905
- },
906
- },
907
- },
908
- render: () => {
909
- const [value, setValue] = useState<any>({});
910
- // Rebuilt from the value, so its identity changes on every edit — the
911
- // host behaviour being modelled.
912
- const options = useMemo(
913
- () =>
914
- ({
915
- expected: {
916
- type: 'string',
917
- ui_type: 'string',
918
- display_name: 'Value',
919
- preselected: true,
920
- supports_expressions: true,
921
- expressions: mockExpressions,
922
- },
923
- }) as any,
924
- [value]
925
- );
926
- return (
927
- <FormEngine
928
- name='dpqlOfferChurnForm'
929
- options={options}
930
- value={value}
931
- onChange={(_n, v) => setValue(v)}
932
- />
933
- );
934
- },
935
- async play({ canvasElement }) {
936
- await acceptTypedExpression(canvasElement);
937
- },
938
- };
939
-
940
- /**
941
- * The accepted offer survives the COMPACT read-first row.
942
- *
943
- * The forms this feature was built for are compact ones — qorus-ide's test step
944
- * drawer renders every option as a read-first row that shows a summary of what
945
- * the field holds and opens onto the editor. Accepting the offer is the moment
946
- * a field that held nothing starts holding something, so it is exactly the
947
- * moment that treatment changes, and the author is inside the control while it
948
- * does.
949
- */
950
- export const OfferSurvivesACompactRow: Story = {
951
- parameters: {
952
- docs: {
953
- description: {
954
- story:
955
- 'Repeats the accepted-offer flow in a compact (read-first) form whose schema is rebuilt from the value — the arrangement qorus-ide uses — and asserts the Text view survives it.',
956
- },
957
- },
958
- },
959
- render: () => {
960
- const [value, setValue] = useState<any>({});
961
- const options = useMemo(
962
- () =>
963
- ({
964
- expected: {
965
- type: 'string',
966
- ui_type: 'string',
967
- display_name: 'Value',
968
- preselected: true,
969
- supports_expressions: true,
970
- expressions: mockExpressions,
971
- },
972
- }) as any,
973
- [value]
974
- );
975
- return (
976
- <FormEngine
977
- name='dpqlOfferCompactForm'
978
- compact
979
- flat
980
- transparent
981
- padded={false}
982
- showTypeToggle={false}
983
- size='small'
984
- options={options}
985
- value={value}
986
- onChange={(_n, v) => setValue(v)}
987
- />
988
- );
989
- },
990
- async play({ canvasElement }) {
991
- await openCompactRow(canvasElement);
992
- await acceptTypedExpression(canvasElement);
993
- },
994
- };
995
-
996
- /**
997
- * The Text view survives the host answering LATE about the field.
998
- *
999
- * A consumer does not settle a row's schema the moment it is drawn. qorus-ide
1000
- * re-derives these rows from catalogues it is still fetching — the type a
1001
- * compared value gets is read off the reference it is compared against — so the
1002
- * type a row was OPENED with is not always the type it ends up with, and the
1003
- * change can land a second or two after the author has already acted.
1004
- *
1005
- * That is the reported symptom this covers, and it is the one that made the bug
1006
- * look intermittent rather than reproducible: clicking Text appeared to work,
1007
- * and then a moment later the control was back on Visual with nothing on screen
1008
- * to say why.
1009
- */
1010
- export const TextViewSurvivesALateHostChange: Story = {
1011
- parameters: {
1012
- docs: {
1013
- description: {
1014
- story:
1015
- "Accepts the offer in a compact row, then has the host re-type the field a moment later (as qorus-ide does when its reference catalogue answers) — the Text view must not be swapped out from under the author.",
1016
- },
1017
- },
1018
- },
1019
- render: () => {
1020
- const [value, setValue] = useState<any>({});
1021
- const [retyped, setRetyped] = useState(false);
1022
- // Fires once the field is holding an expression: the host's answer lands
1023
- // after the author has already accepted the offer.
1024
- const isExpression = !!value?.expected?.is_expression;
1025
- useEffect(() => {
1026
- if (!isExpression) return undefined;
1027
- const timer = setTimeout(() => setRetyped(true), 500);
1028
- return () => clearTimeout(timer);
1029
- }, [isExpression]);
1030
- const options = useMemo(
1031
- () =>
1032
- ({
1033
- expected: {
1034
- // `auto` is one of the types a compact row opens as a CARD rather
1035
- // than in place, so this is a re-type that moves the editor — the
1036
- // whole point of the exercise.
1037
- type: retyped ? 'auto' : 'string',
1038
- ui_type: retyped ? 'auto' : 'string',
1039
- display_name: 'Value',
1040
- preselected: true,
1041
- supports_expressions: true,
1042
- expressions: mockExpressions,
1043
- },
1044
- }) as any,
1045
- [retyped]
1046
- );
1047
- return (
1048
- /* The host's answer is not otherwise visible, and the assertion has to
1049
- wait for it rather than for a duration. An attribute, not text: a
1050
- printed "true" ended up in the story's snapshot. */
1051
- <div data-host-retyped={String(retyped)}>
1052
- <FormEngine
1053
- name='dpqlOfferLateForm'
1054
- compact
1055
- flat
1056
- transparent
1057
- padded={false}
1058
- showTypeToggle={false}
1059
- size='small'
1060
- options={options}
1061
- value={value}
1062
- onChange={(_n, v) => setValue(v)}
1063
- />
1064
- </div>
1065
- );
1066
- },
1067
- async play({ canvasElement }) {
1068
- await openCompactRow(canvasElement);
1069
- await acceptTypedExpression(canvasElement);
1070
-
1071
- // Wait for the host's late answer to actually land — a timeout here would
1072
- // make the assertion a race.
1073
- await waitFor(
1074
- () => expect(canvasElement.querySelector('[data-host-retyped="true"]')).toBeTruthy(),
1075
- { timeout: 10000 }
1076
- );
1077
- await settle(canvasElement);
1078
-
1079
- expect(
1080
- canvasElement.querySelector('.expression-field [contenteditable="true"]')
1081
- ).toBeInTheDocument();
1082
- expect(canvasElement.querySelector('.expression-field .expression')).not.toBeInTheDocument();
1083
- },
1084
- };
1085
-
1086
- /**
1087
- * The field's own menu stays in the toolbar row.
1088
- *
1089
- * `TemplateField` renders its controls — the More menu that offers "Use
1090
- * Template", and the undo for an accepted offer — as SIBLINGS of the expression
1091
- * shell. Beside an ordinary one-line editor, centring that menu in the flex
1092
- * line is what lines it up with the row's other buttons.
1093
- *
1094
- * The shell is not one line. It is a toolbar with an editor, a type message and
1095
- * a preview stacked under it, so centring put the menu somewhere down the side
1096
- * of that block — level with nothing, overlapping the editor, and a long way
1097
- * from the Undo it belongs beside.
1098
- *
1099
- * Only reachable with templates ON OFFER, which is why the stories above miss
1100
- * it: with nothing to offer the menu is not rendered at all.
1101
- *
1102
- * Inside a form row the field no longer draws that menu itself: it publishes
1103
- * its items into the row's own ⋮ (`rowMenuContext` — one menu per control), so
1104
- * the menu asserted here is the row's, and the field's own must be absent.
1105
- */
1106
- export const FieldMenuStaysInTheToolbar: Story = {
1107
- parameters: {
1108
- docs: {
1109
- description: {
1110
- story:
1111
- "Accepts the offer on a compact row whose field also has templates. The row shows ONE More menu — the field publishes its items into the row's ⋮ rather than drawing its own — and that menu sits in the shell's toolbar row, level with Undo, not part-way down the editor.",
1112
- },
1113
- },
1114
- },
1115
- render: () => {
1116
- const [value, setValue] = useState<any>({});
1117
- return (
1118
- <FormEngine
1119
- name='dpqlOfferToolbarForm'
1120
- compact
1121
- flat
1122
- transparent
1123
- padded={false}
1124
- showTypeToggle={false}
1125
- size='small'
1126
- options={
1127
- {
1128
- expected: {
1129
- type: 'string',
1130
- ui_type: 'string',
1131
- display_name: 'Value',
1132
- preselected: true,
1133
- supports_expressions: true,
1134
- supports_templates: true,
1135
- expressions: mockExpressions,
1136
- templates: {
1137
- items: [
1138
- {
1139
- label: 'Values this case captures',
1140
- items: [{ label: 'Order status', value: '$.order.status', badge: 'string' }],
1141
- },
1142
- ],
1143
- },
1144
- },
1145
- } as any
1146
- }
1147
- value={value}
1148
- onChange={(_n, v) => setValue(v)}
1149
- />
1150
- );
1151
- },
1152
- async play({ canvasElement }) {
1153
- await openCompactRow(canvasElement);
1154
- await acceptTypedExpression(canvasElement);
1155
-
1156
- // One menu per control: the row's ⋮, not a second one drawn by the field.
1157
- expect(canvasElement.querySelector('.template-more')).toBeNull();
1158
- const menus = canvasElement.querySelectorAll('.options-readfirst-more');
1159
- expect(menus).toHaveLength(1);
1160
- const menu = menus[0] as HTMLElement;
1161
-
1162
- // The toolbar row is the shell's first line — the Visual/Text toggle.
1163
- const toggle = within(canvasElement).getByText('Text').closest('button') as HTMLElement;
1164
- const toolbar = toggle.getBoundingClientRect();
1165
- const control = menu.getBoundingClientRect();
1166
-
1167
- /* Reported as numbers: "the menu is in the wrong place" is not something a
1168
- CI log can show, and the two rectangles are the whole story. */
1169
- const where = `toolbar ${Math.round(toolbar.top)}–${Math.round(
1170
- toolbar.bottom
1171
- )}, menu ${Math.round(control.top)}–${Math.round(control.bottom)}`;
1172
-
1173
- // Level with the toolbar: the menu's own centre falls inside that row.
1174
- const centre = control.top + control.height / 2;
1175
- expect(
1176
- centre >= toolbar.top && centre <= toolbar.bottom,
1177
- `the field's More menu should sit in the toolbar row — ${where}`
1178
- ).toBe(true);
1179
- },
1180
- };
1181
-
1182
- /**
1183
- * The Text editor seeds from an AST that arrives AFTER the mode flips.
1184
- *
1185
- * `TemplateField` passes the shell its OWN `value` prop, and on the render
1186
- * that flips the field into expression mode that prop is still the STRING the
1187
- * author typed — the parsed AST only comes back through the host form one
1188
- * render later. So the shell mounts in Text mode with nothing to serialize,
1189
- * and an effect that runs on the mode alone has already had its only turn: the
1190
- * author gets an empty editor with a Preview of an expression sitting beside
1191
- * it, which reads as the text having been thrown away.
1192
- *
1193
- * Modelled here rather than live because it is a pure ordering problem — no
1194
- * instance, no offer, no host form. The late arrival is the whole test.
1195
- */
1196
- export const TextModeSeedsWhenAstArrivesLate: Story = {
1197
- parameters: {
1198
- docs: {
1199
- description: {
1200
- story:
1201
- "Mounts the shell in Text mode with a value that is not yet an AST, then delivers the AST a moment later — the DPQL editor must seed from it rather than stay empty.",
1202
- },
1203
- },
1204
- },
1205
- render: () => {
1206
- const [value, setValue] = useState<IExpression>({
1207
- is_expression: true,
1208
- // What `TemplateField` actually holds at that moment: the typed text.
1209
- value: '1 + 2' as unknown as IExpression['value'],
1210
- });
1211
- useEffect(() => {
1212
- const timer = setTimeout(() => setValue(SAMPLE), 100);
1213
- return () => clearTimeout(timer);
1214
- }, []);
1215
- return (
1216
- <ExpressionField
1217
- value={value}
1218
- onChange={noopChange}
1219
- defaultMode='text'
1220
- expressions={mockExpressions}
1221
- />
1222
- );
1223
- },
1224
- async play({ canvasElement }) {
1225
- const editable = (await waitFor(
1226
- () => {
1227
- const el = canvasElement.querySelector('[contenteditable="true"]');
1228
- if (!el) throw new Error('editor not ready');
1229
- return el as HTMLElement;
1230
- },
1231
- { timeout: 10000 }
1232
- )) as HTMLElement;
1233
-
1234
- // The AST arrives late; the editor must catch up with it.
1235
- await waitFor(
1236
- () => {
1237
- expect(editable.textContent).toMatch(/local:?\s*name/);
1238
- expect(editable.textContent).toContain('John');
1239
- },
1240
- { timeout: 10000 }
1241
- );
1242
- await waitForLspIdle(canvasElement);
1243
- },
1244
- };
1245
-
1246
- /**
1247
- * The Text view offers template completions.
1248
- *
1249
- * Templates are how an author names a value the surrounding interface already
1250
- * has, and the Text view is a DPQL editor like any other: typing `$` asks the
1251
- * language server, in position, and shows what it answers. Nothing about
1252
- * mounting that editor inside the expression shell changes it — the shell
1253
- * passes no template list of its own, because there is none to pass.
1254
- *
1255
- * Asserted here because it had never been asserted anywhere: the shell's Text
1256
- * view had only ever been exercised for parse, serialize and type analysis, so
1257
- * "does `$` still work in there?" was an open question with no cost to
1258
- * answering. What this covers is the CLIENT half — that the shell surfaces
1259
- * what the server offers. Which contexts the live Qorus server offers is its
1260
- * own question, and this cannot answer it.
1261
- */
1262
- export const TextModeOffersTemplateCompletions: Story = {
1263
- args: {
1264
- value: { is_expression: true, value: { args: [] } },
1265
- defaultMode: 'text',
1266
- },
1267
- parameters: {
1268
- docs: {
1269
- description: {
1270
- story:
1271
- 'Types `$` into the shell\'s Text view — the DPQL editor asks the language server in position and the template namespaces ($data:, $config:, …) open in the completion dropdown.',
1272
- },
1273
- },
1274
- },
1275
- async play({ canvasElement }) {
1276
- const editable = (await waitFor(
1277
- () => {
1278
- const el = canvasElement.querySelector('[contenteditable="true"]');
1279
- if (!el) throw new Error('editor not ready');
1280
- return el as HTMLElement;
1281
- },
1282
- { timeout: 10000 }
1283
- )) as HTMLElement;
1284
-
1285
- // The editor mounting is not the language server being ready, and a `$`
1286
- // typed before the socket is up asks nothing at all.
1287
- await waitForLspIdle(canvasElement);
1288
- await userEvent.click(editable);
1289
- await userEvent.type(editable, '$');
1290
-
1291
- // The dropdown is portalled, so it is looked for in the document rather
1292
- // than in the canvas.
1293
- await waitFor(
1294
- () => {
1295
- const dropdown = document.querySelector('.reqore-menu');
1296
- expect(dropdown).not.toBeNull();
1297
- expect(dropdown!.textContent).toContain('$data:');
1298
- expect(dropdown!.textContent).toContain('$config:');
1299
- },
1300
- { timeout: 20000 }
1301
- );
1302
- },
1303
- };
1304
-
1305
- /**
1306
- * LIVE — fetches the real expression catalogue from the configured Qorus
1307
- * instance (no `expressions` override). This is the true apples-to-apples
1308
- * with qorus-ide: the picker shows the full ~121-function catalogue and
1309
- * schema-driven operands / operator words.
1310
- *
1311
- * Prereq (same as the DpqlEditor live stories): point the storybook at a
1312
- * reachable instance + token, e.g.
1313
- * `REACT_APP_QORUS_INSTANCE=https://localhost:8012/ REACT_APP_QORUS_TOKEN=<token> yarn storybook`
1314
- * Without a reachable instance the picker shows "No data available". Marked
1315
- * `live` so it is skipped by the offline test-runner.
1316
- */
1317
- export const Live: Story = {
1318
- // Real catalogue fetch — excluded from the offline play-test runner
1319
- // (network/auth), still snapshotted by Chromatic. Mirrors the DpqlEditor
1320
- // live stories.
1321
- tags: ['!test'],
1322
- parameters: {
1323
- live: true,
1324
- docs: {
1325
- description: {
1326
- story:
1327
- 'Renders ExpressionField against a live Qorus instance — the picker fetches the real ~121-function catalogue rather than the mock, and the seeded "contains" expression exercises the schema-driven operators and operands.',
1328
- },
1329
- },
1330
- },
1331
- args: {
1332
- type: 'bool',
1333
- value: {
1334
- is_expression: true,
1335
- value: {
1336
- exp: 'contains',
1337
- args: [
1338
- { type: 'string', value: '$local:input' },
1339
- { type: 'string', value: 'es' },
1340
- { type: 'bool', value: true },
1341
- ],
1342
- },
1343
- },
1344
- },
1345
- render(args) {
1346
- const [value, setValue] = useState<IExpression | undefined>(args.value);
1347
- // No `expressions` prop → ExpressionField fetches the real catalogue.
1348
- return (
1349
- <ExpressionField
1350
- type={args.type}
1351
- returnType={args.type}
1352
- value={value}
1353
- onChange={(v) => {
1354
- args.onChange?.(v);
1355
- setValue(v);
1356
- }}
1357
- />
1358
- );
1359
- },
1360
- };
1361
-
1362
- /**
1363
- * LIVE — server-side rendering over the LSP (`dpql/renderExpression`). Text
1364
- * mode against the real instance: the live "Preview" box should show the
1365
- * server rendering — `"test".startsWith("t", true)` — not the DPQL form
1366
- * (`"test" startsWith "t"`). Compare with
1367
- * qorus-ide's Explain (storybook :6007) for the same AST. Prereq: same as
1368
- * `Live`; note the LSP WebSocket is NOT CORS-blocked, unlike REST fetches
1369
- * from storybook to localhost:8012.
1370
- */
1371
- export const LiveExplain: Story = {
1372
- tags: ['!test'],
1373
- parameters: {
1374
- live: true,
1375
- docs: {
1376
- description: {
1377
- story:
1378
- 'Renders ExpressionField in Text mode against a live Qorus instance — the "Preview" box shows the server\'s readable rendering from dpql/renderExpression, `"test".startsWith("t", true)`, beside the DPQL it was written as, `"test" startsWith "t"`.',
1379
- },
1380
- },
1381
- },
1382
- args: {
1383
- value: {
1384
- is_expression: true,
1385
- value: {
1386
- exp: 'starts-with',
1387
- args: [
1388
- { type: 'string', value: 'test' },
1389
- { type: 'string', value: 't' },
1390
- ],
1391
- },
1392
- },
1393
- defaultMode: 'text',
1394
- },
1395
- };