@qoretechnologies/reqraft 0.10.64 → 0.10.65-pr.137.g20c3bec

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 (834) hide show
  1. package/README.md +53 -1
  2. package/dist/components/Description/AllowedValuesHelp.d.ts +20 -0
  3. package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -0
  4. package/dist/components/Description/AllowedValuesHelp.js +86 -0
  5. package/dist/components/Description/AllowedValuesHelp.js.map +1 -0
  6. package/dist/components/Description/describedControl.d.ts +54 -0
  7. package/dist/components/Description/describedControl.d.ts.map +1 -0
  8. package/dist/components/Description/describedControl.js +81 -0
  9. package/dist/components/Description/describedControl.js.map +1 -0
  10. package/dist/components/Description/index.d.ts.map +1 -1
  11. package/dist/components/Description/index.js +3 -2
  12. package/dist/components/Description/index.js.map +1 -1
  13. package/dist/components/colorValue/colorValue.d.ts +59 -0
  14. package/dist/components/colorValue/colorValue.d.ts.map +1 -0
  15. package/dist/components/colorValue/colorValue.js +245 -0
  16. package/dist/components/colorValue/colorValue.js.map +1 -0
  17. package/dist/components/colorValue/index.d.ts +34 -0
  18. package/dist/components/colorValue/index.d.ts.map +1 -0
  19. package/dist/components/colorValue/index.js +136 -0
  20. package/dist/components/colorValue/index.js.map +1 -0
  21. package/dist/components/colorValue/labels.d.ts +12 -0
  22. package/dist/components/colorValue/labels.d.ts.map +1 -0
  23. package/dist/components/colorValue/labels.js +11 -0
  24. package/dist/components/colorValue/labels.js.map +1 -0
  25. package/dist/components/composer/Composer.d.ts +1 -1
  26. package/dist/components/composer/Composer.d.ts.map +1 -1
  27. package/dist/components/composer/Composer.js +2 -2
  28. package/dist/components/composer/Composer.js.map +1 -1
  29. package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
  30. package/dist/components/dpqlEditor/DpqlEditor.js +41 -8
  31. package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
  32. package/dist/components/dpqlEditor/dpqlCompletions.d.ts +35 -0
  33. package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -0
  34. package/dist/components/dpqlEditor/dpqlCompletions.js +122 -0
  35. package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -0
  36. package/dist/components/dpqlEditor/dpqlHelpers.d.ts +47 -5
  37. package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
  38. package/dist/components/dpqlEditor/dpqlHelpers.js +390 -62
  39. package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
  40. package/dist/components/dpqlEditor/dpqlInserter.d.ts.map +1 -1
  41. package/dist/components/dpqlEditor/dpqlInserter.js +59 -29
  42. package/dist/components/dpqlEditor/dpqlInserter.js.map +1 -1
  43. package/dist/components/dpqlEditor/dpqlTags.d.ts +17 -7
  44. package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
  45. package/dist/components/dpqlEditor/dpqlTags.js +44 -17
  46. package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
  47. package/dist/components/dpqlEditor/types.d.ts +61 -8
  48. package/dist/components/dpqlEditor/types.d.ts.map +1 -1
  49. package/dist/components/dpqlEditor/useDpqlSession.d.ts +2 -2
  50. package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
  51. package/dist/components/dpqlEditor/useDpqlSession.js +16 -7
  52. package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
  53. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  54. package/dist/components/form/engine/CompactRow.js +327 -123
  55. package/dist/components/form/engine/CompactRow.js.map +1 -1
  56. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  57. package/dist/components/form/engine/CompactToolbar.js +29 -3
  58. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  59. package/dist/components/form/engine/FormEngine.d.ts +66 -11
  60. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  61. package/dist/components/form/engine/FormEngine.js +597 -173
  62. package/dist/components/form/engine/FormEngine.js.map +1 -1
  63. package/dist/components/form/engine/HiddenFieldsNote.d.ts +28 -0
  64. package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -0
  65. package/dist/components/form/engine/HiddenFieldsNote.js +32 -0
  66. package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -0
  67. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  68. package/dist/components/form/engine/OptionFieldMessages.js +25 -3
  69. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  70. package/dist/components/form/engine/OptionsHelpDialog.d.ts.map +1 -1
  71. package/dist/components/form/engine/OptionsHelpDialog.js +19 -2
  72. package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
  73. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +2 -2
  74. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  75. package/dist/components/form/engine/_structuredData/SchemaDataView.js +12 -6
  76. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  77. package/dist/components/form/engine/compactRowContext.d.ts +32 -1
  78. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  79. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  80. package/dist/components/form/engine/compactRowStyles.d.ts +22 -10
  81. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  82. package/dist/components/form/engine/compactRowStyles.js +53 -39
  83. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  84. package/dist/components/form/engine/compactToolbarColors.d.ts +16 -0
  85. package/dist/components/form/engine/compactToolbarColors.d.ts.map +1 -0
  86. package/dist/components/form/engine/compactToolbarColors.js +21 -0
  87. package/dist/components/form/engine/compactToolbarColors.js.map +1 -0
  88. package/dist/components/form/engine/inheritProps.d.ts +29 -0
  89. package/dist/components/form/engine/inheritProps.d.ts.map +1 -0
  90. package/dist/components/form/engine/inheritProps.js +43 -0
  91. package/dist/components/form/engine/inheritProps.js.map +1 -0
  92. package/dist/components/form/engine/operatorSummary.d.ts +26 -0
  93. package/dist/components/form/engine/operatorSummary.d.ts.map +1 -0
  94. package/dist/components/form/engine/operatorSummary.js +35 -0
  95. package/dist/components/form/engine/operatorSummary.js.map +1 -0
  96. package/dist/components/form/engine/readFirst.d.ts +24 -8
  97. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  98. package/dist/components/form/engine/readFirst.js +77 -109
  99. package/dist/components/form/engine/readFirst.js.map +1 -1
  100. package/dist/components/form/engine/readFirstColors.d.ts +30 -0
  101. package/dist/components/form/engine/readFirstColors.d.ts.map +1 -0
  102. package/dist/components/form/engine/readFirstColors.js +51 -0
  103. package/dist/components/form/engine/readFirstColors.js.map +1 -0
  104. package/dist/components/form/engine/rowFocus.d.ts +2 -0
  105. package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
  106. package/dist/components/form/engine/rowFocus.js +26 -3
  107. package/dist/components/form/engine/rowFocus.js.map +1 -1
  108. package/dist/components/form/engine/typeChoices.d.ts +1 -1
  109. package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -1
  110. package/dist/components/form/engine/variants/VariantCalmTable.js +2 -1
  111. package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -1
  112. package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -1
  113. package/dist/components/form/engine/variants/VariantCards.js +2 -1
  114. package/dist/components/form/engine/variants/VariantCards.js.map +1 -1
  115. package/dist/components/form/engine/variants/VariantFocus.js +1 -1
  116. package/dist/components/form/engine/variants/VariantFocus.js.map +1 -1
  117. package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -1
  118. package/dist/components/form/engine/variants/VariantMinimal.js +2 -1
  119. package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -1
  120. package/dist/components/form/engine/variants/variantParts.d.ts +1 -1
  121. package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -1
  122. package/dist/components/form/engine/variants/variantParts.js +25 -17
  123. package/dist/components/form/engine/variants/variantParts.js.map +1 -1
  124. package/dist/components/form/expressions/DpqlRendering.d.ts +1 -1
  125. package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
  126. package/dist/components/form/expressions/DpqlRendering.js +7 -6
  127. package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
  128. package/dist/components/form/expressions/ExpressionField.d.ts +66 -3
  129. package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
  130. package/dist/components/form/expressions/ExpressionField.js +475 -100
  131. package/dist/components/form/expressions/ExpressionField.js.map +1 -1
  132. package/dist/components/form/expressions/argumentPresence.d.ts +14 -0
  133. package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -1
  134. package/dist/components/form/expressions/argumentPresence.js +16 -1
  135. package/dist/components/form/expressions/argumentPresence.js.map +1 -1
  136. package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
  137. package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
  138. package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
  139. package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
  140. package/dist/components/form/expressions/builder/argumentLabel.js +27 -9
  141. package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
  142. package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
  143. package/dist/components/form/expressions/builder/argumentWrapper.js +3 -1
  144. package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
  145. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
  146. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +5 -4
  147. package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
  148. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts +1 -1
  149. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
  150. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +6 -3
  151. package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
  152. package/dist/components/form/expressions/builder/index.d.ts +29 -2
  153. package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
  154. package/dist/components/form/expressions/builder/index.js +161 -78
  155. package/dist/components/form/expressions/builder/index.js.map +1 -1
  156. package/dist/components/form/expressions/builder/item.d.ts +6 -2
  157. package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
  158. package/dist/components/form/expressions/builder/item.js +19 -5
  159. package/dist/components/form/expressions/builder/item.js.map +1 -1
  160. package/dist/components/form/expressions/builder/renderTemplate.js +1 -1
  161. package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
  162. package/dist/components/form/expressions/dpqlMockRecordPath.d.ts +11 -0
  163. package/dist/components/form/expressions/dpqlMockRecordPath.d.ts.map +1 -0
  164. package/dist/components/form/expressions/dpqlMockRecordPath.js +254 -0
  165. package/dist/components/form/expressions/dpqlMockRecordPath.js.map +1 -0
  166. package/dist/components/form/expressions/expressionOperands.d.ts +16 -0
  167. package/dist/components/form/expressions/expressionOperands.d.ts.map +1 -0
  168. package/dist/components/form/expressions/expressionOperands.js +97 -0
  169. package/dist/components/form/expressions/expressionOperands.js.map +1 -0
  170. package/dist/components/form/expressions/fieldPath.d.ts +24 -0
  171. package/dist/components/form/expressions/fieldPath.d.ts.map +1 -0
  172. package/dist/components/form/expressions/fieldPath.js +152 -0
  173. package/dist/components/form/expressions/fieldPath.js.map +1 -0
  174. package/dist/components/form/expressions/loneValue.d.ts +17 -0
  175. package/dist/components/form/expressions/loneValue.d.ts.map +1 -0
  176. package/dist/components/form/expressions/loneValue.js +33 -0
  177. package/dist/components/form/expressions/loneValue.js.map +1 -0
  178. package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
  179. package/dist/components/form/expressions/mockExpressions.js +22 -5
  180. package/dist/components/form/expressions/mockExpressions.js.map +1 -1
  181. package/dist/components/form/expressions/renderExpressionToText.d.ts +2 -0
  182. package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
  183. package/dist/components/form/expressions/renderExpressionToText.js +43 -10
  184. package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
  185. package/dist/components/form/expressions/textOfExpression.d.ts +18 -0
  186. package/dist/components/form/expressions/textOfExpression.d.ts.map +1 -0
  187. package/dist/components/form/expressions/textOfExpression.js +49 -0
  188. package/dist/components/form/expressions/textOfExpression.js.map +1 -0
  189. package/dist/components/form/expressions/types.d.ts +7 -0
  190. package/dist/components/form/expressions/types.d.ts.map +1 -1
  191. package/dist/components/form/expressions/types.js +6 -1
  192. package/dist/components/form/expressions/types.js.map +1 -1
  193. package/dist/components/form/expressions/useExpressionType.d.ts +26 -0
  194. package/dist/components/form/expressions/useExpressionType.d.ts.map +1 -0
  195. package/dist/components/form/expressions/useExpressionType.js +181 -0
  196. package/dist/components/form/expressions/useExpressionType.js.map +1 -0
  197. package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
  198. package/dist/components/form/expressions/useRenderExpression.js +13 -9
  199. package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
  200. package/dist/components/form/expressions/wildcardExpressions.d.ts +27 -0
  201. package/dist/components/form/expressions/wildcardExpressions.d.ts.map +1 -0
  202. package/dist/components/form/expressions/wildcardExpressions.js +101 -0
  203. package/dist/components/form/expressions/wildcardExpressions.js.map +1 -0
  204. package/dist/components/form/fields/Field.d.ts.map +1 -1
  205. package/dist/components/form/fields/Field.js +43 -20
  206. package/dist/components/form/fields/Field.js.map +1 -1
  207. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  208. package/dist/components/form/fields/allowed-values/AllowedValues.js +39 -6
  209. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  210. package/dist/components/form/fields/allowed-values/choicePicture.d.ts +37 -0
  211. package/dist/components/form/fields/allowed-values/choicePicture.d.ts.map +1 -0
  212. package/dist/components/form/fields/allowed-values/choicePicture.js +64 -0
  213. package/dist/components/form/fields/allowed-values/choicePicture.js.map +1 -0
  214. package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
  215. package/dist/components/form/fields/array/ArrayAuto.js +24 -0
  216. package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
  217. package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
  218. package/dist/components/form/fields/array/ArrayAutoField.js +36 -13
  219. package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
  220. package/dist/components/form/fields/auto/AutoFormField.d.ts +20 -1
  221. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  222. package/dist/components/form/fields/auto/AutoFormField.js +91 -53
  223. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  224. package/dist/components/form/fields/auto/hostEditorValue.d.ts +30 -0
  225. package/dist/components/form/fields/auto/hostEditorValue.d.ts.map +1 -0
  226. package/dist/components/form/fields/auto/hostEditorValue.js +53 -0
  227. package/dist/components/form/fields/auto/hostEditorValue.js.map +1 -0
  228. package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
  229. package/dist/components/form/fields/binary/Binary.js +23 -3
  230. package/dist/components/form/fields/binary/Binary.js.map +1 -1
  231. package/dist/components/form/fields/boolean/Boolean.d.ts +5 -0
  232. package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
  233. package/dist/components/form/fields/boolean/Boolean.js +9 -1
  234. package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
  235. package/dist/components/form/fields/color/Color.d.ts +103 -16
  236. package/dist/components/form/fields/color/Color.d.ts.map +1 -1
  237. package/dist/components/form/fields/color/Color.js +616 -16
  238. package/dist/components/form/fields/color/Color.js.map +1 -1
  239. package/dist/components/form/fields/emittedValues.d.ts +34 -3
  240. package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
  241. package/dist/components/form/fields/emittedValues.js +24 -1
  242. package/dist/components/form/fields/emittedValues.js.map +1 -1
  243. package/dist/components/form/fields/file/File.d.ts +1 -1
  244. package/dist/components/form/fields/file/File.d.ts.map +1 -1
  245. package/dist/components/form/fields/file/File.js +4 -2
  246. package/dist/components/form/fields/file/File.js.map +1 -1
  247. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  248. package/dist/components/form/fields/long-string/LongString.js +29 -8
  249. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  250. package/dist/components/form/fields/markdown/MarkdownView.js +1 -1
  251. package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
  252. package/dist/components/form/fields/multi-select/MultiSelectFormField.js +13 -9
  253. package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
  254. package/dist/components/form/fields/number/Number.d.ts +6 -0
  255. package/dist/components/form/fields/number/Number.d.ts.map +1 -1
  256. package/dist/components/form/fields/number/Number.js +41 -6
  257. package/dist/components/form/fields/number/Number.js.map +1 -1
  258. package/dist/components/form/fields/object/Object.d.ts +1 -1
  259. package/dist/components/form/fields/object/Object.d.ts.map +1 -1
  260. package/dist/components/form/fields/object/Object.js +4 -2
  261. package/dist/components/form/fields/object/Object.js.map +1 -1
  262. package/dist/components/form/fields/pendingEdit.d.ts +52 -0
  263. package/dist/components/form/fields/pendingEdit.d.ts.map +1 -0
  264. package/dist/components/form/fields/pendingEdit.js +79 -0
  265. package/dist/components/form/fields/pendingEdit.js.map +1 -0
  266. package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
  267. package/dist/components/form/fields/radio-group/RadioGroup.js +4 -3
  268. package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
  269. package/dist/components/form/fields/rich-text/RichText.d.ts +8 -1
  270. package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
  271. package/dist/components/form/fields/rich-text/RichText.js +211 -85
  272. package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
  273. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +18 -0
  274. package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -0
  275. package/dist/components/form/fields/rich-text/useTemplateTags.js +77 -0
  276. package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
  277. package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
  278. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +4 -1
  279. package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
  280. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
  281. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +20 -5
  282. package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
  283. package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
  284. package/dist/components/form/fields/schema-definition/TableEditor.js +10 -2
  285. package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
  286. package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
  287. package/dist/components/form/fields/schema-definition/index.js +8 -4
  288. package/dist/components/form/fields/schema-definition/index.js.map +1 -1
  289. package/dist/components/form/fields/select/Select.d.ts +10 -1
  290. package/dist/components/form/fields/select/Select.d.ts.map +1 -1
  291. package/dist/components/form/fields/select/Select.js +28 -14
  292. package/dist/components/form/fields/select/Select.js.map +1 -1
  293. package/dist/components/form/fields/select/SelectCollection.d.ts +5 -0
  294. package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
  295. package/dist/components/form/fields/select/SelectCollection.js +25 -12
  296. package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
  297. package/dist/components/form/fields/select/unavailableRow.d.ts +23 -0
  298. package/dist/components/form/fields/select/unavailableRow.d.ts.map +1 -0
  299. package/dist/components/form/fields/select/unavailableRow.js +55 -0
  300. package/dist/components/form/fields/select/unavailableRow.js.map +1 -0
  301. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +11 -5
  302. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
  303. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +21 -5
  304. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
  305. package/dist/components/form/fields/template/TemplateBrowser.d.ts +22 -0
  306. package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
  307. package/dist/components/form/fields/template/TemplateBrowser.js +54 -0
  308. package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
  309. package/dist/components/form/fields/template/TemplateField.d.ts +103 -1
  310. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  311. package/dist/components/form/fields/template/TemplateField.js +652 -104
  312. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  313. package/dist/components/form/fields/template/TemplateText.d.ts +0 -17
  314. package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -1
  315. package/dist/components/form/fields/template/TemplateText.js +22 -16
  316. package/dist/components/form/fields/template/TemplateText.js.map +1 -1
  317. package/dist/components/form/fields/template/referenceNames.d.ts +63 -0
  318. package/dist/components/form/fields/template/referenceNames.d.ts.map +1 -0
  319. package/dist/components/form/fields/template/referenceNames.js +69 -0
  320. package/dist/components/form/fields/template/referenceNames.js.map +1 -0
  321. package/dist/components/form/fields/template/writtenAsText.d.ts +61 -0
  322. package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
  323. package/dist/components/form/fields/template/writtenAsText.js +204 -0
  324. package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
  325. package/dist/components/form/index.d.ts +11 -0
  326. package/dist/components/form/index.d.ts.map +1 -1
  327. package/dist/components/form/index.js +24 -1
  328. package/dist/components/form/index.js.map +1 -1
  329. package/dist/components/form/typeSentenceForm.d.ts +11 -0
  330. package/dist/components/form/typeSentenceForm.d.ts.map +1 -0
  331. package/dist/components/form/typeSentenceForm.js +40 -0
  332. package/dist/components/form/typeSentenceForm.js.map +1 -0
  333. package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
  334. package/dist/components/imageLightbox/ImageLightbox.js +19 -7
  335. package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
  336. package/dist/components/log/Log.d.ts.map +1 -1
  337. package/dist/components/log/Log.js +16 -8
  338. package/dist/components/log/Log.js.map +1 -1
  339. package/dist/components/menu/Menu.d.ts.map +1 -1
  340. package/dist/components/menu/Menu.js +19 -10
  341. package/dist/components/menu/Menu.js.map +1 -1
  342. package/dist/components/smartEditor/CompletionMenu.d.ts +45 -0
  343. package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
  344. package/dist/components/smartEditor/CompletionMenu.js +207 -0
  345. package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
  346. package/dist/components/smartEditor/MarkdownDoc.d.ts +1 -1
  347. package/dist/components/smartEditor/MarkdownDoc.js +3 -3
  348. package/dist/components/smartEditor/MarkdownDoc.js.map +1 -1
  349. package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
  350. package/dist/components/smartEditor/SmartEditor.js +366 -187
  351. package/dist/components/smartEditor/SmartEditor.js.map +1 -1
  352. package/dist/components/smartEditor/completionStyle.d.ts +27 -0
  353. package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
  354. package/dist/components/smartEditor/completionStyle.js +68 -0
  355. package/dist/components/smartEditor/completionStyle.js.map +1 -0
  356. package/dist/components/smartEditor/index.d.ts +5 -1
  357. package/dist/components/smartEditor/index.d.ts.map +1 -1
  358. package/dist/components/smartEditor/index.js +19 -1
  359. package/dist/components/smartEditor/index.js.map +1 -1
  360. package/dist/components/smartEditor/templateCompletions.d.ts +38 -0
  361. package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
  362. package/dist/components/smartEditor/templateCompletions.js +126 -0
  363. package/dist/components/smartEditor/templateCompletions.js.map +1 -0
  364. package/dist/components/smartEditor/typedReferences.d.ts +21 -0
  365. package/dist/components/smartEditor/typedReferences.d.ts.map +1 -0
  366. package/dist/components/smartEditor/typedReferences.js +82 -0
  367. package/dist/components/smartEditor/typedReferences.js.map +1 -0
  368. package/dist/components/smartEditor/types.d.ts +66 -2
  369. package/dist/components/smartEditor/types.d.ts.map +1 -1
  370. package/dist/components/smartEditor/useLspAutocomplete.d.ts +62 -2
  371. package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
  372. package/dist/components/smartEditor/useLspAutocomplete.js +345 -146
  373. package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
  374. package/dist/components/smartEditor/useLspHover.d.ts +33 -7
  375. package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
  376. package/dist/components/smartEditor/useLspHover.js +351 -35
  377. package/dist/components/smartEditor/useLspHover.js.map +1 -1
  378. package/dist/components/smartEditor/useLspSemanticTokens.js +1 -1
  379. package/dist/components/smartEditor/useLspSemanticTokens.js.map +1 -1
  380. package/dist/components/smartEditor/useLspSession.d.ts +6 -0
  381. package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
  382. package/dist/components/smartEditor/useLspSession.js +7 -6
  383. package/dist/components/smartEditor/useLspSession.js.map +1 -1
  384. package/dist/components/smartEditor/useLspSignatureHelp.d.ts.map +1 -1
  385. package/dist/components/smartEditor/useLspSignatureHelp.js +6 -11
  386. package/dist/components/smartEditor/useLspSignatureHelp.js.map +1 -1
  387. package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
  388. package/dist/components/supportTicket/AttachmentChips.js +15 -5
  389. package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
  390. package/dist/components/supportTicket/ReferencePicker.d.ts +9 -2
  391. package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
  392. package/dist/components/supportTicket/ReferencePicker.js +27 -6
  393. package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
  394. package/dist/components/supportTicket/TicketHeader.d.ts +3 -4
  395. package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
  396. package/dist/components/supportTicket/TicketHeader.js +20 -2
  397. package/dist/components/supportTicket/TicketHeader.js.map +1 -1
  398. package/dist/components/supportTicket/TicketMetaTags.d.ts +1 -1
  399. package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
  400. package/dist/components/ticketReferences/TicketReferences.js +9 -4
  401. package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
  402. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  403. package/dist/components/ticketThread/TicketThread.js +38 -13
  404. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  405. package/dist/helpers/allowedValues.d.ts +21 -0
  406. package/dist/helpers/allowedValues.d.ts.map +1 -1
  407. package/dist/helpers/allowedValues.js +40 -1
  408. package/dist/helpers/allowedValues.js.map +1 -1
  409. package/dist/helpers/descriptionTooltip.d.ts +46 -0
  410. package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
  411. package/dist/helpers/descriptionTooltip.js +76 -0
  412. package/dist/helpers/descriptionTooltip.js.map +1 -0
  413. package/dist/helpers/domProps.d.ts +5 -0
  414. package/dist/helpers/domProps.d.ts.map +1 -0
  415. package/dist/helpers/domProps.js +47 -0
  416. package/dist/helpers/domProps.js.map +1 -0
  417. package/dist/helpers/expressions.d.ts +107 -2
  418. package/dist/helpers/expressions.d.ts.map +1 -1
  419. package/dist/helpers/expressions.js +223 -8
  420. package/dist/helpers/expressions.js.map +1 -1
  421. package/dist/helpers/hoveringPointer.d.ts +26 -0
  422. package/dist/helpers/hoveringPointer.d.ts.map +1 -0
  423. package/dist/helpers/hoveringPointer.js +29 -0
  424. package/dist/helpers/hoveringPointer.js.map +1 -0
  425. package/dist/helpers/markdownText.d.ts +14 -0
  426. package/dist/helpers/markdownText.d.ts.map +1 -0
  427. package/dist/helpers/markdownText.js +160 -0
  428. package/dist/helpers/markdownText.js.map +1 -0
  429. package/dist/helpers/noDescription.d.ts +9 -0
  430. package/dist/helpers/noDescription.d.ts.map +1 -0
  431. package/dist/helpers/noDescription.js +13 -0
  432. package/dist/helpers/noDescription.js.map +1 -0
  433. package/dist/helpers/optionUiTypes.d.ts +2 -2
  434. package/dist/helpers/qorusTypeCatalogue.d.ts +85 -0
  435. package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -0
  436. package/dist/helpers/qorusTypeCatalogue.js +301 -0
  437. package/dist/helpers/qorusTypeCatalogue.js.map +1 -0
  438. package/dist/helpers/readableColors.d.ts +36 -0
  439. package/dist/helpers/readableColors.d.ts.map +1 -0
  440. package/dist/helpers/readableColors.js +116 -0
  441. package/dist/helpers/readableColors.js.map +1 -0
  442. package/dist/helpers/recordFieldReference.d.ts +15 -0
  443. package/dist/helpers/recordFieldReference.d.ts.map +1 -0
  444. package/dist/helpers/recordFieldReference.js +89 -0
  445. package/dist/helpers/recordFieldReference.js.map +1 -0
  446. package/dist/helpers/templateItems.d.ts +2 -2
  447. package/dist/helpers/templateItems.d.ts.map +1 -1
  448. package/dist/helpers/templateItems.js +6 -4
  449. package/dist/helpers/templateItems.js.map +1 -1
  450. package/dist/helpers/templateText.d.ts +1 -0
  451. package/dist/helpers/templateText.d.ts.map +1 -1
  452. package/dist/helpers/templateText.js +7 -3
  453. package/dist/helpers/templateText.js.map +1 -1
  454. package/dist/helpers/templates.d.ts +68 -14
  455. package/dist/helpers/templates.d.ts.map +1 -1
  456. package/dist/helpers/templates.js +210 -24
  457. package/dist/helpers/templates.js.map +1 -1
  458. package/dist/helpers/validations.d.ts +28 -1
  459. package/dist/helpers/validations.d.ts.map +1 -1
  460. package/dist/helpers/validations.js +166 -37
  461. package/dist/helpers/validations.js.map +1 -1
  462. package/dist/helpers/webLink.d.ts +8 -0
  463. package/dist/helpers/webLink.d.ts.map +1 -0
  464. package/dist/helpers/webLink.js +29 -0
  465. package/dist/helpers/webLink.js.map +1 -0
  466. package/dist/hooks/useQorusTypes.d.ts +7 -15
  467. package/dist/hooks/useQorusTypes.d.ts.map +1 -1
  468. package/dist/hooks/useQorusTypes.js +25 -166
  469. package/dist/hooks/useQorusTypes.js.map +1 -1
  470. package/dist/hooks/useReadableIntentShade.d.ts +9 -0
  471. package/dist/hooks/useReadableIntentShade.d.ts.map +1 -0
  472. package/dist/hooks/useReadableIntentShade.js +23 -0
  473. package/dist/hooks/useReadableIntentShade.js.map +1 -0
  474. package/dist/hooks/useReadableOpacity.d.ts +6 -0
  475. package/dist/hooks/useReadableOpacity.d.ts.map +1 -0
  476. package/dist/hooks/useReadableOpacity.js +17 -0
  477. package/dist/hooks/useReadableOpacity.js.map +1 -0
  478. package/dist/index.d.ts +1 -0
  479. package/dist/index.d.ts.map +1 -1
  480. package/dist/index.js +1 -0
  481. package/dist/index.js.map +1 -1
  482. package/dist/tracking/ui/ExperimentCard.d.ts +1 -1
  483. package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
  484. package/dist/tracking/ui/ExperimentCard.js +26 -10
  485. package/dist/tracking/ui/ExperimentCard.js.map +1 -1
  486. package/dist/tracking/ui/card.d.ts +2 -2
  487. package/dist/tracking/ui/card.d.ts.map +1 -1
  488. package/dist/tracking/ui/card.js +2 -2
  489. package/dist/tracking/ui/card.js.map +1 -1
  490. package/dist/tracking/ui/readable.d.ts +14 -0
  491. package/dist/tracking/ui/readable.d.ts.map +1 -0
  492. package/dist/tracking/ui/readable.js +60 -0
  493. package/dist/tracking/ui/readable.js.map +1 -0
  494. package/dist/utils/fetch.d.ts +9 -2
  495. package/dist/utils/fetch.d.ts.map +1 -1
  496. package/dist/utils/fetch.js +6 -5
  497. package/dist/utils/fetch.js.map +1 -1
  498. package/dist/utils/websocket.d.ts +65 -2
  499. package/dist/utils/websocket.d.ts.map +1 -1
  500. package/dist/utils/websocket.js +276 -44
  501. package/dist/utils/websocket.js.map +1 -1
  502. package/package.json +14 -5
  503. package/.claude/CLAUDE.md +0 -317
  504. package/.tasks/EXPORT_EXPRESSION_BUILDER.md +0 -38
  505. package/.tasks/EXPRESSION_BUILDER_REPORT.md +0 -149
  506. package/.tasks/EXPRESSION_FIELD_SEAMS.md +0 -66
  507. package/.tasks/FIELD_STACK_REPORT.md +0 -234
  508. package/.tasks/FORM_ENGINE_COMPACT_READ_FIRST.md +0 -558
  509. package/.tasks/FORM_ENGINE_EXPRESSIONS.md +0 -197
  510. package/.tasks/FORM_ENGINE_OPTIONS_SYNC.md +0 -95
  511. package/.tasks/FORM_FIELD_EXTRAS.md +0 -72
  512. package/.tasks/INDEX.md +0 -111
  513. package/.tasks/LSP_SHARED_CONNECTION.md +0 -75
  514. package/.tasks/QONSOLE_ASSIST_FEATURES.md +0 -306
  515. package/.tasks/RENDER_EXPRESSION_LSP.md +0 -159
  516. package/.tasks/REQRAFT_AUTO_FIELD.md +0 -176
  517. package/.tasks/SCHEMA_DEFINITION_FIELD.md +0 -250
  518. package/.tasks/SMART_EDITOR_CONTEXT_AND_POLISH.md +0 -340
  519. package/.tasks/SMART_EDITOR_LSP_FEATURES.md +0 -299
  520. package/.tasks/SMART_EDITOR_REVIEW_FOLLOWUPS.md +0 -280
  521. package/.tasks/SMART_EDITOR_UX_POLISH.md +0 -383
  522. package/.tasks/SMART_EDITOR_VISUAL_POLISH.md +0 -246
  523. package/.tasks/STORY_NETWORK_ISOLATION.md +0 -98
  524. package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +0 -72
  525. package/CODE_OF_CONDUCT.md +0 -105
  526. package/CONTRIBUTING.MD +0 -78
  527. package/SECURITY.md +0 -3
  528. package/chromatic.config.json +0 -5
  529. package/design/COMPACT_ENGINE_REDESIGN.md +0 -156
  530. package/design/COMPACT_INFO_DISPLAY.md +0 -87
  531. package/design/COMPACT_PARITY.md +0 -85
  532. package/design/EXPRESSION_BUILDER_REPORT_STRATEGY.md +0 -92
  533. package/design/FORM_ENGINE_COMPACT.md +0 -300
  534. package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +0 -353
  535. package/design/FORM_ENGINE_EXPRESSIONS.md +0 -257
  536. package/design/FORM_ENGINE_FIELD_MIGRATION.md +0 -419
  537. package/design/IDE_INTEGRATION.md +0 -64
  538. package/design/RENDER_EXPRESSION_TRANSPORT.md +0 -156
  539. package/design/SELECT_DIALOG_FLOOR.md +0 -86
  540. package/design/SMART_EDITOR_UX.md +0 -438
  541. package/design/TRACKING.md +0 -290
  542. package/design/UNAVAILABLE_ALLOWED_VALUES.md +0 -226
  543. package/src/components/Description/index.tsx +0 -254
  544. package/src/components/Description/markdownRendererContext.tsx +0 -29
  545. package/src/components/FocusedEditing/index.tsx +0 -50
  546. package/src/components/codeSize/index.tsx +0 -79
  547. package/src/components/composer/Composer.stories.tsx +0 -238
  548. package/src/components/composer/Composer.tsx +0 -554
  549. package/src/components/composer/helpers.ts +0 -74
  550. package/src/components/composer/index.ts +0 -2
  551. package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -1183
  552. package/src/components/dpqlEditor/DpqlEditor.tsx +0 -219
  553. package/src/components/dpqlEditor/dpqlHelpers.ts +0 -287
  554. package/src/components/dpqlEditor/dpqlInserter.ts +0 -121
  555. package/src/components/dpqlEditor/dpqlProbe.ts +0 -165
  556. package/src/components/dpqlEditor/dpqlTags.ts +0 -114
  557. package/src/components/dpqlEditor/index.ts +0 -41
  558. package/src/components/dpqlEditor/types.ts +0 -203
  559. package/src/components/dpqlEditor/useDpqlProbe.ts +0 -33
  560. package/src/components/dpqlEditor/useDpqlSession.ts +0 -411
  561. package/src/components/form/engine/CompactRow.tsx +0 -2620
  562. package/src/components/form/engine/CompactToolbar.tsx +0 -330
  563. package/src/components/form/engine/FormEngine.stories.tsx +0 -9920
  564. package/src/components/form/engine/FormEngine.tsx +0 -4569
  565. package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
  566. package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -331
  567. package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
  568. package/src/components/form/engine/OptionFieldMessages.tsx +0 -477
  569. package/src/components/form/engine/OptionsHelpDialog.tsx +0 -29
  570. package/src/components/form/engine/__fixtures__/basicFormOptions.ts +0 -309
  571. package/src/components/form/engine/__fixtures__/fieldChromeOptions.ts +0 -45
  572. package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +0 -233
  573. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +0 -742
  574. package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +0 -85
  575. package/src/components/form/engine/_structuredData/StructuredDataView.tsx +0 -75
  576. package/src/components/form/engine/_structuredData/structuredData.ts +0 -145
  577. package/src/components/form/engine/compactRowContext.ts +0 -148
  578. package/src/components/form/engine/compactRowStyles.ts +0 -898
  579. package/src/components/form/engine/compactToolbarContext.ts +0 -69
  580. package/src/components/form/engine/optionActions.ts +0 -128
  581. package/src/components/form/engine/optionsContext.ts +0 -24
  582. package/src/components/form/engine/readFirst.ts +0 -1077
  583. package/src/components/form/engine/rendererTypes.ts +0 -107
  584. package/src/components/form/engine/revealRow.ts +0 -123
  585. package/src/components/form/engine/rowFocus.ts +0 -101
  586. package/src/components/form/engine/rowMenuContext.ts +0 -159
  587. package/src/components/form/engine/rowOpenPicker.ts +0 -27
  588. package/src/components/form/engine/typeChoices.ts +0 -63
  589. package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +0 -159
  590. package/src/components/form/engine/variants/VariantCalmTable.tsx +0 -244
  591. package/src/components/form/engine/variants/VariantCards.tsx +0 -212
  592. package/src/components/form/engine/variants/VariantFocus.tsx +0 -382
  593. package/src/components/form/engine/variants/VariantMinimal.tsx +0 -170
  594. package/src/components/form/engine/variants/focusDemo.ts +0 -145
  595. package/src/components/form/engine/variants/variantModel.ts +0 -223
  596. package/src/components/form/engine/variants/variantParts.tsx +0 -313
  597. package/src/components/form/expressions/DpqlRendering.tsx +0 -85
  598. package/src/components/form/expressions/ExpressionField.stories.tsx +0 -1395
  599. package/src/components/form/expressions/ExpressionField.tsx +0 -503
  600. package/src/components/form/expressions/argumentPresence.ts +0 -213
  601. package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +0 -1683
  602. package/src/components/form/expressions/builder/argumentDetail.tsx +0 -17
  603. package/src/components/form/expressions/builder/argumentLabel.tsx +0 -146
  604. package/src/components/form/expressions/builder/argumentSlot.tsx +0 -101
  605. package/src/components/form/expressions/builder/argumentWrapper.tsx +0 -243
  606. package/src/components/form/expressions/builder/confirmMismatchedTypesModal.tsx +0 -120
  607. package/src/components/form/expressions/builder/confirmUnsupportedTypeModal.tsx +0 -69
  608. package/src/components/form/expressions/builder/index.tsx +0 -1545
  609. package/src/components/form/expressions/builder/item.tsx +0 -89
  610. package/src/components/form/expressions/builder/moveToPositionStrip.tsx +0 -156
  611. package/src/components/form/expressions/builder/renderTemplate.tsx +0 -42
  612. package/src/components/form/expressions/dpqlMockLanguage.ts +0 -566
  613. package/src/components/form/expressions/dpqlMockLsp.ts +0 -126
  614. package/src/components/form/expressions/mockExpressions.ts +0 -317
  615. package/src/components/form/expressions/renderExpressionToText.ts +0 -137
  616. package/src/components/form/expressions/types.ts +0 -110
  617. package/src/components/form/expressions/useExpressions.ts +0 -101
  618. package/src/components/form/expressions/useRenderExpression.ts +0 -165
  619. package/src/components/form/fields/Field.stories.tsx +0 -143
  620. package/src/components/form/fields/Field.tsx +0 -732
  621. package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -297
  622. package/src/components/form/fields/array/ArrayAuto.tsx +0 -237
  623. package/src/components/form/fields/array/ArrayAutoField.stories.tsx +0 -475
  624. package/src/components/form/fields/array/ArrayAutoField.tsx +0 -367
  625. package/src/components/form/fields/auto/AutoFormField.stories.tsx +0 -825
  626. package/src/components/form/fields/auto/AutoFormField.tsx +0 -1164
  627. package/src/components/form/fields/binary/Binary.stories.tsx +0 -122
  628. package/src/components/form/fields/binary/Binary.tsx +0 -91
  629. package/src/components/form/fields/boolean/Boolean.stories.tsx +0 -125
  630. package/src/components/form/fields/boolean/Boolean.tsx +0 -34
  631. package/src/components/form/fields/byte-size/ByteSize.stories.tsx +0 -87
  632. package/src/components/form/fields/byte-size/ByteSize.tsx +0 -58
  633. package/src/components/form/fields/color/Color.stories.tsx +0 -99
  634. package/src/components/form/fields/color/Color.tsx +0 -46
  635. package/src/components/form/fields/cron/Cron.stories.tsx +0 -68
  636. package/src/components/form/fields/cron/Cron.tsx +0 -80
  637. package/src/components/form/fields/date/Date.stories.tsx +0 -77
  638. package/src/components/form/fields/date/Date.tsx +0 -55
  639. package/src/components/form/fields/emittedValues.ts +0 -70
  640. package/src/components/form/fields/file/File.stories.tsx +0 -161
  641. package/src/components/form/fields/file/File.tsx +0 -227
  642. package/src/components/form/fields/long-string/LongString.stories.tsx +0 -120
  643. package/src/components/form/fields/long-string/LongString.tsx +0 -130
  644. package/src/components/form/fields/markdown/Markdown.stories.tsx +0 -76
  645. package/src/components/form/fields/markdown/Markdown.tsx +0 -81
  646. package/src/components/form/fields/markdown/MarkdownView.tsx +0 -222
  647. package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +0 -139
  648. package/src/components/form/fields/number/Number.stories.tsx +0 -159
  649. package/src/components/form/fields/number/Number.tsx +0 -160
  650. package/src/components/form/fields/object/Object.stories.tsx +0 -398
  651. package/src/components/form/fields/object/Object.tsx +0 -255
  652. package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +0 -95
  653. package/src/components/form/fields/radio-group/RadioGroup.tsx +0 -46
  654. package/src/components/form/fields/radio-group/images/java-96x128.png +0 -0
  655. package/src/components/form/fields/radio-group/images/python-129x128.png +0 -0
  656. package/src/components/form/fields/radio-group/images/qore-106x128.png +0 -0
  657. package/src/components/form/fields/rich-text/RichText.stories.tsx +0 -260
  658. package/src/components/form/fields/rich-text/RichText.tsx +0 -537
  659. package/src/components/form/fields/schema-definition/CatalogLeafForm.tsx +0 -242
  660. package/src/components/form/fields/schema-definition/CatalogNodeEditor.tsx +0 -758
  661. package/src/components/form/fields/schema-definition/Hint.tsx +0 -22
  662. package/src/components/form/fields/schema-definition/InlineValidationBanner.tsx +0 -138
  663. package/src/components/form/fields/schema-definition/Loader.tsx +0 -20
  664. package/src/components/form/fields/schema-definition/MigrationsTab.tsx +0 -187
  665. package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +0 -286
  666. package/src/components/form/fields/schema-definition/TableEditor.tsx +0 -155
  667. package/src/components/form/fields/schema-definition/TablesTab.tsx +0 -138
  668. package/src/components/form/fields/schema-definition/catalog.ts +0 -237
  669. package/src/components/form/fields/schema-definition/helpers.ts +0 -90
  670. package/src/components/form/fields/schema-definition/index.tsx +0 -418
  671. package/src/components/form/fields/schema-definition/mockCatalog.ts +0 -325
  672. package/src/components/form/fields/schema-definition/mockDefinition.ts +0 -111
  673. package/src/components/form/fields/schema-definition/referenceSuggestions.tsx +0 -152
  674. package/src/components/form/fields/schema-definition/starterTemplate.ts +0 -68
  675. package/src/components/form/fields/schema-definition/types.ts +0 -185
  676. package/src/components/form/fields/schema-definition/useSchemaOptionCatalog.ts +0 -49
  677. package/src/components/form/fields/select/Select.stories.tsx +0 -872
  678. package/src/components/form/fields/select/Select.tsx +0 -624
  679. package/src/components/form/fields/select/SelectCollection.tsx +0 -594
  680. package/src/components/form/fields/string/String.stories.tsx +0 -86
  681. package/src/components/form/fields/string/String.tsx +0 -43
  682. package/src/components/form/fields/template/ExampleValueModal.stories.tsx +0 -114
  683. package/src/components/form/fields/template/ExampleValueModal.tsx +0 -99
  684. package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +0 -47
  685. package/src/components/form/fields/template/TemplateField.stories.tsx +0 -1121
  686. package/src/components/form/fields/template/TemplateField.tsx +0 -1717
  687. package/src/components/form/fields/template/TemplateText.tsx +0 -115
  688. package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +0 -7
  689. package/src/components/form/fields/template/__fixtures__/multiLevelTemplates.json +0 -147
  690. package/src/components/form/fields/template/__fixtures__/templates.json +0 -83
  691. package/src/components/form/fields/timeout/Timeout.stories.tsx +0 -228
  692. package/src/components/form/fields/timeout/Timeout.tsx +0 -87
  693. package/src/components/form/fields/url/Url.stories.tsx +0 -94
  694. package/src/components/form/fields/url/Url.tsx +0 -85
  695. package/src/components/form/index.tsx +0 -47
  696. package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
  697. package/src/components/imageLightbox/ImageLightbox.tsx +0 -236
  698. package/src/components/imageLightbox/index.ts +0 -1
  699. package/src/components/log/Log.stories.tsx +0 -333
  700. package/src/components/log/Log.tsx +0 -285
  701. package/src/components/menu/Menu.stories.tsx +0 -155
  702. package/src/components/menu/Menu.tsx +0 -312
  703. package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +0 -797
  704. package/src/components/qonsoleSmartInput/QonsoleSmartInput.tsx +0 -105
  705. package/src/components/qonsoleSmartInput/index.ts +0 -16
  706. package/src/components/qonsoleSmartInput/qonsoleInserter.ts +0 -77
  707. package/src/components/qonsoleSmartInput/types.ts +0 -133
  708. package/src/components/qonsoleSmartInput/useQonsoleSession.ts +0 -124
  709. package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +0 -62
  710. package/src/components/searchFilterBar/SearchFilterBar.tsx +0 -144
  711. package/src/components/searchFilterBar/index.ts +0 -1
  712. package/src/components/smartEditor/MarkdownDoc.tsx +0 -190
  713. package/src/components/smartEditor/SmartEditor.stories.tsx +0 -475
  714. package/src/components/smartEditor/SmartEditor.tsx +0 -808
  715. package/src/components/smartEditor/__fixtures__/mockLspServer.ts +0 -205
  716. package/src/components/smartEditor/helpers.ts +0 -217
  717. package/src/components/smartEditor/index.ts +0 -35
  718. package/src/components/smartEditor/styling.ts +0 -45
  719. package/src/components/smartEditor/types.ts +0 -211
  720. package/src/components/smartEditor/useLspAutocomplete.ts +0 -758
  721. package/src/components/smartEditor/useLspDiagnosticDecorations.ts +0 -125
  722. package/src/components/smartEditor/useLspHover.ts +0 -230
  723. package/src/components/smartEditor/useLspSemanticTokens.ts +0 -298
  724. package/src/components/smartEditor/useLspSession.ts +0 -231
  725. package/src/components/smartEditor/useLspSignatureHelp.ts +0 -198
  726. package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -171
  727. package/src/components/supportTicket/AttachmentChips.tsx +0 -147
  728. package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -257
  729. package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -129
  730. package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -584
  731. package/src/components/supportTicket/ReferencePicker.tsx +0 -563
  732. package/src/components/supportTicket/TicketConversation.stories.tsx +0 -121
  733. package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
  734. package/src/components/supportTicket/TicketHeader.tsx +0 -247
  735. package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
  736. package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
  737. package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -354
  738. package/src/components/supportTicket/TicketReplyBox.tsx +0 -150
  739. package/src/components/supportTicket/__fixtures__/kindMarks.ts +0 -28
  740. package/src/components/supportTicket/attachmentAccess.ts +0 -97
  741. package/src/components/supportTicket/fileToAttachment.ts +0 -24
  742. package/src/components/supportTicket/index.ts +0 -10
  743. package/src/components/supportTicket/meta.ts +0 -206
  744. package/src/components/supportTicket/ticketModel.ts +0 -131
  745. package/src/components/supportTicket/useLoadedImages.ts +0 -73
  746. package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -315
  747. package/src/components/ticketReferences/TicketReferences.tsx +0 -906
  748. package/src/components/ticketReferences/index.ts +0 -2
  749. package/src/components/ticketThread/TicketThread.stories.tsx +0 -829
  750. package/src/components/ticketThread/TicketThread.tsx +0 -719
  751. package/src/components/ticketThread/index.ts +0 -6
  752. package/src/contexts/FetchContext.tsx +0 -25
  753. package/src/contexts/ReqraftContext.tsx +0 -9
  754. package/src/contexts/StorageContext.tsx +0 -33
  755. package/src/global.d.ts +0 -4
  756. package/src/helpers/allowedValues.ts +0 -249
  757. package/src/helpers/choiceChip.ts +0 -227
  758. package/src/helpers/common.ts +0 -326
  759. package/src/helpers/dpqlDetection.ts +0 -209
  760. package/src/helpers/expressions.ts +0 -140
  761. package/src/helpers/optionUiTypes.ts +0 -199
  762. package/src/helpers/options.ts +0 -150
  763. package/src/helpers/providerValue.ts +0 -125
  764. package/src/helpers/scrollbar.ts +0 -32
  765. package/src/helpers/singleLineString.ts +0 -61
  766. package/src/helpers/templateItems.ts +0 -81
  767. package/src/helpers/templateText.ts +0 -350
  768. package/src/helpers/templates.ts +0 -602
  769. package/src/helpers/validations.ts +0 -2085
  770. package/src/hooks/useArgSchema.ts +0 -37
  771. package/src/hooks/useCoarsePointer.ts +0 -30
  772. package/src/hooks/useFetch/useFetch.stories.tsx +0 -379
  773. package/src/hooks/useFetch/useFetch.tsx +0 -154
  774. package/src/hooks/usePhoneViewport.ts +0 -34
  775. package/src/hooks/useQorusTypes.ts +0 -233
  776. package/src/hooks/useReqraftProperty.ts +0 -16
  777. package/src/hooks/useStorage/useStorage.stories.tsx +0 -168
  778. package/src/hooks/useStorage/useStorage.ts +0 -35
  779. package/src/hooks/useTemplates.ts +0 -123
  780. package/src/hooks/useValidation.ts +0 -9
  781. package/src/hooks/useWebSocket/useWebSocket.ts +0 -224
  782. package/src/hooks/useWebSocket/useWebsocket.stories.tsx +0 -640
  783. package/src/hooks/useWhyDidYouUpdate.ts +0 -38
  784. package/src/index.tsx +0 -86
  785. package/src/providers/FetchProvider.tsx +0 -40
  786. package/src/providers/ReqraftProvider.tsx +0 -52
  787. package/src/providers/StorageProvider.tsx +0 -131
  788. package/src/stores/currentUser/currentUser.stories.tsx +0 -100
  789. package/src/stores/currentUser/currentUser.tsx +0 -94
  790. package/src/stories/Data/fileFieldArgSchema.json +0 -86
  791. package/src/stories/Tests/utils.ts +0 -320
  792. package/src/stories/storyNetwork.ts +0 -92
  793. package/src/stories/tracking.tsx +0 -206
  794. package/src/tracking/browser/attach.ts +0 -186
  795. package/src/tracking/browser/env.ts +0 -78
  796. package/src/tracking/core/consent.ts +0 -37
  797. package/src/tracking/core/engagement.ts +0 -47
  798. package/src/tracking/core/experiments.ts +0 -258
  799. package/src/tracking/core/hash.ts +0 -26
  800. package/src/tracking/core/ids.ts +0 -25
  801. package/src/tracking/core/observable.ts +0 -23
  802. package/src/tracking/core/queue.ts +0 -131
  803. package/src/tracking/core/sections.ts +0 -166
  804. package/src/tracking/core/storage.ts +0 -69
  805. package/src/tracking/core/tracker.ts +0 -417
  806. package/src/tracking/core/types.ts +0 -162
  807. package/src/tracking/core/utm.ts +0 -23
  808. package/src/tracking/index.ts +0 -72
  809. package/src/tracking/markup.ts +0 -17
  810. package/src/tracking/react/Experiment.tsx +0 -44
  811. package/src/tracking/react/TrackingProvider.tsx +0 -56
  812. package/src/tracking/react/hooks.ts +0 -106
  813. package/src/tracking/react/index.ts +0 -13
  814. package/src/tracking/testing.ts +0 -108
  815. package/src/tracking/ui/ExperimentCard.stories.tsx +0 -296
  816. package/src/tracking/ui/ExperimentCard.tsx +0 -667
  817. package/src/tracking/ui/ExperimentsOverlay.stories.tsx +0 -155
  818. package/src/tracking/ui/ExperimentsOverlay.tsx +0 -437
  819. package/src/tracking/ui/anchor.ts +0 -180
  820. package/src/tracking/ui/card.ts +0 -464
  821. package/src/tracking/ui/client.ts +0 -117
  822. package/src/tracking/ui/index.ts +0 -77
  823. package/src/tracking/ui/types.ts +0 -110
  824. package/src/tracking/ui/useExperimentsAdmin.ts +0 -103
  825. package/src/types/Form.ts +0 -29
  826. package/src/types.ts +0 -14
  827. package/src/utils/datetime.ts +0 -10
  828. package/src/utils/fetch.ts +0 -457
  829. package/src/utils/lspClient.ts +0 -711
  830. package/src/utils/lspClient.types.ts +0 -211
  831. package/src/utils/queryUnlessCancelled.ts +0 -28
  832. package/src/utils/websocket.ts +0 -293
  833. package/vite.config.ts +0 -58
  834. package/vitest.config.ts +0 -69
@@ -1,1683 +0,0 @@
1
- // Ported from qorus-ide `src/stories/Components/ExpressionBuilder.stories.tsx`.
2
- // Adaptations: import the ported builder from `./index`; drive the catalogue
3
- // offline via `mockExpressions` (passed as the `expressions` prop) instead of a
4
- // live server; the IDE's `_testsClickButton` / `_testsSelectItemFromCollection`
5
- // helpers are inlined here with `@storybook/test` primitives. The count-based
6
- // assertions (`.expression`, `.expression-and`, `.expression-or`) are preserved.
7
- import { StoryObj } from '@storybook/react-vite';
8
- import { expect, fireEvent, fn, userEvent, waitFor, within } from 'storybook/test';
9
- import { useState } from 'react';
10
- import { sleep } from '../../../../../__tests__/utils';
11
- import { StoryMeta } from '../../../../types';
12
- import { templateChipLabel } from '../../../../helpers/templateText';
13
- import { mockExpressions } from '../mockExpressions';
14
- import { IExpression } from '../types';
15
- import { ExpressionBuilder } from './index';
16
-
17
- // --- inlined test helpers (equivalents of the IDE `../Tests/utils`) ---------
18
-
19
- /** Count regular expression cards (`.expression`). */
20
- const expressionCount = (scope: ParentNode = document) =>
21
- scope.querySelectorAll('.expression').length;
22
-
23
- /** Click a ReqoreButton by visible label (anywhere in the document). */
24
- const clickButtonByLabel = async (label: string) => {
25
- const body = within(document.body);
26
- const el = await body.findByText(label, undefined, { timeout: 10000 });
27
- await fireEvent.click(el);
28
- };
29
-
30
- /** Click a button by CSS selector. */
31
- const clickSelector = async (selector: string, nth = 0, scope: ParentNode = document) => {
32
- const els = scope.querySelectorAll(selector);
33
- await fireEvent.click(els[nth]);
34
- };
35
-
36
- /** Wait for some text to appear in the document. */
37
- const waitForText = async (text: string | RegExp, scope: HTMLElement = document.body) => {
38
- const body = within(scope);
39
- await waitFor(() => expect(body.queryAllByText(text)[0]).toBeTruthy(), { timeout: 10000 });
40
- };
41
-
42
- /**
43
- * Equivalent of the IDE's `_testsSelectItemFromCollection`: open the operator
44
- * picker (a `Select` rendered as a button labelled `currentLabel`), then click
45
- * the target item in the collection modal. The picker has descriptions, so the
46
- * toolkit `Select` opens a `SelectFieldCollection` modal (not an inline
47
- * dropdown) — the item is a collection button with the display name as text.
48
- */
49
- const selectOperation = async (
50
- currentLabel: string,
51
- itemLabel: string,
52
- ownerDocument: Document = document
53
- ) => {
54
- const body = within(ownerDocument.body);
55
- // Open the picker (placeholder when empty, or the current operation name).
56
- const trigger = await body.findByText(currentLabel, undefined, { timeout: 10000 });
57
- await fireEvent.click(trigger);
58
- // Click the item inside the now-open collection modal.
59
- const item = await waitFor(
60
- () => {
61
- const el = within(ownerDocument.body).queryAllByText(itemLabel)[0];
62
- if (!el) throw new Error(`collection item "${itemLabel}" not ready`);
63
- return el;
64
- },
65
- { timeout: 10000 }
66
- );
67
- await fireEvent.click(item);
68
- };
69
-
70
- /** Count varargs remove-argument buttons (`.expression-remove-arg`). */
71
- const removeArgCount = () => document.querySelectorAll('.expression-remove-arg').length;
72
-
73
- // --- fixtures ---------------------------------------------------------------
74
-
75
- const localTemplates = {
76
- label: 'Testing',
77
- items: [
78
- {
79
- label: 'Testing bool',
80
- badge: 'Test',
81
- items: [{ label: 'Testing bool', badge: 'bool', value: '$local:some-bool' }],
82
- },
83
- {
84
- label: 'Testing Richtext',
85
- badge: 'richtext',
86
- items: [{ label: 'Richtext Template', badge: 'richtext', value: '$local:some-richtext' }],
87
- },
88
- ],
89
- } as any;
90
-
91
- const meta = {
92
- component: ExpressionBuilder,
93
- title: 'Components/Form/Expressions/ExpressionBuilder',
94
- args: {
95
- expressions: mockExpressions,
96
- localTemplates,
97
- onChange: fn(),
98
- },
99
- render: (args) => {
100
- const [exp, setExp] = useState<IExpression>(args.value);
101
-
102
- return (
103
- <ExpressionBuilder
104
- {...args}
105
- value={exp}
106
- onChange={(value) => {
107
- args.onChange?.(value);
108
- setExp(value);
109
- }}
110
- />
111
- );
112
- },
113
- } as StoryMeta<typeof ExpressionBuilder>;
114
-
115
- export default meta;
116
- export type Story = StoryObj<typeof meta>;
117
-
118
- export const Default: Story = {
119
- args: {
120
- returnType: ['string', 'int'],
121
- },
122
- parameters: {
123
- docs: {
124
- description: {
125
- story:
126
- 'Renders the ExpressionBuilder with no value and a string-or-int return type — a single empty expression card is shown so the operator can pick an operation.',
127
- },
128
- },
129
- },
130
- play: async ({ canvasElement }) => {
131
- await waitFor(() => expect(expressionCount(canvasElement)).toBe(1), { timeout: 10000 });
132
- },
133
- };
134
-
135
- /**
136
- * Picking a varargs operation on a fresh builder. Used to crash: the fresh
137
- * value has no operands, the operator change pushed `undefined` for the one
138
- * catalogue argument, and the varargs branch of `addMissingArgs` never
139
- * filled the hole, so the validator read `.type` of `undefined`.
140
- */
141
- export const AdditionPickedFresh: Story = {
142
- ...Default,
143
- parameters: {
144
- docs: {
145
- description: {
146
- story:
147
- 'Renders an empty ExpressionBuilder and picks "Addition" from the operation picker — the card shows one empty Value operand and the "Add value" slot, with no crash and no error boundary.',
148
- },
149
- },
150
- },
151
- play: async (context) => {
152
- await Default.play!(context);
153
- await selectOperation('Select operation', 'Addition');
154
-
155
- await waitFor(() => expect(count('.expression-arg')).toBe(1), { timeout: 10000 });
156
- expect(addSlot()).not.toBeNull();
157
- expect(document.querySelector('.reqore-error-boundary')).toBeNull();
158
- await waitForText('Value');
159
- expect(context.args.onChange).toHaveBeenLastCalledWith(
160
- expect.objectContaining({
161
- value: expect.objectContaining({ exp: '+', args: [{ type: undefined }] }),
162
- })
163
- );
164
- },
165
- };
166
-
167
- export const DefaultBoolean: Story = {
168
- args: {
169
- returnType: ['boolean'],
170
- },
171
- parameters: {
172
- docs: {
173
- description: {
174
- story:
175
- 'Renders the ExpressionBuilder with no value and a boolean return type — a single empty expression card is shown so the operator can pick a boolean-returning operation.',
176
- },
177
- },
178
- },
179
- play: async () => {
180
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
181
- },
182
- };
183
-
184
- export const WithSimpleValue: Story = {
185
- args: {
186
- returnType: ['string'],
187
- value: {
188
- is_expression: true,
189
- value: {
190
- exp: 'contains',
191
- args: [
192
- { type: 'string', value: '$local:input' },
193
- { type: 'string', value: 'es' },
194
- { type: 'bool', value: true },
195
- ],
196
- },
197
- },
198
- },
199
- parameters: {
200
- docs: {
201
- description: {
202
- story:
203
- 'Renders the ExpressionBuilder holding a single "contains" expression with three arguments — the card shows the operation and each operand slot.',
204
- },
205
- },
206
- },
207
- play: async () => {
208
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
209
- },
210
- };
211
-
212
- export const WithComplexValue: Story = {
213
- args: {
214
- value: {
215
- is_expression: true,
216
- value: {
217
- exp: '&&',
218
- args: [
219
- {
220
- value: {
221
- exp: '||',
222
- args: [
223
- {
224
- value: {
225
- exp: 'contains',
226
- args: [
227
- { type: 'string', value: '$local:input' },
228
- { type: 'string', value: 'es' },
229
- ],
230
- },
231
- is_expression: true,
232
- },
233
- {
234
- value: {
235
- exp: '&&',
236
- args: [
237
- {
238
- value: {
239
- exp: 'starts-with',
240
- args: [
241
- { type: 'string', value: 'test' },
242
- { type: 'string', value: 't' },
243
- ],
244
- },
245
- is_expression: true,
246
- },
247
- {
248
- value: {
249
- exp: 'starts-with',
250
- args: [
251
- { type: 'string', value: 'test' },
252
- { type: 'string', value: 't' },
253
- ],
254
- },
255
- is_expression: true,
256
- },
257
- ],
258
- },
259
- is_expression: true,
260
- },
261
- {
262
- value: {
263
- exp: '>=',
264
- args: [
265
- { type: 'int', value: 23 },
266
- { type: 'string', value: '$local:id' },
267
- ],
268
- },
269
- is_expression: true,
270
- },
271
- ],
272
- },
273
- is_expression: true,
274
- },
275
- {
276
- value: {
277
- exp: 'ends-with',
278
- args: [
279
- { type: 'string', value: '$local:str' },
280
- { type: 'string', value: '$local:p' },
281
- ],
282
- },
283
- is_expression: true,
284
- },
285
- {
286
- value: {
287
- exp: '<',
288
- args: [
289
- { type: 'int', value: '$local:input' },
290
- { type: 'string', value: '$local:p' },
291
- ],
292
- },
293
- is_expression: true,
294
- },
295
- ],
296
- },
297
- },
298
- },
299
- parameters: {
300
- docs: {
301
- description: {
302
- story:
303
- 'Renders the ExpressionBuilder holding a nested &&/|| expression with six leaf expressions — the builder shows the full expression tree with the AND/OR group cards and their operand cards.',
304
- },
305
- },
306
- },
307
- play: async () => {
308
- await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
309
- },
310
- };
311
-
312
- export const ShowsExplanation: Story = {
313
- ...WithComplexValue,
314
- parameters: {
315
- ...WithComplexValue.parameters,
316
- docs: {
317
- description: {
318
- story:
319
- 'Renders the nested expression tree and clicks Explain — the plain-language explanation of the whole expression is shown alongside the builder.',
320
- },
321
- },
322
- },
323
- play: async (args) => {
324
- await WithComplexValue.play!(args);
325
- await clickButtonByLabel('Explain');
326
- await waitFor(
327
- () => {
328
- const body = within(document.body);
329
- expect(body.queryAllByText(/startsWith|&&|\|\|/i).length).toBeGreaterThan(0);
330
- },
331
- { timeout: 10000 }
332
- );
333
- },
334
- };
335
-
336
- export const Readonly: Story = {
337
- ...WithComplexValue,
338
- args: {
339
- ...WithComplexValue.args,
340
- readOnly: true,
341
- },
342
- parameters: {
343
- ...WithComplexValue.parameters,
344
- docs: {
345
- description: {
346
- story:
347
- 'Renders the nested expression tree with readOnly enabled — the tree is visible but the AND/OR add-group controls are hidden so the operator cannot mutate it.',
348
- },
349
- },
350
- },
351
- play: async (args) => {
352
- await WithComplexValue.play!(args);
353
- expect(document.querySelector('.expression-and')).toBeNull();
354
- },
355
- };
356
-
357
- export const FocusedEditing: Story = {
358
- ...WithComplexValue,
359
- parameters: {
360
- ...WithComplexValue.parameters,
361
- docs: {
362
- description: {
363
- story:
364
- 'Renders the nested expression tree, hovers a card and clicks its fullscreen action — the focused-editing modal opens over that subtree.',
365
- },
366
- },
367
- },
368
- play: async (args) => {
369
- await WithComplexValue.play!(args);
370
- await userEvent.hover(document.querySelectorAll('.expression')[0]);
371
- await sleep(500);
372
- await clickSelector('.expression-item-fullscreen', 3);
373
- await waitForText('Focused Editing');
374
- },
375
- };
376
-
377
- /**
378
- * Ported from the IDE `WithArgWithAllowedValues`: a FRESH op-select of
379
- * `Matches Regular Expression`, whose third arg ("Regex Options") carries
380
- * `element_allowed_values`. The IDE play only selects and settles; here we
381
- * also assert the allowed-values operand actually paints — the regression
382
- * this family guards (a value-less fresh op-select must render its operands).
383
- */
384
- export const WithArgWithAllowedValues: Story = {
385
- args: {
386
- returnType: ['bool'],
387
- },
388
- parameters: {
389
- docs: {
390
- description: {
391
- story:
392
- 'Renders an empty ExpressionBuilder and selects "Matches Regular Expression" — the third operand ("Regex Options") carries element_allowed_values and renders the "Select one or more" picker.',
393
- },
394
- },
395
- },
396
- play: async (args) => {
397
- await Default.play!(args);
398
-
399
- await selectOperation('Select operation', 'Matches Regular Expression');
400
-
401
- await waitForText('Regex Options');
402
- await waitForText('Select one or more:');
403
- },
404
- };
405
-
406
- export const WithIntType: Story = {
407
- args: {
408
- type: 'int',
409
- value: {
410
- value: {
411
- exp: '>=',
412
- args: [
413
- { type: 'int', value: '$local:input' },
414
- { type: 'int', value: 20 },
415
- ],
416
- },
417
- },
418
- },
419
- parameters: {
420
- docs: {
421
- description: {
422
- story:
423
- 'Renders the ExpressionBuilder with an int-typed >= expression comparing $local:input to 20 — the operands render as Number fields inside the expression card.',
424
- },
425
- },
426
- },
427
- play: async () => {
428
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
429
- },
430
- };
431
-
432
- /**
433
- * Ported from the IDE `ArgsChangeWhenOperatorChanges`: a valued
434
- * `String Contains` switches to a regex op and the argument row re-shapes —
435
- * the string args carry over (exact richtext/string matches) and the new
436
- * "Regex Options" allowed-values arg appears. Adaptation: the IDE switches to
437
- * `Does Not Match Regular Expression`; the fixture ships only the positive
438
- * `Matches Regular Expression`, which exercises the same arg-reshape path.
439
- */
440
- export const ArgsChangeWhenOperatorChanges: Story = {
441
- ...WithSimpleValue,
442
- parameters: {
443
- ...WithSimpleValue.parameters,
444
- docs: {
445
- description: {
446
- story:
447
- 'Renders the seeded "String Contains" expression, then switches the operation to "Matches Regular Expression" — the string operands carry over and the new "Regex Options" allowed-values operand appears.',
448
- },
449
- },
450
- },
451
- play: async () => {
452
- // Both string operands of the seeded `contains` render as textareas.
453
- await waitFor(
454
- () => expect(document.querySelectorAll('.expression .reqore-textarea')).toHaveLength(2),
455
- { timeout: 10000 }
456
- );
457
-
458
- await selectOperation('String Contains', 'Matches Regular Expression');
459
-
460
- await waitForText('Regex Options');
461
- },
462
- };
463
-
464
- export const NewGroupsCanBeCreated: Story = {
465
- args: {
466
- ...WithSimpleValue.args,
467
- returnType: ['bool'],
468
- },
469
- parameters: {
470
- docs: {
471
- description: {
472
- story:
473
- 'Renders the seeded "String Contains" expression, then clicks the AND and OR add-group actions — the tree grows from 1 to 3 expression cards as new grouping levels are added.',
474
- },
475
- },
476
- },
477
- play: async () => {
478
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
479
-
480
- await fireEvent.click(document.querySelector('.expression-and')!);
481
- await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
482
-
483
- await fireEvent.click(document.querySelector('.expression-or')!);
484
- await waitFor(() => expect(expressionCount()).toBe(3), { timeout: 10000 });
485
- },
486
- };
487
-
488
- export const GroupsCanBeDeleted: Story = {
489
- ...WithComplexValue,
490
- parameters: {
491
- ...WithComplexValue.parameters,
492
- docs: {
493
- description: {
494
- story:
495
- 'Renders the nested expression tree (6 cards) and removes one group — the tree shrinks to 5 cards after the delete.',
496
- },
497
- },
498
- },
499
- play: async () => {
500
- await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
501
-
502
- await sleep(1000);
503
-
504
- await userEvent.hover(document.querySelectorAll('.expression')[1]);
505
- await sleep(300);
506
- await fireEvent.click(document.querySelectorAll('.expression-group-remove')[0]);
507
-
508
- await waitFor(() => expect(expressionCount()).toBe(5), { timeout: 10000 });
509
- },
510
- };
511
-
512
- /**
513
- * The `extraActions` seam — how the IDE restores its AI-assist button when it
514
- * adopts this builder (Phase E). The factory runs per expression card and
515
- * receives that card's `selectedExpression`, exactly the context the IDE's
516
- * inline `AiAssistanceAction({ context: selectedExpression })` captured.
517
- */
518
- export const WithInjectedExtraActions: Story = {
519
- parameters: {
520
- docs: {
521
- description: {
522
- story:
523
- 'Renders the nested expression tree with an extraActions factory that injects an AI-assist button per card. Hovering an expression reveals the injected action alongside the built-in ones.',
524
- },
525
- },
526
- },
527
- args: {
528
- ...WithComplexValue.args,
529
- extraActions: ({ selectedExpression }) => [
530
- {
531
- icon: 'MagicLine',
532
- className: 'expression-ai-assist',
533
- tooltip: `AI assistance for ${selectedExpression?.display_name ?? 'this expression'}`,
534
- show: 'hover',
535
- size: 'tiny',
536
- fixed: true,
537
- onClick: fn(),
538
- },
539
- ],
540
- },
541
- play: async () => {
542
- await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
543
-
544
- // Hover actions mount on hover (same pattern as the IDE's own tests).
545
- await userEvent.hover(document.querySelectorAll('.expression')[0]);
546
- await waitFor(() =>
547
- expect(document.querySelector('.expression-ai-assist')).toBeInTheDocument()
548
- );
549
- },
550
- };
551
-
552
- // --- Variable-arguments family ----------------------------------------------
553
- // Ported from the IDE `ExpressionWithIntReturnType` / `VariableArguments*`.
554
- // Adaptation: the offline `+` (Addition) fixture entry stands in for the live
555
- // catalogue's `+`. With 4 args (2 `$local:` templates + 2 int literals) the
556
- // first arg renders inline and the 3 "rest" args each get a remove button, so
557
- // `.expression-remove-arg` starts at 3 and the templates render two
558
- // `.template-remove` chips.
559
-
560
- /** Base: a `+` (Addition) varargs expression with four int operands. */
561
- export const ExpressionWithIntReturnType: Story = {
562
- args: {
563
- type: 'int',
564
- returnType: 'int',
565
- value: {
566
- value: {
567
- exp: '+',
568
- args: [
569
- { type: 'int', value: '$local:id' },
570
- { type: 'int', value: 20 },
571
- { type: 'int', value: '$local:time' },
572
- { type: 'int', value: 10 },
573
- ],
574
- },
575
- is_expression: true,
576
- },
577
- },
578
- parameters: {
579
- docs: {
580
- description: {
581
- story:
582
- 'Renders the ExpressionBuilder with a "+" (Addition) varargs expression holding four int operands — every operand, the first included, exposes a remove-argument button.',
583
- },
584
- },
585
- },
586
- play: async () => {
587
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
588
- // Four operands → four remove-argument buttons; only the last one left
589
- // could not be removed.
590
- await waitFor(() => expect(removeArgCount()).toBe(4), { timeout: 10000 });
591
- },
592
- };
593
-
594
- /** Remove one variable argument — the remove-arg count drops from 4 to 3. */
595
- export const VariableArgumentsCanBeRemoved: Story = {
596
- ...ExpressionWithIntReturnType,
597
- parameters: {
598
- ...ExpressionWithIntReturnType.parameters,
599
- docs: {
600
- description: {
601
- story:
602
- 'Renders the "+" varargs expression and clicks one remove-argument button — one operand disappears and the remove-arg count drops from 4 to 3.',
603
- },
604
- },
605
- },
606
- play: async (args) => {
607
- await ExpressionWithIntReturnType.play!(args);
608
-
609
- await fireEvent.click(document.querySelector('.expression-remove-arg')!);
610
-
611
- await waitFor(() => expect(removeArgCount()).toBe(3), { timeout: 10000 });
612
- },
613
- };
614
-
615
- /** Remove one then add one back — the count returns to 4. */
616
- export const VariableArgumentsCanBeAdded: Story = {
617
- ...ExpressionWithIntReturnType,
618
- parameters: {
619
- ...ExpressionWithIntReturnType.parameters,
620
- docs: {
621
- description: {
622
- story:
623
- 'Renders the "+" varargs expression, removes one operand and then adds one back through the "Add value" slot after the last operand — the remove-arg count moves 4 → 3 → 4.',
624
- },
625
- },
626
- },
627
- play: async (args) => {
628
- await ExpressionWithIntReturnType.play!(args);
629
-
630
- await fireEvent.click(document.querySelector('.expression-remove-arg')!);
631
- await waitFor(() => expect(removeArgCount()).toBe(3), { timeout: 10000 });
632
-
633
- await fireEvent.click(document.querySelector('.expression-add-arg')!);
634
- await waitFor(() => expect(removeArgCount()).toBe(4), { timeout: 10000 });
635
- },
636
- };
637
-
638
- // --- Varargs reorder family -------------------------------------------------
639
- // Toolkit-only (no IDE counterpart): a varargs expression lets the user move
640
- // its operands. `reorder` picks the surface — the field's ⋮ menu by default,
641
- // a drag grip and/or a position dropdown on request. Seeded on `concat` so
642
- // the operand order is readable.
643
-
644
- const CONCAT_OPERANDS = ['first', 'second', 'third'];
645
- const OPERAND_LITERALS = [...CONCAT_OPERANDS, 'plain', '$local:some-richtext'];
646
-
647
- /**
648
- * What an operand field holds. A text operand is edited in the chip editor
649
- * (these stories offer templates), so it is read from the editable field; a
650
- * template chip in it shows the name these stories' templates give the
651
- * reference ("Richtext Template"), read back as the reference it names.
652
- */
653
- const readOperand = (field: HTMLElement): string => {
654
- if (field instanceof HTMLInputElement || field instanceof HTMLTextAreaElement) {
655
- return field.value;
656
- }
657
- const shown = (field.textContent ?? '').replace(/\uFEFF/g, '').trim();
658
- return (
659
- OPERAND_LITERALS.find(
660
- (literal) => literal === shown || templateChipLabel(localTemplates as never, literal) === shown
661
- ) ?? shown
662
- );
663
- };
664
-
665
- /** Every operand editor's text, in DOM order (no number or position inputs). */
666
- const operandTexts = () =>
667
- Array.from(
668
- document.querySelectorAll<HTMLElement>('.expression textarea, .expression [contenteditable="true"]')
669
- ).map(readOperand);
670
-
671
- /** Seeded operand values in DOM order — only the seeded ones, so stray fields don't count. */
672
- const operandValues = () =>
673
- Array.from(
674
- document.querySelectorAll<HTMLElement>(
675
- '.expression textarea, .expression input, .expression [contenteditable="true"]'
676
- )
677
- )
678
- .map(readOperand)
679
- .filter((value) => OPERAND_LITERALS.includes(value));
680
-
681
- const count = (selector: string) => document.querySelectorAll(selector).length;
682
-
683
- /** Open the `⋮` menu of the nth operand field and expand its "Move Argument" section. */
684
- const openMoveMenu = async (nth: number) => {
685
- await clickSelector('.template-more', nth);
686
- await waitForText('Move Argument');
687
- // The section's className lands on its toggle button.
688
- await clickSelector('.template-menu-actions');
689
- };
690
-
691
- /** Open the `⋮` menu of the nth operand field. */
692
- const openFieldMenu = (nth: number) => clickSelector('.template-more', nth);
693
-
694
- const waitForOrder = (order: string[]) =>
695
- waitFor(() => expect(operandValues()).toEqual(order), { timeout: 10000 });
696
-
697
- const expectReportedOrder = (context: { args: { onChange?: unknown } }, order: string[]) =>
698
- expect(context.args.onChange).toHaveBeenLastCalledWith(
699
- expect.objectContaining({
700
- value: expect.objectContaining({
701
- exp: 'concat',
702
- args: order.map((value) => ({ type: 'string', value })),
703
- }),
704
- })
705
- );
706
-
707
- const concatArgs: Story['args'] = {
708
- type: 'string',
709
- returnType: 'string',
710
- value: {
711
- value: {
712
- exp: 'concat',
713
- args: CONCAT_OPERANDS.map((value) => ({ type: 'string', value })),
714
- },
715
- is_expression: true,
716
- },
717
- };
718
-
719
- /** Base: a `concat` varargs expression with three string operands, default reorder surfaces. */
720
- export const ConcatExpression: Story = {
721
- args: concatArgs,
722
- parameters: {
723
- docs: {
724
- description: {
725
- story:
726
- 'Renders a "concat" varargs expression with three string operands ("first", "second", "third"), each edited in the chip editor a string field with templates now uses — a contenteditable box rather than a textarea, so a template reference in an operand reads as its name. By default each operand gets a drag grip and a "Move Argument" section in its ⋮ menu — opened and expanded here on the second operand to show "Move before / after / to start / to end" and, at three operands, a "Move to position" caption with a single "2nd" position dropdown beside it, opened to show 1st / 2nd / 3rd.',
727
- },
728
- },
729
- },
730
- play: async () => {
731
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
732
- await waitForOrder(CONCAT_OPERANDS);
733
- expect(removeArgCount()).toBe(3);
734
- expect(count('.expression-arg-drag-handle')).toBe(3);
735
- expect(count('.expression-arg-position')).toBe(0);
736
-
737
- await openMoveMenu(1);
738
- await waitForText('Move before');
739
- expect(count('.expression-arg-move-after')).toBe(1);
740
- expect(count('.expression-arg-move-start')).toBe(1);
741
- expect(count('.expression-arg-move-end')).toBe(1);
742
- expect(count('.expression-arg-move-to')).toBe(1);
743
- // Three operands: one position dropdown — no segments, no typed field, no "More".
744
- expect(count('.expression-arg-move-to-picker')).toBe(1);
745
- expect(count('.expression-arg-move-to-input')).toBe(0);
746
- expect(count('.expression-arg-move-to-more')).toBe(0);
747
- // Open the picker so the capture shows its three positions.
748
- await clickSelector('.expression-arg-move-to-picker');
749
- await waitForText('3rd');
750
- },
751
- };
752
-
753
- const LONG_OPERANDS = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh'];
754
-
755
- /** Seven operands: the strip grows a typed field and a "More" list past the four segments. */
756
- export const ReorderLongConcat: Story = {
757
- args: {
758
- ...concatArgs,
759
- value: {
760
- value: {
761
- exp: 'concat',
762
- args: LONG_OPERANDS.map((value) => ({ type: 'string', value })),
763
- },
764
- is_expression: true,
765
- },
766
- },
767
- parameters: {
768
- docs: {
769
- description: {
770
- story:
771
- 'Renders a seven-operand "concat": typing 6 and Enter into the second operand\'s "Move to position" field moves it to sixth, "More → 7th" moves it last, and the menu is then reopened on that operand with "Move Argument" expanded and "More" open — the strip shows the segments 1–4, the number field for 5–7 with its arrow, and the list 5th / 6th / 7th with 7th (the current position) disabled. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
772
- },
773
- },
774
- },
775
- play: async (context) => {
776
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
777
- await waitFor(() => expect(count('.expression-arg-drag-handle')).toBe(7), { timeout: 10000 });
778
-
779
- await openMoveMenu(1);
780
- await waitForText('Move to position');
781
- expect(count('.expression-arg-move-to-4')).toBe(1);
782
- expect(count('.expression-arg-move-to-input')).toBe(1);
783
- expect(count('.expression-arg-move-to-more')).toBe(1);
784
-
785
- // change + keyDown rather than `userEvent.type`: the typing helper also
786
- // emits hover events, which React bubbles through the popover's portal to
787
- // the panel and raises its floating "Wrap" layer over the capture.
788
- const field = document.querySelector<HTMLInputElement>('.expression-arg-move-to-input')!;
789
- await fireEvent.change(field, { target: { value: '6' } });
790
- await fireEvent.keyDown(field, { key: 'Enter' });
791
- await waitFor(
792
- () =>
793
- expect(operandTexts()).toEqual(['first', 'third', 'fourth', 'fifth', 'sixth', 'second', 'seventh']),
794
- { timeout: 10000 }
795
- );
796
-
797
- await openMoveMenu(5);
798
- await waitForText('Move to position');
799
- await clickSelector('.expression-arg-move-to-more');
800
- await waitForText('7th');
801
- await clickSelector('.expression-arg-move-to-7');
802
- await waitFor(
803
- () =>
804
- expect(operandTexts()).toEqual(['first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'second']),
805
- { timeout: 10000 }
806
- );
807
- expect(context.args.onChange).toHaveBeenLastCalledWith(
808
- expect.objectContaining({
809
- value: expect.objectContaining({
810
- args: ['first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'second'].map(
811
- (value) => ({ type: 'string', value })
812
- ),
813
- }),
814
- })
815
- );
816
-
817
- // Leave the strip and its "More" list on screen for the capture.
818
- await openMoveMenu(6);
819
- await waitForText('Move to position');
820
- await clickSelector('.expression-arg-move-to-more');
821
- await waitForText('5th');
822
- // A remounted operand refetches the expression catalogue; the "Use
823
- // Expression" row is a skeleton until that settles, so wait it out.
824
- await waitFor(() => expect(count('.reqore-skeleton')).toBe(0), { timeout: 30000 });
825
- },
826
- };
827
-
828
- /** `reorder: ['overflowMenu']` — "Move to start", "Move after", then "Move to position". */
829
- export const ReorderViaOverflowMenu: Story = {
830
- args: { ...concatArgs, reorder: ['overflowMenu'] },
831
- parameters: {
832
- docs: {
833
- description: {
834
- story:
835
- 'Renders the "concat" expression with only the ⋮ menu surface (no grip) and reorders it through the "Move Argument" section: "Move to start" on the third operand, "Move after" on the operand that is now second, then "3rd" from the "Move to position" dropdown on the first — the order goes first/second/third → third/first/second → third/second/first → second/first/third, each move closes its menu, and onChange reports the reordered args. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
836
- },
837
- },
838
- },
839
- play: async (context) => {
840
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
841
- await waitForOrder(CONCAT_OPERANDS);
842
- expect(count('.expression-arg-drag-handle')).toBe(0);
843
-
844
- await openMoveMenu(2);
845
- await waitForText('Move to start');
846
- await clickSelector('.expression-arg-move-start');
847
- await waitForOrder(['third', 'first', 'second']);
848
- // A move closes the menu it came from.
849
- await waitFor(() => expect(count('.expression-arg-move-start')).toBe(0), { timeout: 10000 });
850
-
851
- await openMoveMenu(1);
852
- await waitForText('Move after');
853
- await clickSelector('.expression-arg-move-after');
854
- await waitForOrder(['third', 'second', 'first']);
855
-
856
- await openMoveMenu(0);
857
- await waitForText('Move to position');
858
- await clickSelector('.expression-arg-move-to-picker');
859
- await waitForText('3rd');
860
- await clickSelector('.expression-arg-move-to-3');
861
- await waitForOrder(['second', 'first', 'third']);
862
-
863
- expectReportedOrder(context, ['second', 'first', 'third']);
864
- },
865
- };
866
-
867
- /** `reorder: ['dragHandle']` — a grip before each operand, no menu rows. */
868
- export const ReorderViaDragHandle: Story = {
869
- args: { ...concatArgs, reorder: ['dragHandle'] },
870
- parameters: {
871
- docs: {
872
- description: {
873
- story:
874
- 'Renders the "concat" expression with a drag grip before each operand and no "Move Argument" section in the ⋮ menu. Dragging the third operand onto the first puts it first — the order becomes third/first/second. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
875
- },
876
- },
877
- },
878
- play: async (context) => {
879
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
880
- await waitForOrder(CONCAT_OPERANDS);
881
- expect(count('.expression-arg-drag-handle')).toBe(3);
882
- expect(count('.expression-arg-position')).toBe(0);
883
-
884
- await openFieldMenu(1);
885
- await waitForText('Use Template');
886
- expect(count('.template-menu-actions')).toBe(0);
887
-
888
- const handles = document.querySelectorAll('.expression-arg-drag-handle');
889
- const target = handles[0].closest('.expression-arg')!;
890
- expect(handles[2].getAttribute('draggable')).toBe('true');
891
- await fireEvent.dragStart(handles[2]);
892
- await fireEvent.dragOver(target);
893
- await fireEvent.drop(target);
894
- await fireEvent.dragEnd(handles[2]);
895
-
896
- await waitForOrder(['third', 'first', 'second']);
897
- expectReportedOrder(context, ['third', 'first', 'second']);
898
- },
899
- };
900
-
901
- // --- Add value slot ---------------------------------------------------------
902
- // A varargs expression adds its next operand through a dashed slot rendered
903
- // after the last one, where the value will appear — not through a header
904
- // icon. Keyed on `concat` so the label reads "Add value".
905
-
906
- const addSlot = () => document.querySelector<HTMLButtonElement>('.expression-add-arg');
907
-
908
- /** The slot is the last thing in the operand row, and clicking it adds a focused, empty operand. */
909
- export const AddValueSlot: Story = {
910
- args: concatArgs,
911
- parameters: {
912
- docs: {
913
- description: {
914
- story:
915
- 'Renders the "concat" expression with the dashed "Add value" slot after the third operand — the only add control, no header icon. Clicking it appends a fourth, empty operand that takes focus, the slot moves after it, and onChange reports four args.',
916
- },
917
- },
918
- },
919
- play: async (context) => {
920
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
921
- await waitForOrder(CONCAT_OPERANDS);
922
-
923
- const slot = addSlot()!;
924
- expect(slot.textContent).toContain('Add value');
925
- expect(slot).toBeEnabled();
926
- // Last in the operand group, after every operand.
927
- expect(slot.nextElementSibling).toBeNull();
928
- expect(count('.expression-arg')).toBe(3);
929
- expect(document.querySelector('.reqore-panel-title .expression-add-arg')).toBeNull();
930
-
931
- await fireEvent.click(slot);
932
-
933
- await waitFor(() => expect(count('.expression-arg')).toBe(4), { timeout: 10000 });
934
- const operands = document.querySelectorAll('.expression-arg');
935
- const added = operands[operands.length - 1];
936
- await waitFor(() => expect(added.contains(document.activeElement)).toBe(true), {
937
- timeout: 10000,
938
- });
939
- // Still after the last operand.
940
- expect(addSlot()!.nextElementSibling).toBeNull();
941
- expect(context.args.onChange).toHaveBeenLastCalledWith(
942
- expect.objectContaining({
943
- value: expect.objectContaining({
944
- exp: 'concat',
945
- args: expect.arrayContaining([
946
- ...CONCAT_OPERANDS.map((value) => ({ type: 'string', value })),
947
- ]),
948
- }),
949
- })
950
- );
951
- const reported = (context.args.onChange as ReturnType<typeof fn>).mock.lastCall?.[0];
952
- expect(reported.value.args).toHaveLength(4);
953
- },
954
- };
955
-
956
- /** An incomplete expression keeps the slot visible but disabled, saying why. */
957
- export const AddValueSlotWhileIncomplete: Story = {
958
- args: {
959
- ...concatArgs,
960
- value: {
961
- value: {
962
- exp: 'concat',
963
- args: [
964
- { type: 'string', value: 'first' },
965
- { type: 'string', value: 'second' },
966
- { type: 'string' },
967
- ],
968
- },
969
- is_expression: true,
970
- },
971
- },
972
- parameters: {
973
- docs: {
974
- description: {
975
- story:
976
- 'Renders the "concat" expression with its third operand still empty — the "Add value" slot stays where it is but is disabled, and its tooltip says to fill in the current values first.',
977
- },
978
- },
979
- },
980
- play: async () => {
981
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
982
- await waitFor(() => expect(addSlot()).toBeDisabled(), { timeout: 10000 });
983
- expect(count('.expression-arg')).toBe(3);
984
- },
985
- };
986
-
987
- /** The slot is also the "move to end" drop target for the drag grip. */
988
- export const AddValueSlotDropToEnd: Story = {
989
- args: { ...concatArgs, reorder: ['dragHandle'] },
990
- parameters: {
991
- docs: {
992
- description: {
993
- story:
994
- 'Renders the "concat" expression with drag grips and drops the first operand onto the "Add value" slot — the operand moves to the end, so the order becomes second/third/first, and onChange reports it.',
995
- },
996
- },
997
- },
998
- play: async (context) => {
999
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1000
- await waitForOrder(CONCAT_OPERANDS);
1001
-
1002
- const handles = document.querySelectorAll('.expression-arg-drag-handle');
1003
- const slot = addSlot()!;
1004
- await fireEvent.dragStart(handles[0]);
1005
- await fireEvent.dragOver(slot);
1006
- await fireEvent.drop(slot);
1007
- await fireEvent.dragEnd(handles[0]);
1008
-
1009
- await waitForOrder(['second', 'third', 'first']);
1010
- expectReportedOrder(context, ['second', 'third', 'first']);
1011
- expect(count('.expression-arg')).toBe(3);
1012
- },
1013
- };
1014
-
1015
- /** On a phone the operands stack, and the slot is simply the last row. */
1016
- export const AddValueSlotOnPhone: Story = {
1017
- args: concatArgs,
1018
- parameters: {
1019
- qlip: { viewport: { width: 390, height: 844 } },
1020
- docs: {
1021
- description: {
1022
- story:
1023
- 'Renders the phone presentation of the "concat" expression — the operands stack into a column and the "Add value" slot becomes a full-width row under them, with the plus and label centred.',
1024
- },
1025
- },
1026
- },
1027
- play: async () => {
1028
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1029
- await waitForOrder(CONCAT_OPERANDS);
1030
- const slot = addSlot()!;
1031
- expect(slot).toBeEnabled();
1032
- expect(slot.nextElementSibling).toBeNull();
1033
- },
1034
- };
1035
-
1036
- /**
1037
- * The expression panels, nested or not, that reach past the box of the one they are nested in: none
1038
- * should. A nested expression is indented; at its full width the indent pushed its right edge - and the
1039
- * actions that float above it on hover - past its parent, and past a narrow screen's edge.
1040
- */
1041
- const panelsPastTheirParent = () =>
1042
- [...document.querySelectorAll<HTMLElement>('.expression, .reqore-panel')]
1043
- .filter((panel) => panel.getBoundingClientRect().width > 0)
1044
- .map((panel) => {
1045
- const parent = panel.parentElement!.getBoundingClientRect();
1046
- const box = panel.getBoundingClientRect();
1047
- return { panel: panel.className.split(' ').pop(), over: Math.round(box.right - parent.right) };
1048
- })
1049
- .filter(({ over }) => over > 0);
1050
-
1051
- /** The controls of an expression's title (its operation, its actions) that reach past its panel: none should. */
1052
- const titlesPastTheirPanel = () =>
1053
- [...document.querySelectorAll<HTMLElement>('.expression')].flatMap((panel) => {
1054
- const box = panel.getBoundingClientRect();
1055
- return [...panel.querySelectorAll<HTMLElement>('.expression-operator-selector, .reqore-panel-title button')]
1056
- .filter((control) => control.closest('.expression') === panel && control.getBoundingClientRect().width > 0)
1057
- .map((control) => Math.round(control.getBoundingClientRect().right - box.right))
1058
- .filter((over) => over > 0);
1059
- });
1060
-
1061
- /** The column a 320px screen leaves the condition, and narrower ones a form's indents leave it. */
1062
- const NARROW_COLUMNS = [320, 280, 240, 200, 186];
1063
-
1064
- /**
1065
- * The order's fields, for the narrow-column stories: the operands refer to them, and a field picker
1066
- * whose value is not among its templates has nothing to offer - it is drawn disabled, and the operand
1067
- * reads as read-only.
1068
- */
1069
- const orderTemplates = {
1070
- label: 'Order',
1071
- items: [
1072
- {
1073
- label: 'Order',
1074
- badge: 'Order',
1075
- items: [
1076
- { label: 'Quantity', badge: 'int', value: '$local:quantity' },
1077
- { label: 'Price', badge: 'int', value: '$local:price' },
1078
- ],
1079
- },
1080
- ],
1081
- } as any;
1082
-
1083
- /** A comparison with the longest operation name nested in an "AND" group, in a column it can narrow. */
1084
- export const NestedFitsNarrowColumn: Story = {
1085
- args: {
1086
- localTemplates: orderTemplates,
1087
- value: {
1088
- is_expression: true,
1089
- value: {
1090
- exp: '&&',
1091
- args: [
1092
- {
1093
- is_expression: true,
1094
- value: {
1095
- exp: '>=',
1096
- args: [
1097
- { type: 'int', value: '$local:quantity' },
1098
- { type: 'int', value: 100 },
1099
- ],
1100
- },
1101
- },
1102
- {
1103
- is_expression: true,
1104
- value: {
1105
- exp: '>=',
1106
- args: [
1107
- { type: 'int', value: '$local:price' },
1108
- { type: 'int', value: 5 },
1109
- ],
1110
- },
1111
- },
1112
- ],
1113
- },
1114
- },
1115
- },
1116
- decorators: [
1117
- (Story) => (
1118
- <div className='narrow-column' style={{ width: NARROW_COLUMNS[0], maxWidth: '100%' }}>
1119
- <Story />
1120
- </div>
1121
- ),
1122
- ],
1123
- parameters: {
1124
- qlip: { viewport: { width: 320, height: 800 } },
1125
- docs: {
1126
- description: {
1127
- story:
1128
- 'Renders two "Logical Greater Than Or Equal" comparisons nested in an "AND" group, in a column narrowed from 320px to 186px - what a 320px screen leaves a condition in a form - and shown at 186px: each nested expression is indented and stays inside the group, its operation name shortened to fit, so the actions that float above it on hover stay on the screen.',
1129
- },
1130
- },
1131
- },
1132
- play: async ({ canvasElement }) => {
1133
- await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
1134
- // editable: every control of the operands can be used (a field picker with nothing to offer is disabled)
1135
- expect(
1136
- [...canvasElement.querySelectorAll<HTMLButtonElement>('.expression-arg button')].filter((b) => b.disabled).map((b) => b.textContent)
1137
- ).toEqual([]);
1138
- const column = canvasElement.querySelector('.narrow-column') as HTMLElement;
1139
- // as narrow as a 320px screen leaves the condition, and narrower
1140
- for (const width of NARROW_COLUMNS) {
1141
- column.style.width = `${width}px`;
1142
- await waitFor(
1143
- () =>
1144
- expect({ width, past: panelsPastTheirParent(), titles: titlesPastTheirPanel() }).toEqual({
1145
- width,
1146
- past: [],
1147
- titles: [],
1148
- }),
1149
- { timeout: 10000 }
1150
- );
1151
- // the operation stays readable: named in full in a 320px column, and shortened, not crushed, below
1152
- const selector = canvasElement.querySelector('.expression .expression-operator-selector') as HTMLElement;
1153
- const name = selector.querySelector('.reqore-button-text-content') as HTMLElement;
1154
- const shown = { width, selector: Math.round(selector.getBoundingClientRect().width) >= 60, full: name.scrollWidth <= name.clientWidth + 1 };
1155
- expect(shown).toEqual({ width, selector: true, full: width === NARROW_COLUMNS[0] ? true : shown.full });
1156
- }
1157
- },
1158
- };
1159
-
1160
- /**
1161
- * The controls of the operands (a value or a field, its clear button, its `⋮` menu) that reach past their
1162
- * operand's row, or a row past its expression: none should, or a control is cut off or hangs outside.
1163
- */
1164
- const operandControlsPastTheirRow = () =>
1165
- [...document.querySelectorAll<HTMLElement>('.expression-arg')].flatMap((row) => {
1166
- const box = row.getBoundingClientRect();
1167
- const panel = (row.closest('.expression') as HTMLElement).getBoundingClientRect();
1168
- const right = Math.min(box.right, panel.right);
1169
- return [...row.querySelectorAll<HTMLElement>('button, input, .reqore-tag')]
1170
- .filter((control) => control.closest('.expression-arg') === row && control.getBoundingClientRect().width > 0)
1171
- .map((control) => ({
1172
- control: control.className.split(' ').filter((c) => !/^sc-/.test(c)).pop() ?? control.tagName,
1173
- over: Math.round(control.getBoundingClientRect().right - right),
1174
- }))
1175
- .filter(({ over }) => over > 0);
1176
- });
1177
-
1178
- /** The same condition's operands - a field and a number each - in a column narrowed to 186px. */
1179
- export const OperandsFitNarrowColumn: Story = {
1180
- args: NestedFitsNarrowColumn.args,
1181
- decorators: NestedFitsNarrowColumn.decorators,
1182
- parameters: {
1183
- qlip: { viewport: { width: 320, height: 800 } },
1184
- docs: {
1185
- description: {
1186
- story:
1187
- 'Renders the nested "AND" condition in a column narrowed from 320px to 186px - what a 320px screen leaves a condition in a form - and shown at 186px: each operand\'s value or field, its clear button and its ⋮ menu stay inside the operand\'s row, the field shortened to fit.',
1188
- },
1189
- },
1190
- },
1191
- play: async ({ canvasElement }) => {
1192
- await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
1193
- // editable: the operands' controls are all usable, so their narrow layout is the editing one
1194
- expect(
1195
- [...canvasElement.querySelectorAll<HTMLButtonElement>('.expression-arg button')].filter((b) => b.disabled).map((b) => b.textContent)
1196
- ).toEqual([]);
1197
- const column = canvasElement.querySelector('.narrow-column') as HTMLElement;
1198
- for (const width of NARROW_COLUMNS) {
1199
- column.style.width = `${width}px`;
1200
- await waitFor(
1201
- () => expect({ width, past: operandControlsPastTheirRow() }).toEqual({ width, past: [] }),
1202
- { timeout: 10000 }
1203
- );
1204
- }
1205
- },
1206
- };
1207
-
1208
- /**
1209
- * On a phone the remove action leaves the operand row for its ⋮ menu. The play
1210
- * runs at the runner's desktop viewport, where the inline buttons are the
1211
- * route, and leaves the second operand's menu open; the capture, taken at
1212
- * phone width, shows that menu with "Remove value" as its last row and no
1213
- * remove button beside any field.
1214
- */
1215
- export const RemoveValueOnPhone: Story = {
1216
- args: concatArgs,
1217
- parameters: {
1218
- qlip: { viewport: { width: 390, height: 844 } },
1219
- docs: {
1220
- description: {
1221
- story:
1222
- 'Renders the phone presentation of the "concat" expression with the second operand\'s ⋮ menu open — the operand row has no remove button; "Remove value" is the last row of the menu, after a divider, and the "Add value" slot is the full-width row under the operands.',
1223
- },
1224
- },
1225
- },
1226
- play: async () => {
1227
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1228
- await waitForOrder(CONCAT_OPERANDS);
1229
- // Desktop viewport during play: every operand removes inline.
1230
- expect(count('.expression-remove-arg')).toBe(3);
1231
- await openFieldMenu(1);
1232
- await waitForText('Use Template');
1233
- },
1234
- };
1235
-
1236
- /** The first operand goes like any other; the last one left has no remove. */
1237
- export const FirstValueCanBeRemoved: Story = {
1238
- args: concatArgs,
1239
- parameters: {
1240
- docs: {
1241
- description: {
1242
- story:
1243
- 'Renders the "concat" expression and removes the first operand, then the first again — the order goes first/second/third → second/third → third, onChange reports each step, and the last operand left carries no remove button.',
1244
- },
1245
- },
1246
- },
1247
- play: async (context) => {
1248
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1249
- await waitForOrder(CONCAT_OPERANDS);
1250
- expect(count('.expression-remove-arg')).toBe(3);
1251
-
1252
- await clickSelector('.expression-remove-arg', 0);
1253
- await waitForOrder(['second', 'third']);
1254
- expectReportedOrder(context, ['second', 'third']);
1255
- expect(count('.expression-remove-arg')).toBe(2);
1256
-
1257
- await clickSelector('.expression-remove-arg', 0);
1258
- await waitForOrder(['third']);
1259
- expectReportedOrder(context, ['third']);
1260
- expect(count('.expression-remove-arg')).toBe(0);
1261
- },
1262
- };
1263
-
1264
- /** Read-only: no slot, nothing to add. */
1265
- export const AddValueSlotReadOnly: Story = {
1266
- args: { ...concatArgs, readOnly: true },
1267
- parameters: {
1268
- docs: {
1269
- description: {
1270
- story:
1271
- 'Renders the "concat" expression read-only — the three operands are shown and the "Add value" slot is absent.',
1272
- },
1273
- },
1274
- },
1275
- play: async () => {
1276
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1277
- await waitForOrder(CONCAT_OPERANDS);
1278
- expect(addSlot()).toBeNull();
1279
- },
1280
- };
1281
-
1282
- /** A template operand moved past a literal: each field shows the operand now in its slot. */
1283
- export const ReorderKeepsTemplateOperand: Story = {
1284
- args: {
1285
- ...concatArgs,
1286
- value: {
1287
- value: {
1288
- exp: 'concat',
1289
- args: [
1290
- { type: 'string', value: '$local:some-richtext' },
1291
- { type: 'string', value: 'plain' },
1292
- ],
1293
- },
1294
- is_expression: true,
1295
- },
1296
- },
1297
- parameters: {
1298
- docs: {
1299
- description: {
1300
- story:
1301
- 'Renders a "concat" (default surfaces: grip and ⋮ menu) whose first operand is the template reference "$local:some-richtext" and whose second is the literal "plain". "Move to end" on the template operand swaps them — the literal now sits first and the reference second, each in its own field, and nothing shows the reference twice.',
1302
- },
1303
- },
1304
- },
1305
- play: async (context) => {
1306
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1307
- await waitForOrder(['$local:some-richtext', 'plain']);
1308
-
1309
- await openMoveMenu(0);
1310
- await waitForText('Move to end');
1311
- await clickSelector('.expression-arg-move-end');
1312
-
1313
- // Without remounting the slots, slot 0 would keep its template state and
1314
- // still show the reference while the literal showed nowhere.
1315
- await waitForOrder(['plain', '$local:some-richtext']);
1316
- expect(context.args.onChange).toHaveBeenLastCalledWith(
1317
- expect.objectContaining({
1318
- value: expect.objectContaining({
1319
- exp: 'concat',
1320
- args: [
1321
- { type: 'string', value: 'plain' },
1322
- { type: 'string', value: '$local:some-richtext' },
1323
- ],
1324
- }),
1325
- })
1326
- );
1327
- },
1328
- };
1329
-
1330
- /** `reorder: ['positionPicker']` — an ordinal dropdown before each operand. */
1331
- export const ReorderViaPositionPicker: Story = {
1332
- args: { ...concatArgs, reorder: ['positionPicker'] },
1333
- parameters: {
1334
- docs: {
1335
- description: {
1336
- story:
1337
- 'Renders the "concat" expression with each operand\'s position ("1st", "2nd", "3rd") as a dropdown before its field. Picking "1st" on the third operand moves it to the front — the order becomes third/first/second. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
1338
- },
1339
- },
1340
- },
1341
- play: async (context) => {
1342
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1343
- await waitForOrder(CONCAT_OPERANDS);
1344
- expect(count('.expression-arg-position')).toBe(3);
1345
- expect(count('.expression-arg-drag-handle')).toBe(0);
1346
-
1347
- await clickSelector('.expression-arg-position', 2);
1348
- // The open list adds a second "1st" — the first is the first operand's own trigger.
1349
- await waitFor(() => expect(within(document.body).queryAllByText('1st').length).toBe(2), {
1350
- timeout: 10000,
1351
- });
1352
- const items = within(document.body).queryAllByText('1st');
1353
- await fireEvent.click(items[items.length - 1]);
1354
-
1355
- await waitForOrder(['third', 'first', 'second']);
1356
- expectReportedOrder(context, ['third', 'first', 'second']);
1357
- },
1358
- };
1359
-
1360
- /** Every surface at once. */
1361
- export const ReorderAllSurfaces: Story = {
1362
- args: { ...concatArgs, reorder: ['overflowMenu', 'dragHandle', 'positionPicker'] },
1363
- parameters: {
1364
- docs: {
1365
- description: {
1366
- story:
1367
- 'Renders the "concat" expression with every reorder surface at once — a drag grip and a position dropdown before each operand, plus the "Move Argument" section in the ⋮ menu, opened and expanded on the second operand. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
1368
- },
1369
- },
1370
- },
1371
- play: async () => {
1372
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1373
- await waitForOrder(CONCAT_OPERANDS);
1374
- expect(count('.expression-arg-drag-handle')).toBe(3);
1375
- expect(count('.expression-arg-position')).toBe(3);
1376
-
1377
- await openMoveMenu(1);
1378
- await waitForText('Move before');
1379
- },
1380
- };
1381
-
1382
- /** `reorder: false` — nothing but the remove buttons. */
1383
- export const ReorderDisabled: Story = {
1384
- args: { ...concatArgs, reorder: false },
1385
- parameters: {
1386
- docs: {
1387
- description: {
1388
- story:
1389
- 'Renders the "concat" expression with reordering turned off — no grip, no position dropdown, and the ⋮ menu (opened on the second operand) has no "Move Argument" section; only the remove buttons remain. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
1390
- },
1391
- },
1392
- },
1393
- play: async () => {
1394
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1395
- await waitForOrder(CONCAT_OPERANDS);
1396
- expect(removeArgCount()).toBe(3);
1397
- expect(count('.expression-arg-drag-handle')).toBe(0);
1398
- expect(count('.expression-arg-position')).toBe(0);
1399
-
1400
- await openFieldMenu(1);
1401
- await waitForText('Use Template');
1402
- expect(count('.template-menu-actions')).toBe(0);
1403
- },
1404
- };
1405
-
1406
- /** Phone width: the operands stack, the ⋮ menu still carries the move rows. */
1407
- export const ReorderOnPhone: Story = {
1408
- args: { ...concatArgs, reorder: ['overflowMenu', 'dragHandle', 'positionPicker'] },
1409
- parameters: {
1410
- qlip: { viewport: { width: 390, height: 844 } },
1411
- docs: {
1412
- description: {
1413
- story:
1414
- 'Renders the phone presentation of the "concat" expression with every reorder surface — the operands stack into a column, each keeps its grip and position dropdown, and the ⋮ menu (opened and expanded on the second operand) still carries the "Move Argument" section, so reordering needs no hover or drag. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
1415
- },
1416
- },
1417
- },
1418
- play: ReorderAllSurfaces.play,
1419
- };
1420
-
1421
- // --- Wrap / unwrap family ---------------------------------------------------
1422
- // Ported from the IDE `ExpressionCanBeWrapped` / `ExpressionCanBeUnwrapped`.
1423
- // Adaptations: (1) the offline `Convert to Boolean` (base op) and `Join List
1424
- // Elements` (wrap target) fixture entries stand in for the live catalogue.
1425
- // (2) The IDE starts from an empty `Default` and *selects* the base op fresh;
1426
- // here a valued `convert-to-boolean` is *seeded* so the story stays focused
1427
- // on its actual subject — the wrap (and unwrap) interaction. (The historical
1428
- // "fresh op-select paints an empty card" blocker was the Select collection
1429
- // modal collapsing the card panel — fixed in `SelectFormField`; fresh
1430
- // selection is covered by `WithArgWithAllowedValues` above.)
1431
-
1432
- /** A seeded `Convert to Boolean` whose operand carries a template value. */
1433
- const seededConvert: IExpression = {
1434
- is_expression: true,
1435
- value: {
1436
- exp: 'convert-to-boolean',
1437
- args: [{ type: 'richtext', value: '$local:some-richtext' }],
1438
- },
1439
- };
1440
-
1441
- /** Wrap a seeded expression inside another op (Join List Elements). */
1442
- export const ExpressionCanBeWrapped: Story = {
1443
- args: {
1444
- returnType: ['string', 'int'],
1445
- value: seededConvert,
1446
- },
1447
- parameters: {
1448
- docs: {
1449
- description: {
1450
- story:
1451
- 'Renders a seeded "Convert to Boolean" expression, hovers the card and picks "Join List Elements" from the Wrap picker — the outer op mounts and the original expression becomes its first operand.',
1452
- },
1453
- },
1454
- },
1455
- play: async ({ canvasElement }) => {
1456
- // Seeded base op + its operand render.
1457
- await waitFor(() => expect(expressionCount(canvasElement)).toBe(1), { timeout: 10000 });
1458
- await waitForText('Value To Convert', canvasElement);
1459
-
1460
- // Hover the card to reveal the floating "Wrap" picker, then wrap it in
1461
- // `Join List Elements` — the wrapped op becomes its first operand and the
1462
- // outer card shows "List To Join". The card count goes 1 → 2.
1463
- await userEvent.hover(canvasElement.querySelectorAll('.expression')[0]);
1464
- await sleep(500);
1465
- await selectOperation('Wrap', 'Join List Elements', canvasElement.ownerDocument);
1466
- await waitForText('List To Join', canvasElement);
1467
- await waitFor(() => expect(expressionCount(canvasElement)).toBe(2), { timeout: 10000 });
1468
- },
1469
- };
1470
-
1471
- /** Wrap, then unwrap — back to a single expression card. */
1472
- export const ExpressionCanBeUnwrapped: Story = {
1473
- ...ExpressionCanBeWrapped,
1474
- parameters: {
1475
- ...ExpressionCanBeWrapped.parameters,
1476
- docs: {
1477
- description: {
1478
- story:
1479
- 'Renders the wrapped expression from ExpressionCanBeWrapped, then hovers and unwraps the outer op — the inner "Convert to Boolean" survives and the outer wrapper is removed.',
1480
- },
1481
- },
1482
- },
1483
- play: async (args) => {
1484
- await ExpressionCanBeWrapped.play!(args);
1485
-
1486
- // Unwrap the outer op (keep the child) — the `.expression-unwrap` action.
1487
- await userEvent.hover(args.canvasElement.querySelectorAll('.expression')[0]);
1488
- await sleep(500);
1489
- // The card's actions are ReQore *floating* actions, so they are portalled out
1490
- // of the canvas — this one lookup stays document-scoped on purpose.
1491
- await clickSelector('.expression-unwrap');
1492
-
1493
- await waitFor(() => expect(expressionCount(args.canvasElement)).toBe(1), { timeout: 10000 });
1494
- },
1495
- };
1496
-
1497
- // --- Mismatched-argument confirmation family (Tier B) -----------------------
1498
- // Ported from the IDE `FunctionArgs…NeedConfirmation` + its Accept-all /
1499
- // Discard-all / Confirm-selection variants. These exercise
1500
- // `ConfirmMismatchedTypesModal` and its three submit handlers
1501
- // (`updateMultipleArgs` → Discard / Accept all / Confirm selection).
1502
- //
1503
- // HOW THE MODAL FIRES: the builder flags an argument `types_mismatch: true`
1504
- // when its value's type is *accepted but not exact* for the operand schema
1505
- // (`updateExp`, builder/index.tsx ~313: `getAcceptedTypes` includes it / `any`
1506
- // but `getExactMatches` does not). The modal renders whenever any visible arg
1507
- // carries that flag (`hasArgumentsWithTypeMismatch`, index.tsx ~810).
1508
- //
1509
- // `FunctionArgsArePassedToNewFunctionAndNeedConfirmation` drives the REAL
1510
- // IDE trigger: a valued `Format Date` switches to a string op, carrying its
1511
- // `date` first arg into a `richtext` operand (accepted-but-not-exact → flag →
1512
- // modal). This op-switch used to paint an empty card offline — the Select
1513
- // collection modal's item click collapsed the card panel (fixed in
1514
- // `SelectFormField`) — which is why the three handler variants below SEED the
1515
- // `types_mismatch` flag instead: their subject is the modal's three submit
1516
- // handlers, and seeding keeps each handler test single-step deterministic.
1517
-
1518
- /**
1519
- * A seeded `String Contains` whose first arg is flagged `types_mismatch` — the
1520
- * accepted-but-not-exact state the builder produces when an op-switch passes an
1521
- * incompatible arg into a new function. The deterministic precondition for the
1522
- * three submit-handler variants; the real op-switch trigger is exercised by
1523
- * `FunctionArgsArePassedToNewFunctionAndNeedConfirmation`.
1524
- */
1525
- const seededMismatch: IExpression = {
1526
- is_expression: true,
1527
- value: {
1528
- exp: 'contains',
1529
- args: [
1530
- { type: 'string', value: '$local:input', is_expression: false, required: true, types_mismatch: true },
1531
- { type: 'string', value: 'es', is_expression: false, required: true },
1532
- { type: 'bool', value: true, is_expression: false, required: true },
1533
- ],
1534
- },
1535
- };
1536
-
1537
- /** Seeded-modal base for the three submit-handler variants (not exported). */
1538
- const SeededMismatchBase: Story = {
1539
- args: {
1540
- returnType: ['string', 'int'],
1541
- value: seededMismatch,
1542
- },
1543
- play: async () => {
1544
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1545
- // The modal mounts with its title and per-argument transform copy.
1546
- await waitForText('Confirm type selection for mismatched arguments');
1547
- await waitForText(/will be transformed|deselect the arguments/i);
1548
- },
1549
- };
1550
-
1551
- /**
1552
- * The REAL trigger, IDE-parity (`ExpressionBuilder.stories` line 592 family):
1553
- * a valued `Format Date` is switched to `Matches Regular Expression`, whose
1554
- * first operand is `richtext` — the carried `date` arg is accepted-but-not-
1555
- * exact, so the builder flags it and the confirmation modal mounts.
1556
- */
1557
- export const FunctionArgsArePassedToNewFunctionAndNeedConfirmation: Story = {
1558
- parameters: {
1559
- docs: {
1560
- description: {
1561
- story:
1562
- 'Renders a valued "Format Date" expression and switches the operation to "Matches Regular Expression" — the carried date arg is accepted-but-not-exact for the new richtext operand and the mismatched-arguments confirmation modal mounts.',
1563
- },
1564
- },
1565
- },
1566
- args: {
1567
- returnType: 'string',
1568
- value: {
1569
- is_expression: true,
1570
- type: 'string',
1571
- value: {
1572
- exp: 'format_date',
1573
- args: [
1574
- {
1575
- type: 'date',
1576
- value: '2025-11-05T23:00:00.000Z',
1577
- is_expression: false,
1578
- required: true,
1579
- },
1580
- {
1581
- type: 'richtext',
1582
- value: [{ type: 'paragraph', children: [{ text: 'YYYY-MM-DD' }] }],
1583
- is_expression: false,
1584
- required: true,
1585
- },
1586
- ],
1587
- },
1588
- },
1589
- },
1590
- play: async () => {
1591
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1592
- await waitForText('Date To Format');
1593
-
1594
- await selectOperation('Format Date', 'Matches Regular Expression');
1595
-
1596
- await waitForText('Confirm type selection for mismatched arguments');
1597
- },
1598
- };
1599
-
1600
- /** "Confirm selection" keeps the (still-selected) mismatched arg, transformed. */
1601
- export const AcceptIncompatibleFunctionArgsSelection: Story = {
1602
- ...SeededMismatchBase,
1603
- parameters: {
1604
- ...SeededMismatchBase.parameters,
1605
- docs: {
1606
- description: {
1607
- story:
1608
- 'Renders the seeded mismatch-flagged expression, then clicks "Confirm selection" on the mismatched-arguments modal — the (still-selected) argument is kept and transformed to the new expected type.',
1609
- },
1610
- },
1611
- },
1612
- play: async (args) => {
1613
- await SeededMismatchBase.play!(args);
1614
-
1615
- await sleep(500);
1616
- await clickButtonByLabel('Confirm selection');
1617
- // Modal dismissed; one card remains.
1618
- await waitFor(
1619
- () =>
1620
- expect(
1621
- within(document.body).queryByText('Confirm type selection for mismatched arguments')
1622
- ).toBeNull(),
1623
- { timeout: 10000 }
1624
- );
1625
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1626
- },
1627
- };
1628
-
1629
- /** "Accept all" — every mismatched arg is transformed and kept. */
1630
- export const AcceptAllIncompatibleFunctionArgs: Story = {
1631
- ...SeededMismatchBase,
1632
- parameters: {
1633
- ...SeededMismatchBase.parameters,
1634
- docs: {
1635
- description: {
1636
- story:
1637
- 'Renders the seeded mismatch-flagged expression, then clicks "Accept all" on the mismatched-arguments modal — every flagged argument is transformed and kept.',
1638
- },
1639
- },
1640
- },
1641
- play: async (args) => {
1642
- await SeededMismatchBase.play!(args);
1643
-
1644
- await sleep(500);
1645
- await clickButtonByLabel('Accept all');
1646
- await waitFor(
1647
- () =>
1648
- expect(
1649
- within(document.body).queryByText('Confirm type selection for mismatched arguments')
1650
- ).toBeNull(),
1651
- { timeout: 10000 }
1652
- );
1653
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1654
- },
1655
- };
1656
-
1657
- /** "Discard all" — every mismatched arg is cleared. */
1658
- export const DiscardAllIncompatibleFunctionArgs: Story = {
1659
- ...SeededMismatchBase,
1660
- parameters: {
1661
- ...SeededMismatchBase.parameters,
1662
- docs: {
1663
- description: {
1664
- story:
1665
- 'Renders the seeded mismatch-flagged expression, then clicks "Discard all" on the mismatched-arguments modal — every flagged argument is cleared.',
1666
- },
1667
- },
1668
- },
1669
- play: async (args) => {
1670
- await SeededMismatchBase.play!(args);
1671
-
1672
- await sleep(500);
1673
- await clickButtonByLabel('Discard all');
1674
- await waitFor(
1675
- () =>
1676
- expect(
1677
- within(document.body).queryByText('Confirm type selection for mismatched arguments')
1678
- ).toBeNull(),
1679
- { timeout: 10000 }
1680
- );
1681
- await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
1682
- },
1683
- };