@qoretechnologies/reqraft 0.10.55-pr.124.g43fa138 → 0.10.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/.claude/CLAUDE.md +25 -0
  2. package/.tasks/INDEX.md +1 -0
  3. package/.tasks/STORY_NETWORK_ISOLATION.md +98 -0
  4. package/README.md +1 -1
  5. package/design/FORM_ENGINE_COMPACT.md +34 -0
  6. package/design/FORM_ENGINE_EXPRESSIONS.md +110 -0
  7. package/design/FORM_ENGINE_FIELD_MIGRATION.md +155 -1
  8. package/design/IDE_INTEGRATION.md +13 -0
  9. package/design/RENDER_EXPRESSION_TRANSPORT.md +76 -10
  10. package/design/SELECT_DIALOG_FLOOR.md +86 -0
  11. package/design/SMART_EDITOR_UX.md +21 -0
  12. package/design/UNAVAILABLE_ALLOWED_VALUES.md +226 -0
  13. package/dist/components/composer/Composer.d.ts +8 -3
  14. package/dist/components/composer/Composer.d.ts.map +1 -1
  15. package/dist/components/composer/Composer.js.map +1 -1
  16. package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
  17. package/dist/components/dpqlEditor/DpqlEditor.js +3 -3
  18. package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
  19. package/dist/components/dpqlEditor/dpqlHelpers.d.ts +6 -0
  20. package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
  21. package/dist/components/dpqlEditor/dpqlHelpers.js +21 -2
  22. package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
  23. package/dist/components/dpqlEditor/dpqlProbe.d.ts +37 -0
  24. package/dist/components/dpqlEditor/dpqlProbe.d.ts.map +1 -0
  25. package/dist/components/dpqlEditor/dpqlProbe.js +203 -0
  26. package/dist/components/dpqlEditor/dpqlProbe.js.map +1 -0
  27. package/dist/components/dpqlEditor/dpqlTags.d.ts +8 -0
  28. package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
  29. package/dist/components/dpqlEditor/dpqlTags.js +5 -1
  30. package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
  31. package/dist/components/dpqlEditor/index.d.ts +4 -0
  32. package/dist/components/dpqlEditor/index.d.ts.map +1 -1
  33. package/dist/components/dpqlEditor/index.js +5 -1
  34. package/dist/components/dpqlEditor/index.js.map +1 -1
  35. package/dist/components/dpqlEditor/types.d.ts +42 -2
  36. package/dist/components/dpqlEditor/types.d.ts.map +1 -1
  37. package/dist/components/dpqlEditor/types.js +0 -4
  38. package/dist/components/dpqlEditor/types.js.map +1 -1
  39. package/dist/components/dpqlEditor/useDpqlProbe.d.ts +4 -0
  40. package/dist/components/dpqlEditor/useDpqlProbe.d.ts.map +1 -0
  41. package/dist/components/dpqlEditor/useDpqlProbe.js +29 -0
  42. package/dist/components/dpqlEditor/useDpqlProbe.js.map +1 -0
  43. package/dist/components/dpqlEditor/useDpqlSession.d.ts +5 -2
  44. package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
  45. package/dist/components/dpqlEditor/useDpqlSession.js +8 -2
  46. package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
  47. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  48. package/dist/components/form/engine/CompactRow.js +414 -128
  49. package/dist/components/form/engine/CompactRow.js.map +1 -1
  50. package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
  51. package/dist/components/form/engine/CompactToolbar.js +5 -2
  52. package/dist/components/form/engine/CompactToolbar.js.map +1 -1
  53. package/dist/components/form/engine/FormEngine.d.ts +273 -22
  54. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  55. package/dist/components/form/engine/FormEngine.js +669 -192
  56. package/dist/components/form/engine/FormEngine.js.map +1 -1
  57. package/dist/components/form/engine/FormFieldsSkeleton.d.ts +48 -0
  58. package/dist/components/form/engine/FormFieldsSkeleton.d.ts.map +1 -0
  59. package/dist/components/form/engine/FormFieldsSkeleton.js +41 -0
  60. package/dist/components/form/engine/FormFieldsSkeleton.js.map +1 -0
  61. package/dist/components/form/engine/OptionFieldMessages.d.ts +108 -2
  62. package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
  63. package/dist/components/form/engine/OptionFieldMessages.js +203 -13
  64. package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
  65. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
  66. package/dist/components/form/engine/_structuredData/SchemaDataView.js +68 -5
  67. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
  68. package/dist/components/form/engine/compactRowContext.d.ts +15 -1
  69. package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
  70. package/dist/components/form/engine/compactRowContext.js.map +1 -1
  71. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  72. package/dist/components/form/engine/compactRowStyles.js +55 -29
  73. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  74. package/dist/components/form/engine/compactToolbarContext.d.ts +1 -0
  75. package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
  76. package/dist/components/form/engine/optionActions.d.ts +37 -1
  77. package/dist/components/form/engine/optionActions.d.ts.map +1 -1
  78. package/dist/components/form/engine/optionActions.js +71 -1
  79. package/dist/components/form/engine/optionActions.js.map +1 -1
  80. package/dist/components/form/engine/optionsContext.d.ts +22 -0
  81. package/dist/components/form/engine/optionsContext.d.ts.map +1 -0
  82. package/dist/components/form/engine/optionsContext.js +20 -0
  83. package/dist/components/form/engine/optionsContext.js.map +1 -0
  84. package/dist/components/form/engine/readFirst.d.ts +42 -1
  85. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  86. package/dist/components/form/engine/readFirst.js +76 -8
  87. package/dist/components/form/engine/readFirst.js.map +1 -1
  88. package/dist/components/form/engine/rendererTypes.d.ts +42 -3
  89. package/dist/components/form/engine/rendererTypes.d.ts.map +1 -1
  90. package/dist/components/form/engine/rendererTypes.js +3 -1
  91. package/dist/components/form/engine/rendererTypes.js.map +1 -1
  92. package/dist/components/form/engine/rowFocus.d.ts +30 -0
  93. package/dist/components/form/engine/rowFocus.d.ts.map +1 -0
  94. package/dist/components/form/engine/rowFocus.js +93 -0
  95. package/dist/components/form/engine/rowFocus.js.map +1 -0
  96. package/dist/components/form/engine/rowMenuContext.d.ts +78 -0
  97. package/dist/components/form/engine/rowMenuContext.d.ts.map +1 -0
  98. package/dist/components/form/engine/rowMenuContext.js +103 -0
  99. package/dist/components/form/engine/rowMenuContext.js.map +1 -0
  100. package/dist/components/form/engine/rowOpenPicker.d.ts +27 -0
  101. package/dist/components/form/engine/rowOpenPicker.d.ts.map +1 -0
  102. package/dist/components/form/engine/rowOpenPicker.js +30 -0
  103. package/dist/components/form/engine/rowOpenPicker.js.map +1 -0
  104. package/dist/components/form/engine/typeChoices.d.ts +42 -0
  105. package/dist/components/form/engine/typeChoices.d.ts.map +1 -0
  106. package/dist/components/form/engine/typeChoices.js +33 -0
  107. package/dist/components/form/engine/typeChoices.js.map +1 -0
  108. package/dist/components/form/expressions/DpqlRendering.d.ts +26 -0
  109. package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -0
  110. package/dist/components/form/expressions/DpqlRendering.js +53 -0
  111. package/dist/components/form/expressions/DpqlRendering.js.map +1 -0
  112. package/dist/components/form/expressions/ExpressionField.d.ts +7 -1
  113. package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
  114. package/dist/components/form/expressions/ExpressionField.js +203 -45
  115. package/dist/components/form/expressions/ExpressionField.js.map +1 -1
  116. package/dist/components/form/expressions/argumentPresence.d.ts +84 -0
  117. package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -0
  118. package/dist/components/form/expressions/argumentPresence.js +217 -0
  119. package/dist/components/form/expressions/argumentPresence.js.map +1 -0
  120. package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
  121. package/dist/components/form/expressions/builder/argumentLabel.js +9 -4
  122. package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
  123. package/dist/components/form/expressions/builder/index.d.ts +15 -2
  124. package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
  125. package/dist/components/form/expressions/builder/index.js +21 -65
  126. package/dist/components/form/expressions/builder/index.js.map +1 -1
  127. package/dist/components/form/expressions/builder/renderTemplate.d.ts +4 -1
  128. package/dist/components/form/expressions/builder/renderTemplate.d.ts.map +1 -1
  129. package/dist/components/form/expressions/builder/renderTemplate.js +10 -67
  130. package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
  131. package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
  132. package/dist/components/form/expressions/mockExpressions.js +8 -4
  133. package/dist/components/form/expressions/mockExpressions.js.map +1 -1
  134. package/dist/components/form/expressions/renderExpressionToText.d.ts +1 -1
  135. package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
  136. package/dist/components/form/expressions/renderExpressionToText.js +95 -19
  137. package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
  138. package/dist/components/form/expressions/types.d.ts +17 -2
  139. package/dist/components/form/expressions/types.d.ts.map +1 -1
  140. package/dist/components/form/expressions/useExpressions.d.ts.map +1 -1
  141. package/dist/components/form/expressions/useExpressions.js +5 -2
  142. package/dist/components/form/expressions/useExpressions.js.map +1 -1
  143. package/dist/components/form/expressions/useRenderExpression.d.ts +7 -16
  144. package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
  145. package/dist/components/form/expressions/useRenderExpression.js +50 -126
  146. package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
  147. package/dist/components/form/fields/Field.d.ts +21 -0
  148. package/dist/components/form/fields/Field.d.ts.map +1 -1
  149. package/dist/components/form/fields/Field.js +54 -8
  150. package/dist/components/form/fields/Field.js.map +1 -1
  151. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +11 -1
  152. package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
  153. package/dist/components/form/fields/allowed-values/AllowedValues.js +52 -8
  154. package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
  155. package/dist/components/form/fields/auto/AutoFormField.d.ts +7 -1
  156. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  157. package/dist/components/form/fields/auto/AutoFormField.js +91 -28
  158. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  159. package/dist/components/form/fields/date/Date.d.ts +1 -1
  160. package/dist/components/form/fields/date/Date.d.ts.map +1 -1
  161. package/dist/components/form/fields/date/Date.js +16 -2
  162. package/dist/components/form/fields/date/Date.js.map +1 -1
  163. package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
  164. package/dist/components/form/fields/long-string/LongString.js +14 -2
  165. package/dist/components/form/fields/long-string/LongString.js.map +1 -1
  166. package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
  167. package/dist/components/form/fields/multi-select/MultiSelectFormField.js +50 -4
  168. package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
  169. package/dist/components/form/fields/number/Number.d.ts +12 -1
  170. package/dist/components/form/fields/number/Number.d.ts.map +1 -1
  171. package/dist/components/form/fields/number/Number.js +6 -3
  172. package/dist/components/form/fields/number/Number.js.map +1 -1
  173. package/dist/components/form/fields/rich-text/RichText.d.ts +47 -2
  174. package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
  175. package/dist/components/form/fields/rich-text/RichText.js +153 -12
  176. package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
  177. package/dist/components/form/fields/select/Select.d.ts.map +1 -1
  178. package/dist/components/form/fields/select/Select.js +120 -20
  179. package/dist/components/form/fields/select/Select.js.map +1 -1
  180. package/dist/components/form/fields/select/SelectCollection.d.ts +166 -9
  181. package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
  182. package/dist/components/form/fields/select/SelectCollection.js +200 -7
  183. package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
  184. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +2 -1
  185. package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
  186. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +3 -2
  187. package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
  188. package/dist/components/form/fields/template/TemplateField.d.ts +34 -2
  189. package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
  190. package/dist/components/form/fields/template/TemplateField.js +606 -58
  191. package/dist/components/form/fields/template/TemplateField.js.map +1 -1
  192. package/dist/components/form/fields/template/TemplateText.d.ts +36 -0
  193. package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -0
  194. package/dist/components/form/fields/template/TemplateText.js +80 -0
  195. package/dist/components/form/fields/template/TemplateText.js.map +1 -0
  196. package/dist/components/form/index.d.ts +2 -0
  197. package/dist/components/form/index.d.ts.map +1 -1
  198. package/dist/components/form/index.js +4 -0
  199. package/dist/components/form/index.js.map +1 -1
  200. package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
  201. package/dist/components/smartEditor/SmartEditor.js +29 -8
  202. package/dist/components/smartEditor/SmartEditor.js.map +1 -1
  203. package/dist/components/smartEditor/useLspSession.d.ts +5 -1
  204. package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
  205. package/dist/components/smartEditor/useLspSession.js +16 -2
  206. package/dist/components/smartEditor/useLspSession.js.map +1 -1
  207. package/dist/components/supportTicket/TicketReplyBox.d.ts +8 -4
  208. package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
  209. package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
  210. package/dist/helpers/common.d.ts.map +1 -1
  211. package/dist/helpers/common.js +7 -3
  212. package/dist/helpers/common.js.map +1 -1
  213. package/dist/helpers/dpqlDetection.d.ts +58 -0
  214. package/dist/helpers/dpqlDetection.d.ts.map +1 -0
  215. package/dist/helpers/dpqlDetection.js +164 -0
  216. package/dist/helpers/dpqlDetection.js.map +1 -0
  217. package/dist/helpers/optionUiTypes.d.ts +31 -3
  218. package/dist/helpers/optionUiTypes.d.ts.map +1 -1
  219. package/dist/helpers/optionUiTypes.js +36 -1
  220. package/dist/helpers/optionUiTypes.js.map +1 -1
  221. package/dist/helpers/options.d.ts +57 -0
  222. package/dist/helpers/options.d.ts.map +1 -1
  223. package/dist/helpers/options.js +97 -1
  224. package/dist/helpers/options.js.map +1 -1
  225. package/dist/helpers/templateItems.d.ts +47 -0
  226. package/dist/helpers/templateItems.d.ts.map +1 -0
  227. package/dist/helpers/templateItems.js +88 -0
  228. package/dist/helpers/templateItems.js.map +1 -0
  229. package/dist/helpers/templateText.d.ts +80 -0
  230. package/dist/helpers/templateText.d.ts.map +1 -0
  231. package/dist/helpers/templateText.js +291 -0
  232. package/dist/helpers/templateText.js.map +1 -0
  233. package/dist/helpers/templates.d.ts +30 -12
  234. package/dist/helpers/templates.d.ts.map +1 -1
  235. package/dist/helpers/templates.js +91 -33
  236. package/dist/helpers/templates.js.map +1 -1
  237. package/dist/helpers/validations.d.ts +35 -8
  238. package/dist/helpers/validations.d.ts.map +1 -1
  239. package/dist/helpers/validations.js +162 -25
  240. package/dist/helpers/validations.js.map +1 -1
  241. package/dist/hooks/useArgSchema.d.ts +2 -1
  242. package/dist/hooks/useArgSchema.d.ts.map +1 -1
  243. package/dist/hooks/useFetch/useFetch.d.ts +3 -1
  244. package/dist/hooks/useFetch/useFetch.d.ts.map +1 -1
  245. package/dist/hooks/useFetch/useFetch.js +47 -9
  246. package/dist/hooks/useFetch/useFetch.js.map +1 -1
  247. package/dist/hooks/useTemplates.d.ts +20 -0
  248. package/dist/hooks/useTemplates.d.ts.map +1 -1
  249. package/dist/hooks/useTemplates.js +34 -2
  250. package/dist/hooks/useTemplates.js.map +1 -1
  251. package/dist/index.d.ts +2 -1
  252. package/dist/index.d.ts.map +1 -1
  253. package/dist/index.js +5 -1
  254. package/dist/index.js.map +1 -1
  255. package/dist/utils/fetch.d.ts +151 -1
  256. package/dist/utils/fetch.d.ts.map +1 -1
  257. package/dist/utils/fetch.js +256 -44
  258. package/dist/utils/fetch.js.map +1 -1
  259. package/dist/utils/lspClient.d.ts +6 -0
  260. package/dist/utils/lspClient.d.ts.map +1 -1
  261. package/dist/utils/lspClient.js +62 -11
  262. package/dist/utils/lspClient.js.map +1 -1
  263. package/dist/utils/websocket.d.ts +6 -0
  264. package/dist/utils/websocket.d.ts.map +1 -1
  265. package/dist/utils/websocket.js +15 -7
  266. package/dist/utils/websocket.js.map +1 -1
  267. package/package.json +10 -6
  268. package/src/components/composer/Composer.tsx +7 -2
  269. package/src/components/dpqlEditor/DpqlEditor.stories.tsx +3 -119
  270. package/src/components/dpqlEditor/DpqlEditor.tsx +5 -2
  271. package/src/components/dpqlEditor/dpqlHelpers.ts +20 -1
  272. package/src/components/dpqlEditor/dpqlProbe.ts +165 -0
  273. package/src/components/dpqlEditor/dpqlTags.ts +13 -0
  274. package/src/components/dpqlEditor/index.ts +4 -0
  275. package/src/components/dpqlEditor/types.ts +38 -2
  276. package/src/components/dpqlEditor/useDpqlProbe.ts +33 -0
  277. package/src/components/dpqlEditor/useDpqlSession.ts +20 -4
  278. package/src/components/form/engine/CompactRow.tsx +487 -160
  279. package/src/components/form/engine/CompactToolbar.tsx +10 -3
  280. package/src/components/form/engine/FormEngine.stories.tsx +1269 -201
  281. package/src/components/form/engine/FormEngine.tsx +922 -270
  282. package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +331 -0
  283. package/src/components/form/engine/FormFieldsSkeleton.tsx +77 -0
  284. package/src/components/form/engine/OptionFieldMessages.tsx +300 -14
  285. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +94 -3
  286. package/src/components/form/engine/compactRowContext.ts +15 -6
  287. package/src/components/form/engine/compactRowStyles.ts +56 -2
  288. package/src/components/form/engine/compactToolbarContext.ts +1 -1
  289. package/src/components/form/engine/optionActions.ts +89 -1
  290. package/src/components/form/engine/optionsContext.ts +24 -0
  291. package/src/components/form/engine/readFirst.ts +88 -8
  292. package/src/components/form/engine/rendererTypes.ts +48 -4
  293. package/src/components/form/engine/rowFocus.ts +101 -0
  294. package/src/components/form/engine/rowMenuContext.ts +159 -0
  295. package/src/components/form/engine/rowOpenPicker.ts +27 -0
  296. package/src/components/form/engine/typeChoices.ts +63 -0
  297. package/src/components/form/expressions/DpqlRendering.tsx +85 -0
  298. package/src/components/form/expressions/ExpressionField.stories.tsx +826 -48
  299. package/src/components/form/expressions/ExpressionField.tsx +269 -55
  300. package/src/components/form/expressions/argumentPresence.ts +213 -0
  301. package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +38 -21
  302. package/src/components/form/expressions/builder/argumentLabel.tsx +10 -4
  303. package/src/components/form/expressions/builder/index.tsx +39 -81
  304. package/src/components/form/expressions/builder/renderTemplate.tsx +23 -56
  305. package/src/components/form/expressions/dpqlMockLanguage.ts +565 -0
  306. package/src/components/form/expressions/dpqlMockLsp.ts +109 -83
  307. package/src/components/form/expressions/mockExpressions.ts +8 -4
  308. package/src/components/form/expressions/renderExpressionToText.ts +112 -22
  309. package/src/components/form/expressions/types.ts +17 -2
  310. package/src/components/form/expressions/useExpressions.ts +5 -1
  311. package/src/components/form/expressions/useRenderExpression.ts +43 -127
  312. package/src/components/form/fields/Field.tsx +102 -20
  313. package/src/components/form/fields/allowed-values/AllowedValues.tsx +106 -44
  314. package/src/components/form/fields/auto/AutoFormField.stories.tsx +85 -18
  315. package/src/components/form/fields/auto/AutoFormField.tsx +97 -21
  316. package/src/components/form/fields/date/Date.tsx +17 -1
  317. package/src/components/form/fields/long-string/LongString.tsx +15 -3
  318. package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +65 -6
  319. package/src/components/form/fields/number/Number.tsx +25 -0
  320. package/src/components/form/fields/rich-text/RichText.tsx +248 -30
  321. package/src/components/form/fields/select/Select.stories.tsx +392 -0
  322. package/src/components/form/fields/select/Select.tsx +164 -27
  323. package/src/components/form/fields/select/SelectCollection.tsx +350 -6
  324. package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +4 -2
  325. package/src/components/form/fields/template/TemplateField.stories.tsx +93 -14
  326. package/src/components/form/fields/template/TemplateField.tsx +825 -131
  327. package/src/components/form/fields/template/TemplateText.tsx +115 -0
  328. package/src/components/form/index.tsx +4 -0
  329. package/src/components/log/Log.stories.tsx +2 -1
  330. package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +3 -3
  331. package/src/components/smartEditor/SmartEditor.tsx +41 -9
  332. package/src/components/smartEditor/__fixtures__/mockLspServer.ts +52 -3
  333. package/src/components/smartEditor/useLspSession.ts +21 -3
  334. package/src/components/supportTicket/TicketReplyBox.tsx +8 -4
  335. package/src/components/ticketThread/TicketThread.stories.tsx +1 -0
  336. package/src/helpers/common.ts +7 -3
  337. package/src/helpers/dpqlDetection.ts +209 -0
  338. package/src/helpers/optionUiTypes.ts +38 -0
  339. package/src/helpers/options.ts +96 -0
  340. package/src/helpers/templateItems.ts +81 -0
  341. package/src/helpers/templateText.ts +350 -0
  342. package/src/helpers/templates.ts +94 -41
  343. package/src/helpers/validations.ts +203 -51
  344. package/src/hooks/useFetch/useFetch.stories.tsx +6 -5
  345. package/src/hooks/useFetch/useFetch.tsx +53 -7
  346. package/src/hooks/useStorage/useStorage.stories.tsx +2 -1
  347. package/src/hooks/useTemplates.ts +41 -0
  348. package/src/hooks/useWebSocket/useWebsocket.stories.tsx +2 -1
  349. package/src/index.tsx +14 -1
  350. package/src/stores/currentUser/currentUser.stories.tsx +2 -1
  351. package/src/stories/storyNetwork.ts +92 -0
  352. package/src/utils/fetch.ts +311 -21
  353. package/src/utils/lspClient.ts +68 -11
  354. package/src/utils/websocket.ts +20 -9
  355. package/dist/components/form/engine/__fixtures__/basicFormOptions.d.ts +0 -73
  356. package/dist/components/form/engine/__fixtures__/basicFormOptions.d.ts.map +0 -1
  357. package/dist/components/form/engine/__fixtures__/basicFormOptions.js +0 -317
  358. package/dist/components/form/engine/__fixtures__/basicFormOptions.js.map +0 -1
  359. package/dist/components/form/engine/__fixtures__/fieldChromeOptions.d.ts +0 -41
  360. package/dist/components/form/engine/__fixtures__/fieldChromeOptions.d.ts.map +0 -1
  361. package/dist/components/form/engine/__fixtures__/fieldChromeOptions.js +0 -45
  362. package/dist/components/form/engine/__fixtures__/fieldChromeOptions.js.map +0 -1
  363. package/dist/components/form/expressions/dpqlMockLsp.d.ts +0 -3
  364. package/dist/components/form/expressions/dpqlMockLsp.d.ts.map +0 -1
  365. package/dist/components/form/expressions/dpqlMockLsp.js +0 -91
  366. package/dist/components/form/expressions/dpqlMockLsp.js.map +0 -1
  367. package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts +0 -2
  368. package/dist/components/form/fields/template/__fixtures__/longExampleValue.d.ts.map +0 -1
  369. package/dist/components/form/fields/template/__fixtures__/longExampleValue.js +0 -9
  370. package/dist/components/form/fields/template/__fixtures__/longExampleValue.js.map +0 -1
  371. package/dist/components/smartEditor/__fixtures__/mockLspServer.d.ts +0 -55
  372. package/dist/components/smartEditor/__fixtures__/mockLspServer.d.ts.map +0 -1
  373. package/dist/components/smartEditor/__fixtures__/mockLspServer.js +0 -126
  374. package/dist/components/smartEditor/__fixtures__/mockLspServer.js.map +0 -1
  375. package/dist/stories/Data/fileFieldArgSchema.json +0 -86
@@ -1,4 +1,35 @@
1
- import { TQorusType } from '@qoretechnologies/ts-toolkit';
1
+ import { IReqoreFormTemplates } from '@qoretechnologies/reqore/dist/components/Textarea';
2
+ /**
3
+ * A field schema that carries a template list of its own.
4
+ *
5
+ * `templates` is deliberately NOT added to `TQorusFormFieldSchema`: that type is
6
+ * owned by ts-toolkit and shared with consumers that have no notion of a form
7
+ * engine, so the capability is read through this narrow view instead of widening
8
+ * the shared type from here. A schema that sets it is offering a list scoped to
9
+ * one field rather than to the whole form.
10
+ */
11
+ export type TFieldWithOwnTemplates = {
12
+ templates?: IReqoreFormTemplates;
13
+ /**
14
+ * The token grammar this field's value is WRITTEN in.
15
+ *
16
+ * A host may spell a reference in a grammar that is not reqraft's — a Qorus
17
+ * test writes `$._case.mode`, which has no `$key:` in it at all — and a field
18
+ * that speaks one says so here, exactly as it hands down its own `templates`.
19
+ * Declaring it on the schema is what lets every surface that draws the value
20
+ * agree about it, instead of printing the raw token the author never typed.
21
+ *
22
+ * Both directions read it: the read-only renderings
23
+ * (`templateTextSegments`) and the rich-text editor a row opens
24
+ * (`templateTextToNodes`, through `RichTextFormField`'s `templateToken`
25
+ * prop). They resolve references with the same code, so a row and the editor
26
+ * it opens cannot disagree about what one is.
27
+ *
28
+ * A `RegExp` or its source: a schema that crossed a serialization boundary
29
+ * carries the string.
30
+ */
31
+ templateToken?: RegExp | string;
32
+ };
2
33
  /**
3
34
  * A schema entry carries two type-ish keys with different jobs:
4
35
  *
@@ -27,6 +58,14 @@ import { TQorusType } from '@qoretechnologies/ts-toolkit';
27
58
  * and neither ever fires.
28
59
  */
29
60
  export declare const BUILT_IN_RENDERER_ONLY_UI_TYPES: readonly string[];
61
+ /**
62
+ * A `ui_type` as the predicate takes it: any name, not only a `TQorusType`.
63
+ * The names it exists to recognise are open-ended — `cron` is not a
64
+ * `TQorusType`, and neither is an editor a consumer declares — so typing the
65
+ * argument as the shared union made the predicate uncallable for exactly the
66
+ * values it is for.
67
+ */
68
+ export type TRendererTypeName = string | readonly string[];
30
69
  /**
31
70
  * Build the renderer-only predicate for one FormEngine instance.
32
71
  *
@@ -36,7 +75,7 @@ export declare const BUILT_IN_RENDERER_ONLY_UI_TYPES: readonly string[];
36
75
  * its own without waiting on a reqraft release, which is what previously made
37
76
  * every new IDE editor a silent value-corruption bug until this list caught up.
38
77
  */
39
- export declare const createRendererOnlyUiTypeCheck: (extraTypes?: readonly string[]) => ((type?: TQorusType | TQorusType[]) => boolean);
78
+ export declare const createRendererOnlyUiTypeCheck: (extraTypes?: readonly string[]) => ((type?: TRendererTypeName) => boolean);
40
79
  /** The default predicate — built-ins only, for module-scope callers with no props. */
41
- export declare const isRendererOnlyUiType: (type?: TQorusType | TQorusType[]) => boolean;
80
+ export declare const isRendererOnlyUiType: (type?: TRendererTypeName) => boolean;
42
81
  //# sourceMappingURL=rendererTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rendererTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/rendererTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,MAAM,EAY5D,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,gBAC3B,SAAS,MAAM,EAAE,KAC7B,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,KAAK,OAAO,CAKhD,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,UARrB,UAAU,GAAG,UAAU,EAAE,KAAK,OAQyB,CAAC"}
1
+ {"version":3,"file":"rendererTypes.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/rendererTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAGzF;;;;;;;;GAQG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,MAAM,EAY5D,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,gBAC3B,SAAS,MAAM,EAAE,KAC7B,CAAC,CAAC,IAAI,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAOxC,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,UAVrB,iBAAiB,KAAK,OAUiC,CAAC"}
@@ -10,6 +10,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.isRendererOnlyUiType = exports.createRendererOnlyUiTypeCheck = exports.BUILT_IN_RENDERER_ONLY_UI_TYPES = void 0;
13
+ var optionUiTypes_1 = require("../../../helpers/optionUiTypes");
13
14
  /**
14
15
  * A schema entry carries two type-ish keys with different jobs:
15
16
  *
@@ -62,7 +63,8 @@ exports.BUILT_IN_RENDERER_ONLY_UI_TYPES = [
62
63
  var createRendererOnlyUiTypeCheck = function (extraTypes) {
63
64
  var known = new Set(__spreadArray(__spreadArray([], exports.BUILT_IN_RENDERER_ONLY_UI_TYPES, true), (extraTypes !== null && extraTypes !== void 0 ? extraTypes : []), true));
64
65
  return function (type) {
65
- return typeof type === 'string' && known.has(type);
66
+ var declared = (0, optionUiTypes_1.firstDeclaredType)(type);
67
+ return declared !== undefined && known.has(declared);
66
68
  };
67
69
  };
68
70
  exports.createRendererOnlyUiTypeCheck = createRendererOnlyUiTypeCheck;
@@ -1 +1 @@
1
- {"version":3,"file":"rendererTypes.js","sourceRoot":"","sources":["../../../../src/components/form/engine/rendererTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,+BAA+B,GAAsB;IAChE,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,MAAM;IACN,MAAM;IACN,UAAU;IACV,oBAAoB;IACpB,mBAAmB;IACnB,YAAY;IACZ,qBAAqB;IACrB,cAAc;CACf,CAAC;AAEF;;;;;;;;GAQG;AACI,IAAM,6BAA6B,GAAG,UAC3C,UAA8B;IAE9B,IAAM,KAAK,GAAG,IAAI,GAAG,iCAAa,uCAA+B,SAAK,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,QAAE,CAAC;IAE3F,OAAO,UAAC,IAAgC;QACtC,OAAA,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;IAA3C,CAA2C,CAAC;AAChD,CAAC,CAAC;AAPW,QAAA,6BAA6B,iCAOxC;AAEF,sFAAsF;AACzE,QAAA,oBAAoB,GAAG,IAAA,qCAA6B,GAAE,CAAC"}
1
+ {"version":3,"file":"rendererTypes.js","sourceRoot":"","sources":["../../../../src/components/form/engine/rendererTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,gEAAmE;AAkCnE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACU,QAAA,+BAA+B,GAAsB;IAChE,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,MAAM;IACN,MAAM;IACN,UAAU;IACV,oBAAoB;IACpB,mBAAmB;IACnB,YAAY;IACZ,qBAAqB;IACrB,cAAc;CACf,CAAC;AAWF;;;;;;;;GAQG;AACI,IAAM,6BAA6B,GAAG,UAC3C,UAA8B;IAE9B,IAAM,KAAK,GAAG,IAAI,GAAG,iCAAa,uCAA+B,SAAK,CAAC,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAE,CAAC,QAAE,CAAC;IAE3F,OAAO,UAAC,IAAwB;QAC9B,IAAM,QAAQ,GAAG,IAAA,iCAAiB,EAAC,IAAI,CAAC,CAAC;QACzC,OAAO,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,6BAA6B,iCASxC;AAEF,sFAAsF;AACzE,QAAA,oBAAoB,GAAG,IAAA,qCAA6B,GAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Which control an open compact row hands the caret to.
3
+ *
4
+ * A row's editor is whatever the field's type asks for, and only some of those
5
+ * take typed text. A pick-one renders `ReqoreCheckbox`es (a `[tabindex]`
6
+ * element), a selector renders a `<button>`, a code field a `[contenteditable]`
7
+ * — so a scan that looked for `input`, `textarea` and `[contenteditable]` alone
8
+ * found nothing on most of the first questions a form asks ("which kind?",
9
+ * "which connection?", "which interface?"). The row opened and the caret stayed
10
+ * on whatever made it open.
11
+ *
12
+ * Text entry wins when the row offers it. Every editor that takes typing also
13
+ * draws affordances around it — a template picker, a type menu, a clear button
14
+ * — and those come first in document order often enough that "the first
15
+ * focusable element" would answer a text field with a button beside it.
16
+ */
17
+ /**
18
+ * The control an open row should focus, or `undefined` when it offers none —
19
+ * a read-only preview, or an editor that has not mounted yet (see the caller,
20
+ * which watches for it to arrive).
21
+ *
22
+ * @param container the row's value cell
23
+ */
24
+ export declare const findRowFocusTarget: (container: HTMLElement | null | undefined) => HTMLElement | undefined;
25
+ /**
26
+ * Whether this control is a picker that is still closed — i.e. whether
27
+ * activating it is what "open the editor" means for this row.
28
+ */
29
+ export declare const isClosedPickerTrigger: (element: HTMLElement | null | undefined) => boolean;
30
+ //# sourceMappingURL=rowFocus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowFocus.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/rowFocus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAwCH;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,cAClB,WAAW,GAAG,IAAI,GAAG,SAAS,KACxC,WAAW,GAAG,SAOhB,CAAC;AAqBF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAa,WAAW,GAAG,IAAI,GAAG,SAAS,KAAG,OAI9B,CAAC"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ /**
3
+ * Which control an open compact row hands the caret to.
4
+ *
5
+ * A row's editor is whatever the field's type asks for, and only some of those
6
+ * take typed text. A pick-one renders `ReqoreCheckbox`es (a `[tabindex]`
7
+ * element), a selector renders a `<button>`, a code field a `[contenteditable]`
8
+ * — so a scan that looked for `input`, `textarea` and `[contenteditable]` alone
9
+ * found nothing on most of the first questions a form asks ("which kind?",
10
+ * "which connection?", "which interface?"). The row opened and the caret stayed
11
+ * on whatever made it open.
12
+ *
13
+ * Text entry wins when the row offers it. Every editor that takes typing also
14
+ * draws affordances around it — a template picker, a type menu, a clear button
15
+ * — and those come first in document order often enough that "the first
16
+ * focusable element" would answer a text field with a button beside it.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.isClosedPickerTrigger = exports.findRowFocusTarget = void 0;
20
+ /** Controls the reader types into. */
21
+ var TEXT_ENTRY_SELECTOR = 'input:not([type="hidden"]):not([disabled]), textarea:not([disabled]), [contenteditable="true"]';
22
+ /**
23
+ * Everything else a row can offer. `[tabindex]` is what carries reqore's own
24
+ * controls: a checkbox is an icon element made focusable, not an `<input>`.
25
+ */
26
+ var OTHER_CONTROL_SELECTOR = 'button:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
27
+ /**
28
+ * Subtrees inside the row's value cell that are NOT this field's editor: a
29
+ * sibling field absorbed into this row (a different field, which the engine did
30
+ * not open) and the schema-message strip above the editor (guidance about the
31
+ * value, never a place to put one).
32
+ */
33
+ var NOT_THE_FIELDS_OWN_EDITOR = '.options-readfirst-absorbed, .options-readfirst-info-panel';
34
+ var belongsToTheFieldsOwnEditor = function (container, element) {
35
+ var foreign = element.closest(NOT_THE_FIELDS_OWN_EDITOR);
36
+ // `closest` walks past the container too, so a match only disqualifies the
37
+ // element when it is inside THIS container.
38
+ return !foreign || !container.contains(foreign);
39
+ };
40
+ var firstMatch = function (container, selector) {
41
+ var matches = Array.from(container.querySelectorAll(selector));
42
+ return matches.find(function (element) {
43
+ return belongsToTheFieldsOwnEditor(container, element) &&
44
+ // An element hidden from assistive technology is not a destination for a
45
+ // caret either — reqore draws decorative, focusable-looking chrome that
46
+ // way.
47
+ !element.closest('[aria-hidden="true"]');
48
+ });
49
+ };
50
+ /**
51
+ * The control an open row should focus, or `undefined` when it offers none —
52
+ * a read-only preview, or an editor that has not mounted yet (see the caller,
53
+ * which watches for it to arrive).
54
+ *
55
+ * @param container the row's value cell
56
+ */
57
+ var findRowFocusTarget = function (container) {
58
+ var _a;
59
+ if (!container) {
60
+ return undefined;
61
+ }
62
+ return ((_a = firstMatch(container, TEXT_ENTRY_SELECTOR)) !== null && _a !== void 0 ? _a : firstMatch(container, OTHER_CONTROL_SELECTOR));
63
+ };
64
+ exports.findRowFocusTarget = findRowFocusTarget;
65
+ /**
66
+ * Controls whose ONLY behaviour is to reveal the choices.
67
+ *
68
+ * A row that opens hands the caret to the control it offers, and for most
69
+ * editors that is the end of it: a text box takes typing, a pick-one's
70
+ * checkboxes take a click. A PICKER is different — its closed state prints the
71
+ * value it already holds, which is the very thing the read row printed, so
72
+ * opening the row changed nothing on screen and the author had to click a
73
+ * second time to see the list. Read-first belongs to the collapsed row; it must
74
+ * not be the answer twice.
75
+ *
76
+ * Declared with `aria-haspopup`, which is what the attribute means and is
77
+ * already the contract with assistive technology — so a host's own editor opts
78
+ * in by being accessible rather than by knowing about this file. `aria-expanded`
79
+ * is respected: a picker that is already showing its list is not re-activated.
80
+ */
81
+ var PICKER_TRIGGER_SELECTOR = '[aria-haspopup="listbox"], [aria-haspopup="dialog"], [aria-haspopup="menu"], [aria-haspopup="tree"], [aria-haspopup="grid"]';
82
+ /**
83
+ * Whether this control is a picker that is still closed — i.e. whether
84
+ * activating it is what "open the editor" means for this row.
85
+ */
86
+ var isClosedPickerTrigger = function (element) {
87
+ return !!element &&
88
+ typeof element.matches === 'function' &&
89
+ element.matches(PICKER_TRIGGER_SELECTOR) &&
90
+ element.getAttribute('aria-expanded') !== 'true';
91
+ };
92
+ exports.isClosedPickerTrigger = isClosedPickerTrigger;
93
+ //# sourceMappingURL=rowFocus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowFocus.js","sourceRoot":"","sources":["../../../../src/components/form/engine/rowFocus.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,sCAAsC;AACtC,IAAM,mBAAmB,GACvB,gGAAgG,CAAC;AAEnG;;;GAGG;AACH,IAAM,sBAAsB,GAC1B,iFAAiF,CAAC;AAEpF;;;;;GAKG;AACH,IAAM,yBAAyB,GAAG,4DAA4D,CAAC;AAE/F,IAAM,2BAA2B,GAAG,UAAC,SAAsB,EAAE,OAAgB;IAC3E,IAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC3D,2EAA2E;IAC3E,4CAA4C;IAC5C,OAAO,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC;AAEF,IAAM,UAAU,GAAG,UAAC,SAAsB,EAAE,QAAgB;IAC1D,IAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAc,QAAQ,CAAC,CAAC,CAAC;IAC9E,OAAO,OAAO,CAAC,IAAI,CACjB,UAAC,OAAO;QACN,OAAA,2BAA2B,CAAC,SAAS,EAAE,OAAO,CAAC;YAC/C,yEAAyE;YACzE,wEAAwE;YACxE,OAAO;YACP,CAAC,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC;IAJxC,CAIwC,CAC3C,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;GAMG;AACI,IAAM,kBAAkB,GAAG,UAChC,SAAyC;;IAEzC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,CACL,MAAA,UAAU,CAAC,SAAS,EAAE,mBAAmB,CAAC,mCAAI,UAAU,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAC5F,CAAC;AACJ,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEF;;;;;;;;;;;;;;;GAeG;AACH,IAAM,uBAAuB,GAC3B,6HAA6H,CAAC;AAEhI;;;GAGG;AACI,IAAM,qBAAqB,GAAG,UAAC,OAAuC;IAC3E,OAAA,CAAC,CAAC,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,KAAK,UAAU;QACrC,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACxC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;AAHhD,CAGgD,CAAC;AAJtC,QAAA,qBAAqB,yBAIiB"}
@@ -0,0 +1,78 @@
1
+ /// <reference types="react" />
2
+ import { IReqoreDropdownItem } from '@qoretechnologies/reqore/dist/components/Dropdown/list';
3
+ /**
4
+ * SEAM (reqraft): an editor publishes its own actions into the row's ⋮ menu.
5
+ *
6
+ * A row already renders one overflow menu — Edit fullscreen, Remove field, and
7
+ * any `optionActions` the host injected — and the comment on it has always said
8
+ * why: *"this row already has a menu, so they reuse it rather than adding a
9
+ * second one beside it."* An EDITOR could not reach that menu, so an editor
10
+ * with affordances of its own had no choice but to draw a second ⋮ inside the
11
+ * value cell. The IDE's template field does exactly that, and the two menus
12
+ * ended up side by side on one control, at slightly different widths.
13
+ *
14
+ * `optionActions` does not solve it: that seam is host configuration, resolved
15
+ * from the option's name and schema before the editor exists, so it cannot know
16
+ * what the editor can offer *now* — whether its templates have loaded, whether
17
+ * the value is already an expression, which custom items the field was given.
18
+ *
19
+ * ## Why registration is keyed, and by whom
20
+ *
21
+ * Menu items carry `onClick` handlers, so they are a new array on every render
22
+ * and cannot be compared by value. An editor therefore publishes a `key`
23
+ * alongside them: a primitive describing WHICH items it is currently offering
24
+ * (`'expression,template'`). The row re-renders only when a publisher's key
25
+ * changes, so a re-rendering editor cannot drive the row into a state loop.
26
+ *
27
+ * Each registration also belongs to ONE publisher. A single shared slot let
28
+ * two publishers in the same row — an expression builder's operands — overwrite
29
+ * each other's key on every render, which re-rendered the row and both of them,
30
+ * which published again: a synchronous render loop that froze the page. And a
31
+ * slot that outlived its editor kept that editor's handlers after it unmounted,
32
+ * so a row closed and reopened offered items that did nothing. Registrations
33
+ * are therefore per publisher, withdrawn on unmount, and a click always reaches
34
+ * the handler from the publisher's latest render.
35
+ *
36
+ * Publish with `useRowMenuPublisher`; provide with `useRowMenuRegistry`.
37
+ */
38
+ export interface IRowMenuRegistration {
39
+ /**
40
+ * Publish a publisher's menu items into the containing row's ⋮.
41
+ *
42
+ * @param publisherId identifies the publishing editor (one per mounted editor)
43
+ * @param key a primitive describing which items are being offered; the row
44
+ * re-renders only when it changes
45
+ * @param items the items to merge, or an empty array to contribute none
46
+ */
47
+ registerRowMenuItems: (publisherId: string, key: string, items: IReqoreDropdownItem[]) => void;
48
+ /** Withdraw a publisher's items — when it unmounts or leaves the row. */
49
+ unregisterRowMenuItems: (publisherId: string) => void;
50
+ }
51
+ /**
52
+ * Absent outside a compact row — the classic (non-compact) render path has no
53
+ * row menu to merge into, and an editor there keeps drawing its own control.
54
+ */
55
+ export declare const RowMenuContext: import("react").Context<IRowMenuRegistration>;
56
+ /**
57
+ * The row-menu channel for the row this editor is inside, or `undefined` when
58
+ * there is no row menu to publish into.
59
+ *
60
+ * An editor that finds it should render no menu of its own; one that does not
61
+ * must keep rendering its own, or its actions become unreachable.
62
+ */
63
+ export declare const useRowMenu: () => IRowMenuRegistration | undefined;
64
+ /**
65
+ * Publish `items` into `rowMenu` for as long as the calling editor is mounted.
66
+ * `rowMenu` is passed rather than read here so an editor can claim the channel
67
+ * and hide it from what it renders (see `TemplateField`).
68
+ */
69
+ export declare const useRowMenuPublisher: (rowMenu: IRowMenuRegistration | undefined, key: string, items: IReqoreDropdownItem[]) => void;
70
+ /**
71
+ * The row side of the channel: the registration to provide, and the items the
72
+ * row's ⋮ should list.
73
+ */
74
+ export declare const useRowMenuRegistry: () => {
75
+ rowMenu: IRowMenuRegistration;
76
+ items: IReqoreDropdownItem[];
77
+ };
78
+ //# sourceMappingURL=rowMenuContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowMenuContext.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/rowMenuContext.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAY7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,IAAI,CAAC;IAC/F,yEAAyE;IACzE,sBAAsB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,+CAA6D,CAAC;AAEzF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,QAAO,oBAAoB,GAAG,SAAuC,CAAC;AAE7F;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,YACrB,oBAAoB,GAAG,SAAS,OACpC,MAAM,SACJ,mBAAmB,EAAE,KAC3B,IAQF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO;IACpC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAwD9B,CAAC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
14
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
15
+ if (ar || !(i in from)) {
16
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
17
+ ar[i] = from[i];
18
+ }
19
+ }
20
+ return to.concat(ar || Array.prototype.slice.call(from));
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.useRowMenuRegistry = exports.useRowMenuPublisher = exports.useRowMenu = exports.RowMenuContext = void 0;
24
+ var react_1 = require("react");
25
+ /**
26
+ * Absent outside a compact row — the classic (non-compact) render path has no
27
+ * row menu to merge into, and an editor there keeps drawing its own control.
28
+ */
29
+ exports.RowMenuContext = (0, react_1.createContext)(undefined);
30
+ /**
31
+ * The row-menu channel for the row this editor is inside, or `undefined` when
32
+ * there is no row menu to publish into.
33
+ *
34
+ * An editor that finds it should render no menu of its own; one that does not
35
+ * must keep rendering its own, or its actions become unreachable.
36
+ */
37
+ var useRowMenu = function () { return (0, react_1.useContext)(exports.RowMenuContext); };
38
+ exports.useRowMenu = useRowMenu;
39
+ /**
40
+ * Publish `items` into `rowMenu` for as long as the calling editor is mounted.
41
+ * `rowMenu` is passed rather than read here so an editor can claim the channel
42
+ * and hide it from what it renders (see `TemplateField`).
43
+ */
44
+ var useRowMenuPublisher = function (rowMenu, key, items) {
45
+ var publisherId = (0, react_1.useId)();
46
+ (0, react_1.useEffect)(function () {
47
+ rowMenu === null || rowMenu === void 0 ? void 0 : rowMenu.registerRowMenuItems(publisherId, key, items);
48
+ }, [rowMenu, publisherId, key, items]);
49
+ (0, react_1.useEffect)(function () { return function () { return rowMenu === null || rowMenu === void 0 ? void 0 : rowMenu.unregisterRowMenuItems(publisherId); }; }, [rowMenu, publisherId]);
50
+ };
51
+ exports.useRowMenuPublisher = useRowMenuPublisher;
52
+ /**
53
+ * The row side of the channel: the registration to provide, and the items the
54
+ * row's ⋮ should list.
55
+ */
56
+ var useRowMenuRegistry = function () {
57
+ // Which publishers are offering which item SET — the only state, so only a
58
+ // change of set re-renders the row.
59
+ var _a = (0, react_1.useState)({}), keys = _a[0], setKeys = _a[1];
60
+ // Each publisher's items from its latest render, read at click time.
61
+ var latest = (0, react_1.useRef)({});
62
+ var registerRowMenuItems = (0, react_1.useCallback)(function (publisherId, key, items) {
63
+ latest.current[publisherId] = items;
64
+ setKeys(function (previous) {
65
+ var _a;
66
+ return previous[publisherId] === key ? previous : __assign(__assign({}, previous), (_a = {}, _a[publisherId] = key, _a));
67
+ });
68
+ }, []);
69
+ var unregisterRowMenuItems = (0, react_1.useCallback)(function (publisherId) {
70
+ delete latest.current[publisherId];
71
+ setKeys(function (previous) {
72
+ if (!(publisherId in previous)) {
73
+ return previous;
74
+ }
75
+ var next = __assign({}, previous);
76
+ delete next[publisherId];
77
+ return next;
78
+ });
79
+ }, []);
80
+ var rowMenu = (0, react_1.useMemo)(function () { return ({ registerRowMenuItems: registerRowMenuItems, unregisterRowMenuItems: unregisterRowMenuItems }); }, [registerRowMenuItems, unregisterRowMenuItems]);
81
+ var items = (0, react_1.useMemo)(function () {
82
+ return Object.keys(keys).flatMap(function (publisherId) {
83
+ var _a;
84
+ return ((_a = latest.current[publisherId]) !== null && _a !== void 0 ? _a : []).map(function (item, index) {
85
+ return item.onClick
86
+ ? __assign(__assign({}, item), {
87
+ // Same key, same item set, so the index still names this item;
88
+ // the handler is whatever the publisher rendered last.
89
+ onClick: (function () {
90
+ var _a, _b, _c;
91
+ var args = [];
92
+ for (var _i = 0; _i < arguments.length; _i++) {
93
+ args[_i] = arguments[_i];
94
+ }
95
+ return (_c = (_b = (_a = latest.current[publisherId]) === null || _a === void 0 ? void 0 : _a[index]) === null || _b === void 0 ? void 0 : _b.onClick) === null || _c === void 0 ? void 0 : _c.call.apply(_c, __spreadArray([_b], args, false));
96
+ }) }) : item;
97
+ });
98
+ });
99
+ }, [keys]);
100
+ return { rowMenu: rowMenu, items: items };
101
+ };
102
+ exports.useRowMenuRegistry = useRowMenuRegistry;
103
+ //# sourceMappingURL=rowMenuContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowMenuContext.js","sourceRoot":"","sources":["../../../../src/components/form/engine/rowMenuContext.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,+BASe;AAmDf;;;GAGG;AACU,QAAA,cAAc,GAAG,IAAA,qBAAa,EAAmC,SAAS,CAAC,CAAC;AAEzF;;;;;;GAMG;AACI,IAAM,UAAU,GAAG,cAAwC,OAAA,IAAA,kBAAU,EAAC,sBAAc,CAAC,EAA1B,CAA0B,CAAC;AAAhF,QAAA,UAAU,cAAsE;AAE7F;;;;GAIG;AACI,IAAM,mBAAmB,GAAG,UACjC,OAAyC,EACzC,GAAW,EACX,KAA4B;IAE5B,IAAM,WAAW,GAAG,IAAA,aAAK,GAAE,CAAC;IAE5B,IAAA,iBAAS,EAAC;QACR,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvC,IAAA,iBAAS,EAAC,cAAM,OAAA,cAAM,OAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,sBAAsB,CAAC,WAAW,CAAC,EAA5C,CAA4C,EAAlD,CAAkD,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC;AAZW,QAAA,mBAAmB,uBAY9B;AAEF;;;GAGG;AACI,IAAM,kBAAkB,GAAG;IAIhC,2EAA2E;IAC3E,oCAAoC;IAC9B,IAAA,KAAkB,IAAA,gBAAQ,EAAyB,EAAE,CAAC,EAArD,IAAI,QAAA,EAAE,OAAO,QAAwC,CAAC;IAC7D,qEAAqE;IACrE,IAAM,MAAM,GAAG,IAAA,cAAM,EAAwC,EAAE,CAAC,CAAC;IAEjE,IAAM,oBAAoB,GAAG,IAAA,mBAAW,EACtC,UAAC,WAAmB,EAAE,GAAW,EAAE,KAA4B;QAC7D,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;QACpC,OAAO,CAAC,UAAC,QAAQ;;YACf,OAAA,QAAQ,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,uBAAM,QAAQ,gBAAG,WAAW,IAAG,GAAG,MAAE;QAA9E,CAA8E,CAC/E,CAAC;IACJ,CAAC,EACD,EAAE,CACH,CAAC;IAEF,IAAM,sBAAsB,GAAG,IAAA,mBAAW,EAAC,UAAC,WAAmB;QAC7D,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QACnC,OAAO,CAAC,UAAC,QAAQ;YACf,IAAI,CAAC,CAAC,WAAW,IAAI,QAAQ,CAAC,EAAE,CAAC;gBAC/B,OAAO,QAAQ,CAAC;YAClB,CAAC;YACD,IAAM,IAAI,gBAAQ,QAAQ,CAAE,CAAC;YAC7B,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAM,OAAO,GAAG,IAAA,eAAO,EACrB,cAAM,OAAA,CAAC,EAAE,oBAAoB,sBAAA,EAAE,sBAAsB,wBAAA,EAAE,CAAC,EAAlD,CAAkD,EACxD,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAC/C,CAAC;IAEF,IAAM,KAAK,GAAG,IAAA,eAAO,EACnB;QACE,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAC,WAAW;;YACpC,OAAA,CAAC,MAAA,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK;gBAClD,OAAA,IAAI,CAAC,OAAO;oBACV,CAAC,uBACM,IAAI;wBACP,+DAA+D;wBAC/D,uDAAuD;wBACvD,OAAO,EAAE,CAAC;;4BAAC,cAAkB;iCAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;gCAAlB,yBAAkB;;4BAC3B,OAAA,MAAC,MAAA,MAAA,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,0CAAG,KAAK,CAAC,0CAAE,OAEzB,6EAAM,IAAI,SAAC,CAAA;yBAAA,CAAmC,IAElE,CAAC,CAAC,IAAI;YAVR,CAUQ,CACT,CAAA;SAAA,CACF;IAdD,CAcC,EACH,CAAC,IAAI,CAAC,CACP,CAAC;IAEF,OAAO,EAAE,OAAO,SAAA,EAAE,KAAK,OAAA,EAAE,CAAC;AAC5B,CAAC,CAAC;AA1DW,QAAA,kBAAkB,sBA0D7B"}
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * "The row you are in has just been opened, and the control you are is the one
4
+ * it offers — so show the choices."
5
+ *
6
+ * A compact row is read-first: collapsed, it prints the value; clicked, it
7
+ * mounts the editor. For a PICKER the editor is a closed trigger printing the
8
+ * same value the read row had just printed, so the row opened and nothing on
9
+ * screen changed — the author had to click a second time to reach the list.
10
+ * Read-first is the collapsed row's job; it must not be the answer twice.
11
+ *
12
+ * The row decides, because only the row knows both things that matter: that the
13
+ * AUTHOR opened it (a row the form opens to show a value must not throw a list
14
+ * over it) and WHICH control it offers (`findRowFocusTarget` — the same scan
15
+ * that hands over the caret). The control obeys, because only the control knows
16
+ * how it opens.
17
+ *
18
+ * A one-shot pulse rather than a standing flag: it is `true` for exactly the
19
+ * commit in which the editor acts on it, and false again afterwards, so an
20
+ * editor that remounts later — a picker whose catalogue reloaded, after the
21
+ * author had closed it — does not reopen itself off a stale instruction.
22
+ *
23
+ * Exported so a host's own editor can obey it too: read it with
24
+ * `useContext(RowOpenPickerContext)` and open on the rising edge.
25
+ */
26
+ export declare const RowOpenPickerContext: import("react").Context<boolean>;
27
+ //# sourceMappingURL=rowOpenPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowOpenPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/rowOpenPicker.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,oBAAoB,kCAAgC,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RowOpenPickerContext = void 0;
4
+ var react_1 = require("react");
5
+ /**
6
+ * "The row you are in has just been opened, and the control you are is the one
7
+ * it offers — so show the choices."
8
+ *
9
+ * A compact row is read-first: collapsed, it prints the value; clicked, it
10
+ * mounts the editor. For a PICKER the editor is a closed trigger printing the
11
+ * same value the read row had just printed, so the row opened and nothing on
12
+ * screen changed — the author had to click a second time to reach the list.
13
+ * Read-first is the collapsed row's job; it must not be the answer twice.
14
+ *
15
+ * The row decides, because only the row knows both things that matter: that the
16
+ * AUTHOR opened it (a row the form opens to show a value must not throw a list
17
+ * over it) and WHICH control it offers (`findRowFocusTarget` — the same scan
18
+ * that hands over the caret). The control obeys, because only the control knows
19
+ * how it opens.
20
+ *
21
+ * A one-shot pulse rather than a standing flag: it is `true` for exactly the
22
+ * commit in which the editor acts on it, and false again afterwards, so an
23
+ * editor that remounts later — a picker whose catalogue reloaded, after the
24
+ * author had closed it — does not reopen itself off a stale instruction.
25
+ *
26
+ * Exported so a host's own editor can obey it too: read it with
27
+ * `useContext(RowOpenPickerContext)` and open on the rising edge.
28
+ */
29
+ exports.RowOpenPickerContext = (0, react_1.createContext)(false);
30
+ //# sourceMappingURL=rowOpenPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rowOpenPicker.js","sourceRoot":"","sources":["../../../../src/components/form/engine/rowOpenPicker.ts"],"names":[],"mappings":";;;AAAA,+BAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAAU,KAAK,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Which options offer the per-type choices ("Integer", "Text", "Hash", …) in
3
+ * the row's menu.
4
+ *
5
+ * A field that pins no concrete type has to give the author some way to say
6
+ * what kind of value they mean, and the row menu is where that lives — the
7
+ * alternative, a standalone *"Please select data type"* control, replaces a
8
+ * typable field with a pick-only one.
9
+ *
10
+ * The rule was `ui_type === 'any'`, which is one of the three ways a schema
11
+ * says "untyped", so the choices went missing on the other two:
12
+ *
13
+ * - **`type: 'auto'` with no `ui_type` at all.** This is how the server
14
+ * declares an assertion's Expected Value, so that field never offered them.
15
+ * They appeared only inside an expression, where the OPERAND's schema does
16
+ * say `ui_type: 'any'` — so the same option offered them in the Visual view
17
+ * and not in the Text view, which reads as the menu losing items.
18
+ * - **A host's own untyped editor.** The IDE renders Expected Value through
19
+ * `test-reference`, a `ui_type` reqraft knows nothing about; the field is no
20
+ * less untyped for having a custom editor.
21
+ *
22
+ * `ui_type` is asked FIRST and on its own: a schema that names a concrete
23
+ * editor (`ui_type: 'string'`) has pinned the field even if its storage `type`
24
+ * is still `auto`.
25
+ */
26
+ import type { TQorusFormFieldSchema } from '@qoretechnologies/ts-toolkit';
27
+ /**
28
+ * The spellings that mean "no concrete type" wherever they appear.
29
+ *
30
+ * Re-exported from the type vocabulary in `helpers/optionUiTypes`, which is
31
+ * where it now lives so non-component code can ask the same question.
32
+ */
33
+ export declare const BuiltInAnyLikeTypes: readonly string[];
34
+ /**
35
+ * Does this option leave its type up to the author?
36
+ *
37
+ * @param option the option's schema entry
38
+ * @param extraUiTypes host `ui_type` names that are untyped editors of their
39
+ * own — see `FormEngine`'s `anyLikeUiTypes`
40
+ */
41
+ export declare const offersTypeChoices: (option: TQorusFormFieldSchema | undefined, extraUiTypes?: string[]) => boolean;
42
+ //# sourceMappingURL=typeChoices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeChoices.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/typeChoices.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAG1E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAyB,CAAC;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,WACpB,qBAAqB,GAAG,SAAS,iBAC1B,MAAM,EAAE,KACtB,OAeF,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.offersTypeChoices = exports.BuiltInAnyLikeTypes = void 0;
4
+ var optionUiTypes_1 = require("../../../helpers/optionUiTypes");
5
+ /**
6
+ * The spellings that mean "no concrete type" wherever they appear.
7
+ *
8
+ * Re-exported from the type vocabulary in `helpers/optionUiTypes`, which is
9
+ * where it now lives so non-component code can ask the same question.
10
+ */
11
+ exports.BuiltInAnyLikeTypes = optionUiTypes_1.UNTYPED_OPTION_TYPES;
12
+ /**
13
+ * Does this option leave its type up to the author?
14
+ *
15
+ * @param option the option's schema entry
16
+ * @param extraUiTypes host `ui_type` names that are untyped editors of their
17
+ * own — see `FormEngine`'s `anyLikeUiTypes`
18
+ */
19
+ var offersTypeChoices = function (option, extraUiTypes) {
20
+ if (!option) {
21
+ return false;
22
+ }
23
+ var uiType = option.ui_type;
24
+ if (uiType) {
25
+ return exports.BuiltInAnyLikeTypes.includes(uiType) || !!(extraUiTypes === null || extraUiTypes === void 0 ? void 0 : extraUiTypes.includes(uiType));
26
+ }
27
+ // No `ui_type`: the storage type is the only thing that can pin the field,
28
+ // read as the field is rendered (`firstDeclaredType`).
29
+ var type = (0, optionUiTypes_1.firstDeclaredType)(option.type);
30
+ return type !== undefined && exports.BuiltInAnyLikeTypes.includes(type);
31
+ };
32
+ exports.offersTypeChoices = offersTypeChoices;
33
+ //# sourceMappingURL=typeChoices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeChoices.js","sourceRoot":"","sources":["../../../../src/components/form/engine/typeChoices.ts"],"names":[],"mappings":";;;AA2BA,gEAAyF;AAEzF;;;;;GAKG;AACU,QAAA,mBAAmB,GAAsB,oCAAoB,CAAC;AAE3E;;;;;;GAMG;AACI,IAAM,iBAAiB,GAAG,UAC/B,MAAyC,EACzC,YAAuB;IAEvB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAM,MAAM,GAAuB,MAAM,CAAC,OAAO,CAAC;IAElD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,2BAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA,CAAC;IAClF,CAAC;IAED,2EAA2E;IAC3E,uDAAuD;IACvD,IAAM,IAAI,GAAG,IAAA,iCAAiB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,IAAI,KAAK,SAAS,IAAI,2BAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC,CAAC;AAlBW,QAAA,iBAAiB,qBAkB5B"}
@@ -0,0 +1,26 @@
1
+ import { IReqoreFormTemplates } from '@qoretechnologies/reqore/dist/components/Textarea';
2
+ import { IExpressionValue } from './types';
3
+ export interface IDpqlRenderingProps {
4
+ /** DPQL, or a readable rendering of it, to show. */
5
+ text: string;
6
+ /** The surface's template catalogue: a reference in it reads as its name. */
7
+ templates?: IReqoreFormTemplates;
8
+ 'data-testid'?: string;
9
+ }
10
+ /** Shows `text` as DPQL: monospace, server-coloured, references as chips. */
11
+ export declare const DpqlRendering: ({ text, templates, "data-testid": testId }: IDpqlRenderingProps) => import("react/jsx-runtime").JSX.Element;
12
+ export interface IExpressionRenderingProps {
13
+ /** The expression AST to render. */
14
+ expression: IExpressionValue;
15
+ /** The surface's template catalogue: a reference in it reads as its name. */
16
+ templates?: IReqoreFormTemplates;
17
+ 'data-testid'?: string;
18
+ }
19
+ /**
20
+ * The server's readable rendering of `expression`, shown through
21
+ * `DpqlRendering`. It waits for the server — in the form's one waiting shape —
22
+ * and says so plainly if the server cannot render, rather than showing an
23
+ * approximation that reads like the real thing.
24
+ */
25
+ export declare const ExpressionRendering: ({ expression, templates, "data-testid": testId, }: IExpressionRenderingProps) => import("react/jsx-runtime").JSX.Element;
26
+ //# sourceMappingURL=DpqlRendering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DpqlRendering.d.ts","sourceRoot":"","sources":["../../../../src/components/form/expressions/DpqlRendering.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAIzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAK3C,MAAM,WAAW,mBAAmB;IAClC,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,6EAA6E;AAC7E,eAAO,MAAM,aAAa,+CAAgD,mBAAmB,4CAiB5F,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,oCAAoC;IACpC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,6EAA6E;IAC7E,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sDAI7B,yBAAyB,4CAiB3B,CAAC"}