@vertesia/ui 1.5.0-dev.20260717.131047Z → 1.5.0-dev.20260725.083715Z

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 (567) hide show
  1. package/lib/core/components/SidePanel.js +1 -1
  2. package/lib/core/components/SidePanel.js.map +1 -1
  3. package/lib/core/components/shadcn/button.d.ts +10 -3
  4. package/lib/core/components/shadcn/button.d.ts.map +1 -1
  5. package/lib/core/components/shadcn/button.js +41 -9
  6. package/lib/core/components/shadcn/button.js.map +1 -1
  7. package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
  8. package/lib/core/components/shadcn/filters/filterBar.js +1 -1
  9. package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
  10. package/lib/core/components/shadcn/modal/dialog.d.ts +1 -1
  11. package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
  12. package/lib/core/components/shadcn/modal/dialog.js +3 -1
  13. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  14. package/lib/core/components/shadcn/tabs.d.ts +12 -1
  15. package/lib/core/components/shadcn/tabs.d.ts.map +1 -1
  16. package/lib/core/components/shadcn/tabs.js +12 -4
  17. package/lib/core/components/shadcn/tabs.js.map +1 -1
  18. package/lib/core/components/shadcn/theme/ThemeSwitcher.js +1 -1
  19. package/lib/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
  20. package/lib/features/agent/chat/AgentChatPlaybackControls.d.ts.map +1 -1
  21. package/lib/features/agent/chat/AgentChatPlaybackControls.js +2 -2
  22. package/lib/features/agent/chat/AgentChatPlaybackControls.js.map +1 -1
  23. package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
  24. package/lib/features/agent/chat/AgentRequestInputOverlay.js +2 -2
  25. package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
  26. package/lib/features/agent/chat/AgentRightPanel.d.ts +5 -1
  27. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  28. package/lib/features/agent/chat/AgentRightPanel.js +2 -2
  29. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  30. package/lib/features/agent/chat/ArtifactsTab.d.ts +5 -1
  31. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  32. package/lib/features/agent/chat/ArtifactsTab.js +53 -13
  33. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  34. package/lib/features/agent/chat/DocumentEditingActionCard.d.ts +6 -0
  35. package/lib/features/agent/chat/DocumentEditingActionCard.d.ts.map +1 -0
  36. package/lib/features/agent/chat/DocumentEditingActionCard.js +129 -0
  37. package/lib/features/agent/chat/DocumentEditingActionCard.js.map +1 -0
  38. package/lib/features/agent/chat/ImageLightbox.d.ts.map +1 -1
  39. package/lib/features/agent/chat/ImageLightbox.js +1 -1
  40. package/lib/features/agent/chat/ImageLightbox.js.map +1 -1
  41. package/lib/features/agent/chat/ModernAgentConversation.d.ts +19 -1
  42. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  43. package/lib/features/agent/chat/ModernAgentConversation.js +125 -27
  44. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  45. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts +45 -0
  46. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts.map +1 -0
  47. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js +40 -0
  48. package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js.map +1 -0
  49. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
  50. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  51. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +96 -51
  52. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  53. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts +2 -1
  54. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  55. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +9 -5
  56. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  57. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts +25 -0
  58. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts.map +1 -0
  59. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js +33 -0
  60. package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js.map +1 -0
  61. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  62. package/lib/features/agent/chat/ModernAgentOutput/Header.js +4 -2
  63. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  64. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
  65. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +2 -2
  66. package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
  67. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
  68. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  69. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +23 -24
  70. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  71. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts +14 -0
  72. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts.map +1 -0
  73. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js +21 -0
  74. package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js.map +1 -0
  75. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts +30 -0
  76. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts.map +1 -0
  77. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js +53 -0
  78. package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js.map +1 -0
  79. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +21 -2
  81. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +6 -0
  83. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +15 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
  86. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts +6 -0
  87. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts.map +1 -0
  88. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js +29 -0
  89. package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js.map +1 -0
  90. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts +33 -0
  91. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts.map +1 -0
  92. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js +129 -0
  93. package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js.map +1 -0
  94. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +7 -0
  95. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  96. package/lib/features/agent/chat/ModernAgentOutput/utils.js +11 -1
  97. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  98. package/lib/features/agent/chat/hooks/useAgentStream.d.ts +1 -1
  99. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  100. package/lib/features/agent/chat/hooks/useAgentStream.js +24 -9
  101. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  102. package/lib/features/agent/chat/index.d.ts +2 -1
  103. package/lib/features/agent/chat/index.d.ts.map +1 -1
  104. package/lib/features/agent/chat/index.js +3 -0
  105. package/lib/features/agent/chat/index.js.map +1 -1
  106. package/lib/features/environment/SelectEnvironment.d.ts +28 -0
  107. package/lib/features/environment/SelectEnvironment.d.ts.map +1 -0
  108. package/lib/features/environment/SelectEnvironment.js +97 -0
  109. package/lib/features/environment/SelectEnvironment.js.map +1 -0
  110. package/lib/features/environment/index.d.ts +2 -0
  111. package/lib/features/environment/index.d.ts.map +1 -0
  112. package/lib/features/environment/index.js +2 -0
  113. package/lib/features/environment/index.js.map +1 -0
  114. package/lib/features/index.d.ts +2 -0
  115. package/lib/features/index.d.ts.map +1 -1
  116. package/lib/features/index.js +2 -0
  117. package/lib/features/index.js.map +1 -1
  118. package/lib/features/magic-pdf/AnnotatedImageSlider.js +12 -12
  119. package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
  120. package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
  121. package/lib/features/magic-pdf/DownloadPopover.js +3 -17
  122. package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
  123. package/lib/features/magic-pdf/ExtractedContentView.js +2 -6
  124. package/lib/features/magic-pdf/ExtractedContentView.js.map +1 -1
  125. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +25 -0
  126. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +1 -0
  127. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +42 -0
  128. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +1 -0
  129. package/lib/features/magic-pdf/GroundedExtractionView.d.ts +27 -0
  130. package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -0
  131. package/lib/features/magic-pdf/GroundedExtractionView.js +377 -0
  132. package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -0
  133. package/lib/features/magic-pdf/MagicPdfProvider.d.ts +0 -2
  134. package/lib/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -1
  135. package/lib/features/magic-pdf/MagicPdfProvider.js +15 -42
  136. package/lib/features/magic-pdf/MagicPdfProvider.js.map +1 -1
  137. package/lib/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
  138. package/lib/features/magic-pdf/MagicPdfView.js +2 -19
  139. package/lib/features/magic-pdf/MagicPdfView.js.map +1 -1
  140. package/lib/features/magic-pdf/index.d.ts +1 -0
  141. package/lib/features/magic-pdf/index.d.ts.map +1 -1
  142. package/lib/features/magic-pdf/index.js +1 -0
  143. package/lib/features/magic-pdf/index.js.map +1 -1
  144. package/lib/features/magic-pdf/types.d.ts +1 -1
  145. package/lib/features/magic-pdf/types.d.ts.map +1 -1
  146. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
  147. package/lib/features/oauth/McpConnectionsButton.js +2 -2
  148. package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
  149. package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
  150. package/lib/features/oauth/McpConnectionsDialog.js +1 -1
  151. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
  152. package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
  153. package/lib/features/oauth/RemoteMcpConnectionButton.js +1 -1
  154. package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
  155. package/lib/features/pdf-viewer/PdfPageSlider.js +2 -2
  156. package/lib/features/pdf-viewer/PdfPageSlider.js.map +1 -1
  157. package/lib/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -1
  158. package/lib/features/pdf-viewer/SimplePdfViewer.js +3 -3
  159. package/lib/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
  160. package/lib/features/permissions/UserPermissionsProvider.js +1 -1
  161. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  162. package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -1
  163. package/lib/features/store/objects/DocumentQuickFilter.js +5 -5
  164. package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -1
  165. package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
  166. package/lib/features/store/objects/DocumentSearchResults.js +4 -4
  167. package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
  168. package/lib/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -1
  169. package/lib/features/store/objects/components/ContentDispositionButton.js +1 -1
  170. package/lib/features/store/objects/components/ContentDispositionButton.js.map +1 -1
  171. package/lib/features/store/objects/components/ContentOverview.d.ts +2 -1
  172. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  173. package/lib/features/store/objects/components/ContentOverview.js +159 -31
  174. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  175. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts +16 -0
  176. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts.map +1 -0
  177. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js +116 -0
  178. package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js.map +1 -0
  179. package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts +7 -0
  180. package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts.map +1 -0
  181. package/lib/features/store/objects/components/DocumentEditingLockStatus.js +13 -0
  182. package/lib/features/store/objects/components/DocumentEditingLockStatus.js.map +1 -0
  183. package/lib/features/store/objects/components/DocumentEditingPanel.d.ts +48 -0
  184. package/lib/features/store/objects/components/DocumentEditingPanel.d.ts.map +1 -0
  185. package/lib/features/store/objects/components/DocumentEditingPanel.js +720 -0
  186. package/lib/features/store/objects/components/DocumentEditingPanel.js.map +1 -0
  187. package/lib/features/store/objects/components/DocumentIcon.js +1 -1
  188. package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
  189. package/lib/features/store/objects/components/TextEditorPanel.js +22 -9
  190. package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
  191. package/lib/features/store/objects/components/VectorSearchWidget.js +1 -1
  192. package/lib/features/store/objects/components/VectorSearchWidget.js.map +1 -1
  193. package/lib/features/store/objects/components/documentArtifactRefs.d.ts +26 -0
  194. package/lib/features/store/objects/components/documentArtifactRefs.d.ts.map +1 -0
  195. package/lib/features/store/objects/components/documentArtifactRefs.js +52 -0
  196. package/lib/features/store/objects/components/documentArtifactRefs.js.map +1 -0
  197. package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts +4 -0
  198. package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts.map +1 -0
  199. package/lib/features/store/objects/components/documentEditingAgentConfig.js +40 -0
  200. package/lib/features/store/objects/components/documentEditingAgentConfig.js.map +1 -0
  201. package/lib/features/store/objects/components/documentEditingPrompts.d.ts +3 -0
  202. package/lib/features/store/objects/components/documentEditingPrompts.d.ts.map +1 -0
  203. package/lib/features/store/objects/components/documentEditingPrompts.js +13 -0
  204. package/lib/features/store/objects/components/documentEditingPrompts.js.map +1 -0
  205. package/lib/features/store/objects/components/documentEditingRun.d.ts +27 -0
  206. package/lib/features/store/objects/components/documentEditingRun.d.ts.map +1 -0
  207. package/lib/features/store/objects/components/documentEditingRun.js +126 -0
  208. package/lib/features/store/objects/components/documentEditingRun.js.map +1 -0
  209. package/lib/features/store/objects/components/documentEditingTarget.d.ts +20 -0
  210. package/lib/features/store/objects/components/documentEditingTarget.d.ts.map +1 -0
  211. package/lib/features/store/objects/components/documentEditingTarget.js +40 -0
  212. package/lib/features/store/objects/components/documentEditingTarget.js.map +1 -0
  213. package/lib/features/store/objects/components/index.d.ts +1 -0
  214. package/lib/features/store/objects/components/index.d.ts.map +1 -1
  215. package/lib/features/store/objects/components/index.js +1 -0
  216. package/lib/features/store/objects/components/index.js.map +1 -1
  217. package/lib/features/store/objects/components/useContentPanelHooks.d.ts +6 -3
  218. package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
  219. package/lib/features/store/objects/components/useContentPanelHooks.js +57 -37
  220. package/lib/features/store/objects/components/useContentPanelHooks.js.map +1 -1
  221. package/lib/features/store/objects/components/useDownloadFile.d.ts +2 -1
  222. package/lib/features/store/objects/components/useDownloadFile.d.ts.map +1 -1
  223. package/lib/features/store/objects/components/useDownloadFile.js +3 -0
  224. package/lib/features/store/objects/components/useDownloadFile.js.map +1 -1
  225. package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
  226. package/lib/features/store/objects/layout/renderers.js +2 -2
  227. package/lib/features/store/objects/layout/renderers.js.map +1 -1
  228. package/lib/features/store/objects/selection/SelectionActions.js +1 -1
  229. package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
  230. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +1 -1
  231. package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +1 -1
  232. package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  233. package/lib/features/store/types/ContentObjectTypesTable.js +4 -4
  234. package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
  235. package/lib/features/store/types/IntakePolicyEditor.d.ts +15 -0
  236. package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -0
  237. package/lib/features/store/types/IntakePolicyEditor.js +455 -0
  238. package/lib/features/store/types/IntakePolicyEditor.js.map +1 -0
  239. package/lib/features/store/types/IntakePolicyForm.d.ts +11 -0
  240. package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -0
  241. package/lib/features/store/types/IntakePolicyForm.js +91 -0
  242. package/lib/features/store/types/IntakePolicyForm.js.map +1 -0
  243. package/lib/features/store/types/SelectContentTypeModal.js +1 -1
  244. package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
  245. package/lib/features/store/types/index.d.ts +2 -0
  246. package/lib/features/store/types/index.d.ts.map +1 -1
  247. package/lib/features/store/types/index.js +2 -0
  248. package/lib/features/store/types/index.js.map +1 -1
  249. package/lib/features/store/types/intake-policy-editor.logic.d.ts +7 -0
  250. package/lib/features/store/types/intake-policy-editor.logic.d.ts.map +1 -0
  251. package/lib/features/store/types/intake-policy-editor.logic.js +60 -0
  252. package/lib/features/store/types/intake-policy-editor.logic.js.map +1 -0
  253. package/lib/features/store/types/typeCatalogCache.d.ts +5 -0
  254. package/lib/features/store/types/typeCatalogCache.d.ts.map +1 -0
  255. package/lib/features/store/types/typeCatalogCache.js +40 -0
  256. package/lib/features/store/types/typeCatalogCache.js.map +1 -0
  257. package/lib/features/user/UserInfo.js +7 -3
  258. package/lib/features/user/UserInfo.js.map +1 -1
  259. package/lib/features/views/ViewExperience.d.ts +20 -0
  260. package/lib/features/views/ViewExperience.d.ts.map +1 -0
  261. package/lib/features/views/ViewExperience.js +188 -0
  262. package/lib/features/views/ViewExperience.js.map +1 -0
  263. package/lib/features/views/ViewNavigation.d.ts +3 -0
  264. package/lib/features/views/ViewNavigation.d.ts.map +1 -0
  265. package/lib/features/views/ViewNavigation.js +36 -0
  266. package/lib/features/views/ViewNavigation.js.map +1 -0
  267. package/lib/features/views/ViewResults.d.ts +9 -0
  268. package/lib/features/views/ViewResults.d.ts.map +1 -0
  269. package/lib/features/views/ViewResults.js +229 -0
  270. package/lib/features/views/ViewResults.js.map +1 -0
  271. package/lib/features/views/ViewSearch.d.ts +3 -0
  272. package/lib/features/views/ViewSearch.d.ts.map +1 -0
  273. package/lib/features/views/ViewSearch.js +74 -0
  274. package/lib/features/views/ViewSearch.js.map +1 -0
  275. package/lib/features/views/index.d.ts +7 -0
  276. package/lib/features/views/index.d.ts.map +1 -0
  277. package/lib/features/views/index.js +7 -0
  278. package/lib/features/views/index.js.map +1 -0
  279. package/lib/features/views/types.d.ts +39 -0
  280. package/lib/features/views/types.d.ts.map +1 -0
  281. package/lib/features/views/types.js +2 -0
  282. package/lib/features/views/types.js.map +1 -0
  283. package/lib/features/views/viewState.d.ts +14 -0
  284. package/lib/features/views/viewState.d.ts.map +1 -0
  285. package/lib/features/views/viewState.js +117 -0
  286. package/lib/features/views/viewState.js.map +1 -0
  287. package/lib/i18n/locales/ar.json +134 -1
  288. package/lib/i18n/locales/de.json +130 -1
  289. package/lib/i18n/locales/en.json +363 -33
  290. package/lib/i18n/locales/es.json +131 -1
  291. package/lib/i18n/locales/fr.json +131 -1
  292. package/lib/i18n/locales/it.json +131 -1
  293. package/lib/i18n/locales/ja.json +129 -1
  294. package/lib/i18n/locales/ko.json +129 -1
  295. package/lib/i18n/locales/pt.json +131 -1
  296. package/lib/i18n/locales/ru.json +132 -1
  297. package/lib/i18n/locales/tr.json +130 -1
  298. package/lib/i18n/locales/zh-TW.json +129 -1
  299. package/lib/i18n/locales/zh.json +129 -1
  300. package/lib/rich-text/EditorToolbar.d.ts +37 -0
  301. package/lib/rich-text/EditorToolbar.d.ts.map +1 -0
  302. package/lib/rich-text/EditorToolbar.js +215 -0
  303. package/lib/rich-text/EditorToolbar.js.map +1 -0
  304. package/lib/rich-text/VertesiaRichTextEditor.d.ts +26 -0
  305. package/lib/rich-text/VertesiaRichTextEditor.d.ts.map +1 -0
  306. package/lib/rich-text/VertesiaRichTextEditor.js +67 -0
  307. package/lib/rich-text/VertesiaRichTextEditor.js.map +1 -0
  308. package/lib/rich-text/index.d.ts +2 -0
  309. package/lib/rich-text/index.d.ts.map +1 -0
  310. package/lib/rich-text/index.js +2 -0
  311. package/lib/rich-text/index.js.map +1 -0
  312. package/lib/router/HistoryNavigator.d.ts.map +1 -1
  313. package/lib/router/HistoryNavigator.js +23 -13
  314. package/lib/router/HistoryNavigator.js.map +1 -1
  315. package/lib/router/Nav.d.ts.map +1 -1
  316. package/lib/router/Nav.js +15 -6
  317. package/lib/router/Nav.js.map +1 -1
  318. package/lib/session/UserSession.d.ts.map +1 -1
  319. package/lib/session/UserSession.js +5 -3
  320. package/lib/session/UserSession.js.map +1 -1
  321. package/lib/vertesia-ui-core.js +4 -4
  322. package/lib/vertesia-ui-core.js.map +1 -1
  323. package/lib/vertesia-ui-features.js +40 -28
  324. package/lib/vertesia-ui-features.js.map +1 -1
  325. package/lib/vertesia-ui-i18n.js +15 -15
  326. package/lib/vertesia-ui-i18n.js.map +1 -1
  327. package/lib/vertesia-ui-rich-text.js +5 -0
  328. package/lib/vertesia-ui-rich-text.js.map +1 -0
  329. package/lib/vertesia-ui-router.js +1 -1
  330. package/lib/vertesia-ui-router.js.map +1 -1
  331. package/lib/vertesia-ui-session.js +1 -1
  332. package/lib/vertesia-ui-session.js.map +1 -1
  333. package/lib/vertesia-ui-shell.js +1 -1
  334. package/lib/vertesia-ui-shell.js.map +1 -1
  335. package/lib/vertesia-ui-widgets.js +25 -7
  336. package/lib/vertesia-ui-widgets.js.map +1 -1
  337. package/lib/widgets/form/Form.js +1 -1
  338. package/lib/widgets/form/Form.js.map +1 -1
  339. package/lib/widgets/json-view/JSONSwitcher.js +1 -1
  340. package/lib/widgets/json-view/JSONSwitcher.js.map +1 -1
  341. package/lib/widgets/json-view/JSONView.js +6 -6
  342. package/lib/widgets/json-view/JSONView.js.map +1 -1
  343. package/lib/widgets/markdown/AgentResourceResolver.d.ts +31 -0
  344. package/lib/widgets/markdown/AgentResourceResolver.d.ts.map +1 -0
  345. package/lib/widgets/markdown/AgentResourceResolver.js +39 -0
  346. package/lib/widgets/markdown/AgentResourceResolver.js.map +1 -0
  347. package/lib/widgets/markdown/ArtifactEditingSurface.d.ts +63 -0
  348. package/lib/widgets/markdown/ArtifactEditingSurface.d.ts.map +1 -0
  349. package/lib/widgets/markdown/ArtifactEditingSurface.js +582 -0
  350. package/lib/widgets/markdown/ArtifactEditingSurface.js.map +1 -0
  351. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts +69 -0
  352. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts.map +1 -0
  353. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js +374 -0
  354. package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js.map +1 -0
  355. package/lib/widgets/markdown/MarkdownLink.d.ts +3 -1
  356. package/lib/widgets/markdown/MarkdownLink.d.ts.map +1 -1
  357. package/lib/widgets/markdown/MarkdownLink.js +41 -14
  358. package/lib/widgets/markdown/MarkdownLink.js.map +1 -1
  359. package/lib/widgets/markdown/MarkdownRenderer.d.ts +8 -1
  360. package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  361. package/lib/widgets/markdown/MarkdownRenderer.js +20 -4
  362. package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
  363. package/lib/widgets/markdown/index.d.ts +5 -1
  364. package/lib/widgets/markdown/index.d.ts.map +1 -1
  365. package/lib/widgets/markdown/index.js +5 -1
  366. package/lib/widgets/markdown/index.js.map +1 -1
  367. package/lib/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -1
  368. package/lib/widgets/markdown/normalizeCustomSchemeLinks.js +14 -2
  369. package/lib/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -1
  370. package/lib/widgets/markdown/textDiff.d.ts +52 -0
  371. package/lib/widgets/markdown/textDiff.d.ts.map +1 -0
  372. package/lib/widgets/markdown/textDiff.js +362 -0
  373. package/lib/widgets/markdown/textDiff.js.map +1 -0
  374. package/lib/widgets/markdown/useArtifactContent.d.ts +5 -3
  375. package/lib/widgets/markdown/useArtifactContent.d.ts.map +1 -1
  376. package/lib/widgets/markdown/useArtifactContent.js +6 -3
  377. package/lib/widgets/markdown/useArtifactContent.js.map +1 -1
  378. package/lib/widgets/markdown/useResolvedUrl.d.ts +1 -5
  379. package/lib/widgets/markdown/useResolvedUrl.d.ts.map +1 -1
  380. package/lib/widgets/markdown/useResolvedUrl.js +19 -31
  381. package/lib/widgets/markdown/useResolvedUrl.js.map +1 -1
  382. package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
  383. package/lib/widgets/monacoEditor/MonacoEditor.js +29 -0
  384. package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
  385. package/lib/widgets/schema-editor/ManagedSchema.d.ts +8 -0
  386. package/lib/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
  387. package/lib/widgets/schema-editor/ManagedSchema.js +16 -0
  388. package/lib/widgets/schema-editor/ManagedSchema.js.map +1 -1
  389. package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +2 -0
  390. package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts.map +1 -1
  391. package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js +1 -0
  392. package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -1
  393. package/lib/widgets/schema-editor/editor/PropertyViewer.d.ts.map +1 -1
  394. package/lib/widgets/schema-editor/editor/PropertyViewer.js +4 -1
  395. package/lib/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
  396. package/lib/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -1
  397. package/lib/widgets/schema-editor/editor/SchemaEditor.js +22 -11
  398. package/lib/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  399. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts +9 -0
  400. package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -1
  401. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js +20 -17
  402. package/lib/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -1
  403. package/package.json +37 -33
  404. package/src/__tests__/a11y.test.tsx +77 -1
  405. package/src/__tests__/axe-helper.ts +17 -7
  406. package/src/__tests__/setup.ts +25 -0
  407. package/src/core/components/SidePanel.tsx +1 -1
  408. package/src/core/components/shadcn/button.tsx +67 -12
  409. package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
  410. package/src/core/components/shadcn/modal/dialog.tsx +4 -2
  411. package/src/core/components/shadcn/tabs.test.tsx +65 -0
  412. package/src/core/components/shadcn/tabs.tsx +25 -3
  413. package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +1 -1
  414. package/src/features/agent/chat/AgentChatPlaybackControls.tsx +0 -5
  415. package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +31 -0
  416. package/src/features/agent/chat/AgentRequestInputOverlay.tsx +6 -2
  417. package/src/features/agent/chat/AgentRightPanel.tsx +16 -1
  418. package/src/features/agent/chat/ArtifactsTab.test.tsx +55 -0
  419. package/src/features/agent/chat/ArtifactsTab.tsx +222 -61
  420. package/src/features/agent/chat/DocumentEditingActionCard.test.tsx +105 -0
  421. package/src/features/agent/chat/DocumentEditingActionCard.tsx +210 -0
  422. package/src/features/agent/chat/ImageLightbox.tsx +0 -1
  423. package/src/features/agent/chat/ModernAgentConversation.test.tsx +285 -40
  424. package/src/features/agent/chat/ModernAgentConversation.tsx +247 -77
  425. package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.test.tsx +79 -0
  426. package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.tsx +94 -0
  427. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +263 -35
  428. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +236 -118
  429. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +17 -0
  430. package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.test.tsx +44 -0
  431. package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.tsx +88 -0
  432. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -3
  433. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +0 -2
  434. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +34 -47
  435. package/src/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.tsx +40 -0
  436. package/src/features/agent/chat/ModernAgentOutput/ResourceChip.test.tsx +148 -0
  437. package/src/features/agent/chat/ModernAgentOutput/ResourceChip.tsx +141 -0
  438. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +33 -1
  439. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.test.ts +80 -0
  440. package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +21 -1
  441. package/src/features/agent/chat/ModernAgentOutput/resourceLinks.tsx +43 -0
  442. package/src/features/agent/chat/ModernAgentOutput/resourceSummary.test.ts +229 -0
  443. package/src/features/agent/chat/ModernAgentOutput/resourceSummary.ts +152 -0
  444. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +17 -0
  445. package/src/features/agent/chat/ModernAgentOutput/utils.ts +14 -1
  446. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +188 -0
  447. package/src/features/agent/chat/hooks/useAgentStream.ts +28 -8
  448. package/src/features/agent/chat/index.ts +11 -0
  449. package/src/features/environment/SelectEnvironment.tsx +186 -0
  450. package/src/features/environment/index.ts +1 -0
  451. package/src/features/index.ts +2 -0
  452. package/src/features/magic-pdf/AnnotatedImageSlider.tsx +62 -66
  453. package/src/features/magic-pdf/DownloadPopover.tsx +5 -48
  454. package/src/features/magic-pdf/ExtractedContentView.tsx +2 -14
  455. package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +86 -0
  456. package/src/features/magic-pdf/GroundedExtractionView.test.tsx +65 -0
  457. package/src/features/magic-pdf/GroundedExtractionView.tsx +1055 -0
  458. package/src/features/magic-pdf/MagicPdfProvider.tsx +17 -47
  459. package/src/features/magic-pdf/MagicPdfView.tsx +3 -51
  460. package/src/features/magic-pdf/index.ts +1 -0
  461. package/src/features/magic-pdf/types.ts +1 -1
  462. package/src/features/oauth/McpConnectionsButton.tsx +0 -2
  463. package/src/features/oauth/McpConnectionsDialog.tsx +0 -1
  464. package/src/features/oauth/RemoteMcpConnectionButton.tsx +0 -1
  465. package/src/features/pdf-viewer/PdfPageSlider.tsx +5 -5
  466. package/src/features/pdf-viewer/SimplePdfViewer.tsx +11 -12
  467. package/src/features/permissions/UserPermissionsProvider.tsx +1 -1
  468. package/src/features/store/objects/DocumentQuickFilter.tsx +13 -15
  469. package/src/features/store/objects/DocumentSearchResults.tsx +5 -8
  470. package/src/features/store/objects/components/ContentDispositionButton.tsx +5 -1
  471. package/src/features/store/objects/components/ContentOverview.tsx +356 -105
  472. package/src/features/store/objects/components/DocumentEditingConfigurationSelector.test.ts +34 -0
  473. package/src/features/store/objects/components/DocumentEditingConfigurationSelector.tsx +211 -0
  474. package/src/features/store/objects/components/DocumentEditingLockStatus.test.tsx +32 -0
  475. package/src/features/store/objects/components/DocumentEditingLockStatus.tsx +45 -0
  476. package/src/features/store/objects/components/DocumentEditingPanel.test.tsx +336 -0
  477. package/src/features/store/objects/components/DocumentEditingPanel.tsx +1236 -0
  478. package/src/features/store/objects/components/DocumentIcon.tsx +1 -1
  479. package/src/features/store/objects/components/TextEditorPanel.test.tsx +48 -0
  480. package/src/features/store/objects/components/TextEditorPanel.tsx +41 -20
  481. package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
  482. package/src/features/store/objects/components/documentArtifactRefs.test.ts +65 -0
  483. package/src/features/store/objects/components/documentArtifactRefs.ts +72 -0
  484. package/src/features/store/objects/components/documentEditingAgentConfig.test.ts +28 -0
  485. package/src/features/store/objects/components/documentEditingAgentConfig.ts +41 -0
  486. package/src/features/store/objects/components/documentEditingPrompts.test.ts +26 -0
  487. package/src/features/store/objects/components/documentEditingPrompts.ts +12 -0
  488. package/src/features/store/objects/components/documentEditingRun.test.ts +176 -0
  489. package/src/features/store/objects/components/documentEditingRun.ts +184 -0
  490. package/src/features/store/objects/components/documentEditingTarget.test.ts +96 -0
  491. package/src/features/store/objects/components/documentEditingTarget.ts +63 -0
  492. package/src/features/store/objects/components/index.ts +1 -0
  493. package/src/features/store/objects/components/useContentPanelHooks.ts +55 -42
  494. package/src/features/store/objects/components/useDownloadFile.test.ts +20 -0
  495. package/src/features/store/objects/components/useDownloadFile.ts +5 -1
  496. package/src/features/store/objects/layout/renderers.tsx +1 -2
  497. package/src/features/store/objects/selection/SelectionActions.tsx +1 -1
  498. package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +2 -2
  499. package/src/features/store/types/ContentObjectTypesTable.tsx +12 -14
  500. package/src/features/store/types/IntakePolicyEditor.tsx +679 -0
  501. package/src/features/store/types/IntakePolicyForm.tsx +838 -0
  502. package/src/features/store/types/SelectContentTypeModal.tsx +2 -2
  503. package/src/features/store/types/index.ts +2 -0
  504. package/src/features/store/types/intake-policy-editor.logic.test.ts +109 -0
  505. package/src/features/store/types/intake-policy-editor.logic.ts +87 -0
  506. package/src/features/store/types/typeCatalogCache.ts +45 -0
  507. package/src/features/user/UserInfo.tsx +7 -7
  508. package/src/features/views/ViewExperience.test.tsx +273 -0
  509. package/src/features/views/ViewExperience.tsx +408 -0
  510. package/src/features/views/ViewNavigation.test.tsx +86 -0
  511. package/src/features/views/ViewNavigation.tsx +187 -0
  512. package/src/features/views/ViewResults.test.ts +82 -0
  513. package/src/features/views/ViewResults.tsx +609 -0
  514. package/src/features/views/ViewSearch.test.tsx +147 -0
  515. package/src/features/views/ViewSearch.tsx +205 -0
  516. package/src/features/views/index.ts +6 -0
  517. package/src/features/views/types.ts +57 -0
  518. package/src/features/views/viewState.test.ts +111 -0
  519. package/src/features/views/viewState.ts +132 -0
  520. package/src/i18n/locales/ar.json +134 -1
  521. package/src/i18n/locales/de.json +130 -1
  522. package/src/i18n/locales/en.json +1083 -753
  523. package/src/i18n/locales/es.json +131 -1
  524. package/src/i18n/locales/fr.json +131 -1
  525. package/src/i18n/locales/it.json +131 -1
  526. package/src/i18n/locales/ja.json +129 -1
  527. package/src/i18n/locales/ko.json +129 -1
  528. package/src/i18n/locales/pt.json +131 -1
  529. package/src/i18n/locales/ru.json +132 -1
  530. package/src/i18n/locales/tr.json +130 -1
  531. package/src/i18n/locales/zh-TW.json +129 -1
  532. package/src/i18n/locales/zh.json +129 -1
  533. package/src/rich-text/EditorToolbar.tsx +708 -0
  534. package/src/rich-text/VertesiaRichTextEditor.test.tsx +211 -0
  535. package/src/rich-text/VertesiaRichTextEditor.tsx +241 -0
  536. package/src/rich-text/index.ts +9 -0
  537. package/src/router/HistoryNavigator.test.ts +48 -0
  538. package/src/router/HistoryNavigator.ts +24 -13
  539. package/src/router/Nav.tsx +18 -8
  540. package/src/session/UserSession.test.ts +39 -0
  541. package/src/session/UserSession.ts +5 -3
  542. package/src/widgets/form/Form.tsx +1 -1
  543. package/src/widgets/json-view/JSONSwitcher.tsx +2 -2
  544. package/src/widgets/json-view/JSONView.tsx +7 -7
  545. package/src/widgets/markdown/AgentResourceResolver.test.ts +24 -0
  546. package/src/widgets/markdown/AgentResourceResolver.tsx +70 -0
  547. package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +537 -0
  548. package/src/widgets/markdown/ArtifactEditingSurface.tsx +878 -0
  549. package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +484 -0
  550. package/src/widgets/markdown/CollaborativeMarkdownRenderer.tsx +825 -0
  551. package/src/widgets/markdown/MarkdownLink.test.tsx +122 -0
  552. package/src/widgets/markdown/MarkdownLink.tsx +102 -17
  553. package/src/widgets/markdown/MarkdownRenderer.tsx +30 -3
  554. package/src/widgets/markdown/index.ts +39 -1
  555. package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +15 -2
  556. package/src/widgets/markdown/textDiff.test.ts +156 -0
  557. package/src/widgets/markdown/textDiff.ts +399 -0
  558. package/src/widgets/markdown/useArtifactContent.ts +9 -3
  559. package/src/widgets/markdown/useResolvedUrl.test.ts +29 -40
  560. package/src/widgets/markdown/useResolvedUrl.ts +33 -35
  561. package/src/widgets/monacoEditor/MonacoEditor.tsx +29 -0
  562. package/src/widgets/schema-editor/ManagedSchema.ts +22 -0
  563. package/src/widgets/schema-editor/editor/EditableSchemaProperty.tsx +3 -0
  564. package/src/widgets/schema-editor/editor/PropertyViewer.tsx +14 -3
  565. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +80 -29
  566. package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
  567. package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, errorMessage, useToast } from '@vertesia/ui/core';
2
+ import { Button, errorMessage, Switch, useToast } from '@vertesia/ui/core';
3
3
  import { useUITranslation } from '@vertesia/ui/i18n';
4
4
  import { ChevronDown, ChevronRight, Plus } from 'lucide-react';
5
5
  import { useState } from 'react';
@@ -14,20 +14,21 @@ function skipClickOutside(e) {
14
14
  return !!target.closest?.('.schema-type-suggest-popup');
15
15
  }
16
16
  export function SchemaEditor({ schema, readonly = false }) {
17
- return (_jsxs("ul", { className: "", children: [schema.children.map((prop) => {
18
- return renderProperty(prop, readonly);
19
- }), !readonly ? _jsx(AddPropertyButton, { parent: schema.root }) : null] }));
17
+ const { t } = useUITranslation();
18
+ return (_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted-foreground border-b border-border", children: [_jsx("div", { className: "flex-1 min-w-0", children: t('widgets.schema.propertyColumn') }), !readonly && (_jsx("div", { className: "shrink-0 w-28 text-end pe-1", title: t('widgets.schema.extractFromDocumentHint'), children: t('widgets.schema.extractFromDocument') })), _jsx("div", { className: "w-8 shrink-0" })] }), _jsxs("ul", { className: "", children: [schema.children.map((prop) => {
19
+ return renderProperty(prop, readonly);
20
+ }), !readonly ? _jsx(AddPropertyButton, { parent: schema.root }) : null] })] }));
20
21
  }
21
22
  function renderProperty(node, readonly) {
22
23
  return node.isParent ? (_jsx(ParentItem, { property: node, readonly: readonly }, node.name)) : (_jsx(SimpleItem, { node: node, readonly: readonly }, node.name));
23
24
  }
24
25
  function SimpleItem({ node, readonly }) {
25
- return (_jsx("li", { children: _jsx(PropertyTitleBar, { property: node, readonly: readonly }) }));
26
+ return (_jsx("li", { className: "border-b border-border/40 last:border-0", children: _jsx(PropertyTitleBar, { property: node, readonly: readonly }) }));
26
27
  }
27
28
  function ParentItem({ property, readonly }) {
28
29
  const [isOpen, setOpen] = useState(true);
29
30
  const Icon = isOpen ? ChevronDown : ChevronRight;
30
- return (_jsxs("li", { children: [_jsxs("div", { className: "flex items-center w-full", children: [_jsx(Button, { variant: "ghost", size: "icon", onClick: () => setOpen(!isOpen), "aria-label": isOpen ? `Collapse ${property.name}` : `Expand ${property.name}`, "aria-expanded": isOpen, children: _jsx(Icon, { className: "size-4 cn-rtl-flip" }) }), _jsx("div", { className: "flex-1", children: _jsx(PropertyTitleBar, { property: property, readonly: readonly }) })] }), isOpen && (_jsxs("ul", { className: "ms-4 border-s border-gray-400 border-dashed", children: [(property.children || []).map((prop) => renderProperty(prop, readonly)), !readonly ? _jsx(AddPropertyButton, { parent: property }) : null] }))] }));
31
+ return (_jsxs("li", { className: "border-b border-border/40 last:border-0", children: [_jsxs("div", { className: "flex items-center w-full gap-1", children: [_jsx("div", { className: "flex-1 min-w-0", children: _jsx(PropertyTitleBar, { property: property, readonly: readonly }) }), _jsx(Button, { variant: "ghost", size: "icon", onClick: () => setOpen(!isOpen), "aria-label": isOpen ? `Collapse ${property.name}` : `Expand ${property.name}`, "aria-expanded": isOpen, className: "shrink-0", children: _jsx(Icon, { className: "size-4 cn-rtl-flip" }) })] }), isOpen && (_jsxs("ul", { className: "ms-4 border-s border-gray-400 border-dashed", children: [(property.children || []).map((prop) => renderProperty(prop, readonly)), !readonly ? _jsx(AddPropertyButton, { parent: property }) : null] }))] }));
31
32
  }
32
33
  export function validatePropertyName(propertyName) {
33
34
  if (!propertyName) {
@@ -47,7 +48,11 @@ function PropertyTitleBar({ property, readonly }) {
47
48
  value.description = undefined;
48
49
  }
49
50
  const update = property.getUpdateFromNameAndTypeSignature(value.name, value.type);
50
- if (property.update({ ...update, description: value.description })) {
51
+ if (property.update({
52
+ ...update,
53
+ description: value.description,
54
+ extractable: value.extractable,
55
+ })) {
51
56
  property.reloadTree();
52
57
  }
53
58
  }
@@ -62,12 +67,18 @@ function PropertyTitleBar({ property, readonly }) {
62
67
  }
63
68
  return true;
64
69
  };
70
+ /** Toggle extractability without entering name/type edit mode. */
71
+ const onExtractableChange = (extractable) => {
72
+ if (property.update({ extractable })) {
73
+ property.reloadTree();
74
+ }
75
+ };
65
76
  const isNew = property.resetIsNew();
66
77
  const editableProp = getEditableSchemaProperty(property);
67
- return (_jsx(Editable, { value: editableProp, onChange: onChange, onDelete: () => {
68
- property.remove();
69
- property.reloadTree();
70
- }, editor: PropertyEditor, viewer: PropertyViewer, outlineOnHover: true, isEditing: isNew, skipClickOutside: skipClickOutside, readonly: readonly, onValidate: (property) => validatePropertyName(property.name) }));
78
+ return (_jsxs("div", { className: "flex items-center gap-2 w-full min-w-0 py-0.5", children: [_jsx("div", { className: "flex-1 min-w-0", children: _jsx(Editable, { value: editableProp, onChange: onChange, onDelete: () => {
79
+ property.remove();
80
+ property.reloadTree();
81
+ }, editor: PropertyEditor, viewer: PropertyViewer, outlineOnHover: true, isEditing: isNew, skipClickOutside: skipClickOutside, readonly: readonly, onValidate: (prop) => validatePropertyName(prop.name) }) }), !readonly ? (_jsx("div", { className: "shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1", children: _jsx(Switch, { size: "sm", value: property.extractable, onChange: onExtractableChange, "aria-label": `${t('widgets.schema.extractFromDocument')}: ${property.name}` }) })) : property.extractable === false ? (_jsx("div", { className: "shrink-0 w-28 flex justify-end pe-1", children: _jsx("span", { className: "text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5", title: t('widgets.schema.extractFromDocumentHint'), children: t('widgets.schema.noExtract') }) })) : null] }));
71
82
  }
72
83
  function AddPropertyButton({ parent }) {
73
84
  const add = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaEditor.js","sourceRoot":"","sources":["../../../../src/widgets/schema-editor/editor/SchemaEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAA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,IAAI,IAAC,SAAS,EAAC,QAAQ,GAAG,oBAEtB,CACZ,CAAC;AACN,CAAC"}
@@ -1,3 +1,12 @@
1
+ export declare function parseXML(xml: string): {
2
+ json: any;
3
+ valid: boolean;
4
+ errorMessage?: undefined;
5
+ } | {
6
+ json: null;
7
+ valid: boolean;
8
+ errorMessage: string;
9
+ };
1
10
  export default function useXMLViewer(xml: string): {
2
11
  json: any;
3
12
  valid: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useXMLViewer.d.ts","sourceRoot":"","sources":["../../../../src/widgets/xml-viewer/hooks/useXMLViewer.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,MAAM;;;;;;;;EAoB/C"}
1
+ {"version":3,"file":"useXMLViewer.d.ts","sourceRoot":"","sources":["../../../../src/widgets/xml-viewer/hooks/useXMLViewer.ts"],"names":[],"mappings":"AAcA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM;;;;;;;;EAsBnC;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAG,EAAE,MAAM;;;;;;;;EAE/C"}
@@ -1,5 +1,4 @@
1
1
  import { XMLParser } from 'fast-xml-parser';
2
- import { SyntaxValidator } from 'fast-xml-validator';
3
2
  import { useMemo } from 'react';
4
3
  import { ATTRIBUTE_CDATA, ATTRIBUTE_COMMENT } from '../constants';
5
4
  const parser = new XMLParser({
@@ -11,23 +10,27 @@ const parser = new XMLParser({
11
10
  cdataPropName: ATTRIBUTE_CDATA,
12
11
  parseTagValue: false,
13
12
  });
14
- export default function useXMLViewer(xml) {
15
- return useMemo(() => {
16
- try {
17
- const validationResult = SyntaxValidator.validate(xml);
18
- if (validationResult !== true) {
19
- throw new Error(validationResult.err.msg || 'Invalid XML!');
20
- }
21
- const json = parser.parse(xml);
22
- if (typeof xml === 'string' && xml.trim().length > 0 && json.length === 0) {
23
- throw new Error('Invalid XML!');
24
- }
25
- return { json, valid: true };
13
+ export function parseXML(xml) {
14
+ try {
15
+ const validationDocument = new DOMParser().parseFromString(xml, 'application/xml');
16
+ const parserError = validationDocument.documentElement.localName === 'parsererror'
17
+ ? validationDocument.documentElement
18
+ : undefined;
19
+ if (parserError) {
20
+ throw new Error(parserError.textContent?.trim() || 'Invalid XML!');
26
21
  }
27
- catch (e) {
28
- const error = e;
29
- return { json: null, valid: false, errorMessage: `Fail to parse: ${error.message}` };
22
+ const json = parser.parse(xml);
23
+ if (xml.trim().length > 0 && json.length === 0) {
24
+ throw new Error('Invalid XML!');
30
25
  }
31
- }, [xml]);
26
+ return { json, valid: true };
27
+ }
28
+ catch (error) {
29
+ const message = error instanceof Error ? error.message : String(error);
30
+ return { json: null, valid: false, errorMessage: `Fail to parse: ${message}` };
31
+ }
32
+ }
33
+ export default function useXMLViewer(xml) {
34
+ return useMemo(() => parseXML(xml), [xml]);
32
35
  }
33
36
  //# sourceMappingURL=useXMLViewer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useXMLViewer.js","sourceRoot":"","sources":["../../../../src/widgets/xml-viewer/hooks/useXMLViewer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IACzB,aAAa,EAAE,IAAI;IACnB,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,EAAE;IACvB,sBAAsB,EAAE,IAAI;IAC5B,eAAe,EAAE,iBAAiB;IAClC,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,KAAK;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,GAAW;IAC5C,OAAO,OAAO,CAAC,GAAG,EAAE;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E,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/ui",
3
- "version": "1.5.0-dev.20260717.131047Z",
3
+ "version": "1.5.0-dev.20260725.083715Z",
4
4
  "description": "Vertesia UI components and and hooks",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -21,27 +21,27 @@
21
21
  "hooks"
22
22
  ],
23
23
  "dependencies": {
24
- "@floating-ui/dom": "^1.7.6",
25
- "@floating-ui/react": "^0.27.19",
24
+ "@floating-ui/dom": "^1.8.0",
25
+ "@floating-ui/react": "^0.27.20",
26
26
  "@monaco-editor/react": "^4.7.0",
27
- "@radix-ui/react-checkbox": "^1.3.6",
28
- "@radix-ui/react-collapsible": "^1.1.15",
29
- "@radix-ui/react-dialog": "^1.1.18",
27
+ "@radix-ui/react-checkbox": "^1.3.7",
28
+ "@radix-ui/react-collapsible": "^1.1.16",
29
+ "@radix-ui/react-dialog": "^1.1.19",
30
30
  "@radix-ui/react-direction": "^1.1.2",
31
- "@radix-ui/react-dismissable-layer": "^1.1.14",
32
- "@radix-ui/react-dropdown-menu": "^2.1.19",
31
+ "@radix-ui/react-dismissable-layer": "^1.1.15",
32
+ "@radix-ui/react-dropdown-menu": "^2.1.20",
33
33
  "@radix-ui/react-focus-guards": "^1.1.4",
34
- "@radix-ui/react-focus-scope": "^1.1.11",
34
+ "@radix-ui/react-focus-scope": "^1.1.12",
35
35
  "@radix-ui/react-label": "^2.1.11",
36
- "@radix-ui/react-popover": "^1.1.18",
36
+ "@radix-ui/react-popover": "^1.1.19",
37
37
  "@radix-ui/react-portal": "^1.1.13",
38
- "@radix-ui/react-radio-group": "^1.4.2",
38
+ "@radix-ui/react-radio-group": "^1.4.3",
39
39
  "@radix-ui/react-separator": "^1.1.11",
40
- "@radix-ui/react-slider": "^1.4.2",
40
+ "@radix-ui/react-slider": "^1.4.3",
41
41
  "@radix-ui/react-slot": "^1.3.0",
42
- "@radix-ui/react-switch": "^1.3.2",
43
- "@radix-ui/react-tabs": "^1.1.16",
44
- "@radix-ui/react-tooltip": "^1.2.11",
42
+ "@radix-ui/react-switch": "^1.3.3",
43
+ "@radix-ui/react-tabs": "^1.1.17",
44
+ "@radix-ui/react-tooltip": "^1.2.12",
45
45
  "ajv": "^8.20.0",
46
46
  "ajv-formats": "^3.0.1",
47
47
  "aria-hidden": "^1.2.6",
@@ -50,16 +50,15 @@
50
50
  "cmdk": "^1.1.1",
51
51
  "dayjs": "^1.11.21",
52
52
  "debounce": "^3.0.0",
53
- "dompurify": "^3.4.11",
54
- "fast-xml-parser": "^5.9.3",
55
- "fast-xml-validator": "^1.1.1",
56
- "firebase": "^12.15.0",
53
+ "dompurify": "^3.4.12",
54
+ "fast-xml-parser": "^5.10.1",
55
+ "firebase": "^12.16.0",
57
56
  "framer-motion": "^12.42.2",
58
- "i18next": "^26.3.4",
57
+ "i18next": "^26.3.6",
59
58
  "jwt-decode": "^4.0.0",
60
59
  "katex": "^0.17.0",
61
60
  "lodash-es": "^4.18.1",
62
- "lucide-react": "^1.23.0",
61
+ "lucide-react": "^1.24.0",
63
62
  "mermaid": "^11.16.0",
64
63
  "monaco-editor": "^0.55.1",
65
64
  "motion": "^12.42.2",
@@ -69,12 +68,12 @@
69
68
  "react-date-picker": "^12.0.2",
70
69
  "react-dom": "19.2.7",
71
70
  "react-error-boundary": "^6.1.2",
72
- "react-i18next": "^17.0.8",
71
+ "react-i18next": "^17.0.9",
73
72
  "react-markdown": "^10.1.0",
74
73
  "react-pdf": "^10.4.1",
75
74
  "react-remove-scroll": "^2.7.2",
76
75
  "react-remove-scroll-bar": "^2.3.8",
77
- "react-resizable-panels": "^4.12.1",
76
+ "react-resizable-panels": "^4.12.2",
78
77
  "react-style-singleton": "^2.2.3",
79
78
  "react-vega": "^8.0.0",
80
79
  "rehype-katex": "^7.0.1",
@@ -90,27 +89,28 @@
90
89
  "vega": "^6.2.0",
91
90
  "vega-embed": "^7.1.0",
92
91
  "vega-lite": "^6.4.3",
93
- "@vertesia/client": "1.5.0-dev.20260717.131047Z",
94
- "@vertesia/common": "1.5.0-dev.20260717.131047Z",
95
- "@vertesia/fusion-ux": "1.5.0-dev.20260717.131047Z",
96
- "@vertesia/json": "1.5.0-dev.20260717.131047Z"
92
+ "@vertesia/client": "1.5.0-dev.20260725.083715Z",
93
+ "@vertesia/common": "1.5.0-dev.20260725.083715Z",
94
+ "@vertesia/fusion-ux": "1.5.0-dev.20260725.083715Z",
95
+ "@vertesia/rich-text": "1.5.0-dev.20260725.083715Z",
96
+ "@vertesia/json": "1.5.0-dev.20260725.083715Z"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@testing-library/react": "^16.3.2",
100
100
  "@testing-library/user-event": "^14.6.1",
101
- "@types/hast": "^3.0.4",
101
+ "@types/hast": "^3.0.5",
102
102
  "@types/lodash-es": "^4.17.12",
103
- "@types/node": "^24.13.2",
103
+ "@types/node": "^24.13.3",
104
104
  "@types/papaparse": "^5.5.2",
105
105
  "@types/react": "19.2.17",
106
106
  "@types/react-dom": "19.2.3",
107
107
  "axe-core": "^4.12.1",
108
108
  "culori": "^4.0.2",
109
- "i18next-cli": "^1.65.0",
109
+ "i18next-cli": "^1.66.0",
110
110
  "jsdom": "^29.1.1",
111
- "rolldown": "1.1.4",
111
+ "rolldown": "1.2.0",
112
112
  "typescript": "^6.0.3",
113
- "vitest": "^4.1.9",
113
+ "vitest": "^4.1.10",
114
114
  "vitest-axe": "^0.1.0",
115
115
  "wcag-contrast": "^3.0.0",
116
116
  "@vertesia/tsconfig": "0.1.0"
@@ -150,6 +150,10 @@
150
150
  "types": "./lib/widgets/index.d.ts",
151
151
  "default": "./lib/widgets/index.js"
152
152
  },
153
+ "./rich-text": {
154
+ "types": "./lib/rich-text/index.d.ts",
155
+ "default": "./lib/rich-text/index.js"
156
+ },
153
157
  "./code": {
154
158
  "types": "./lib/code/index.d.ts",
155
159
  "default": "./lib/code/index.js"
@@ -180,7 +184,7 @@
180
184
  "url": "https://github.com/vertesia/composableai.git",
181
185
  "directory": "packages/ui"
182
186
  },
183
- "gitHead": "8aaad228827b2927db8e6aa75b27bfac90fec36f",
187
+ "gitHead": "57bcc2f27dd17b3387f27c18e89329c4c37f98ac",
184
188
  "scripts": {
185
189
  "clean:lib": "rimraf ./lib ./tsconfig.tsbuildinfo",
186
190
  "clean": "rimraf ./node_modules ./lib ./tsconfig.tsbuildinfo",
@@ -53,6 +53,79 @@ describe('@vertesia/ui accessibility (axe)', () => {
53
53
  expect(await axe(container)).toHaveNoViolations();
54
54
  });
55
55
 
56
+ it('Button.title is forwarded to aria-label so icon-only buttons are labelled', async () => {
57
+ const { container } = renderWithProviders(
58
+ <Button onClick={() => undefined} title="Refresh">
59
+ <span aria-hidden="true">↻</span>
60
+ </Button>,
61
+ );
62
+ const button = container.querySelector('button');
63
+ expect(button?.getAttribute('aria-label')).toBe('Refresh');
64
+ // The native title attribute is intentionally not forwarded — it would stack a second
65
+ // browser tooltip on top of the VTooltip that `title` already renders.
66
+ expect(button?.hasAttribute('title')).toBe(false);
67
+ expect(await axe(container)).toHaveNoViolations();
68
+ });
69
+
70
+ it('Button.title does NOT override the name of a button that shows text', async () => {
71
+ // WCAG 2.5.3 Label in Name: the accessible name must contain the visible label, so a
72
+ // tooltip must never replace it. Regression test for the Playwright failure where
73
+ // getByRole('button', { name: 'Installed' }) stopped matching.
74
+ const { container } = renderWithProviders(
75
+ <Button onClick={() => undefined} title="Show only installed apps">
76
+ Installed
77
+ </Button>,
78
+ );
79
+ const button = container.querySelector('button');
80
+ expect(button?.hasAttribute('aria-label')).toBe(false);
81
+ expect(button?.textContent).toBe('Installed');
82
+ expect(await axe(container)).toHaveNoViolations();
83
+ });
84
+
85
+ it('Button.title does not override a nested text label either', async () => {
86
+ const { container } = renderWithProviders(
87
+ <Button onClick={() => undefined} title="Open the definition editor">
88
+ <span aria-hidden="true">📄</span>
89
+ <span>Definition</span>
90
+ </Button>,
91
+ );
92
+ expect(container.querySelector('button')?.hasAttribute('aria-label')).toBe(false);
93
+ });
94
+
95
+ it('Button.alt keeps overriding the name of a text button (legacy behavior)', async () => {
96
+ // Unlike `title`, the deprecated `alt` overrides the accessible name even when text is
97
+ // present. Call sites such as <Button alt="Launch a new agent."><Rocket/> Run</Button>
98
+ // depend on this, so the WCAG 2.5.3 guard must NOT apply to `alt`.
99
+ const { container } = renderWithProviders(
100
+ <Button onClick={() => undefined} alt="Launch a new agent.">
101
+ Run
102
+ </Button>,
103
+ );
104
+ expect(container.querySelector('button')?.getAttribute('aria-label')).toBe('Launch a new agent.');
105
+ });
106
+
107
+ it('Button.tooltipPlacement does not leak onto the DOM element', async () => {
108
+ const { container } = renderWithProviders(
109
+ <Button onClick={() => undefined} title="Zoom in" tooltipPlacement="bottom">
110
+ <span aria-hidden="true">+</span>
111
+ </Button>,
112
+ );
113
+ const button = container.querySelector('button');
114
+ expect(button?.getAttribute('aria-label')).toBe('Zoom in');
115
+ expect(button?.hasAttribute('tooltipPlacement')).toBe(false);
116
+ expect(button?.hasAttribute('tooltipplacement')).toBe(false);
117
+ expect(await axe(container)).toHaveNoViolations();
118
+ });
119
+
120
+ it('an explicit aria-label wins over Button.title', async () => {
121
+ const { container } = renderWithProviders(
122
+ <Button onClick={() => undefined} title="Refresh" aria-label="Reload the results">
123
+ <span aria-hidden="true">↻</span>
124
+ </Button>,
125
+ );
126
+ expect(container.querySelector('button')?.getAttribute('aria-label')).toBe('Reload the results');
127
+ });
128
+
56
129
  it('CopyButton has an accessible name via internal aria-label', async () => {
57
130
  const { container } = renderWithProviders(<CopyButton content="example value" />);
58
131
  const button = container.querySelector('button');
@@ -247,7 +320,10 @@ describe('@vertesia/ui accessibility (axe)', () => {
247
320
  const { baseElement } = renderWithProviders(<Harness />);
248
321
  // Radix portals the dialog into document.body, not the render container.
249
322
  // noCloseButton avoids the Button.alt -> aria-label gap (deferred to Section 3).
250
- expect(await axe(baseElement)).toHaveNoViolations();
323
+ // Radix focus guards are intentionally focusable, visually hidden sentinels. Newer
324
+ // axe-core versions flag their tabindex + aria-hidden combination even though they
325
+ // are infrastructure outside the dialog's accessible content.
326
+ expect(await axe(baseElement, { exclude: ['[data-radix-focus-guard]'] })).toHaveNoViolations();
251
327
  });
252
328
 
253
329
  it('Table with column headers and sortable button has no violations', async () => {
@@ -1,6 +1,17 @@
1
- import type { AxeResults } from 'axe-core';
1
+ import axeCore, { type AxeResults, type RunOptions } from 'axe-core';
2
2
  import { axe as baseAxe } from 'vitest-axe';
3
3
 
4
+ const RUN_OPTIONS: RunOptions = {
5
+ rules: {
6
+ 'color-contrast': { enabled: false },
7
+ },
8
+ };
9
+
10
+ export interface AxeTestOptions {
11
+ /** Selectors to omit from this specific axe run while testing the rest of the container. */
12
+ exclude?: string[];
13
+ }
14
+
4
15
  /**
5
16
  * Project-wide axe runner.
6
17
  *
@@ -14,10 +25,9 @@ import { axe as baseAxe } from 'vitest-axe';
14
25
  * Lives in a `.ts` file (not `.tsx`) to keep its module init free of React/JSX
15
26
  * resolution concerns.
16
27
  */
17
- export function axe(container: Element | string): Promise<AxeResults> {
18
- return baseAxe(container, {
19
- rules: {
20
- 'color-contrast': { enabled: false },
21
- },
22
- });
28
+ export function axe(container: Element | string, options: AxeTestOptions = {}): Promise<AxeResults> {
29
+ if (options.exclude?.length && typeof container !== 'string') {
30
+ return axeCore.run({ include: [container], exclude: options.exclude }, RUN_OPTIONS);
31
+ }
32
+ return baseAxe(container, RUN_OPTIONS);
23
33
  }
@@ -72,3 +72,28 @@ if (typeof globalThis.ResizeObserver === 'undefined') {
72
72
  (globalThis as unknown as { ResizeObserver: typeof ResizeObserverPolyfill }).ResizeObserver =
73
73
  ResizeObserverPolyfill;
74
74
  }
75
+
76
+ // Chart and Mermaid modules probe canvas support during import. jsdom's default
77
+ // implementation only logs a noisy "not implemented" error, so return the same
78
+ // unsupported value without polluting otherwise successful UI test output.
79
+ if (typeof HTMLCanvasElement !== 'undefined') {
80
+ Object.defineProperty(HTMLCanvasElement.prototype, 'getContext', {
81
+ configurable: true,
82
+ value: () => null,
83
+ });
84
+ }
85
+
86
+ // ProseMirror asks the browser for caret geometry during pointer/keyboard input.
87
+ // jsdom has no layout engine, so provide stable empty geometry for interaction tests.
88
+ if (typeof document !== 'undefined' && typeof document.elementFromPoint !== 'function') {
89
+ document.elementFromPoint = () => document.querySelector('.ProseMirror') ?? document.body;
90
+ }
91
+ if (typeof Range !== 'undefined') {
92
+ const emptyRect = () => new DOMRect(0, 0, 0, 0);
93
+ if (typeof Range.prototype.getBoundingClientRect !== 'function') {
94
+ Range.prototype.getBoundingClientRect = emptyRect;
95
+ }
96
+ if (typeof Range.prototype.getClientRects !== 'function') {
97
+ Range.prototype.getClientRects = () => [] as unknown as DOMRectList;
98
+ }
99
+ }
@@ -149,7 +149,7 @@ export function SidePanel({
149
149
 
150
150
  function CloseButton({ onClose }: { onClose: () => void }) {
151
151
  return (
152
- <Button alt="Close panel" variant="ghost" onClick={onClose}>
152
+ <Button title="Close panel" variant="ghost" onClick={onClose}>
153
153
  <X className="size-6" aria-hidden="true" />
154
154
  </Button>
155
155
  );
@@ -23,6 +23,22 @@ function useDeprecationWarning(propName: string, isUsed: boolean, message: strin
23
23
  }, [isUsed, message, propName]);
24
24
  }
25
25
 
26
+ // Does this subtree contribute any text to the accessible name? Used to decide whether `title`
27
+ // may supply that name. Icons (lucide elements) have no string children and return false, and
28
+ // `aria-hidden` subtrees are skipped because they are excluded from the name computation.
29
+ function hasVisibleText(node: React.ReactNode): boolean {
30
+ return React.Children.toArray(node).some((child) => {
31
+ if (typeof child === 'string') return child.trim().length > 0;
32
+ if (typeof child === 'number') return true;
33
+ if (React.isValidElement(child)) {
34
+ const props = child.props as { children?: React.ReactNode; 'aria-hidden'?: boolean | string };
35
+ if (props['aria-hidden'] === true || props['aria-hidden'] === 'true') return false;
36
+ return hasVisibleText(props.children);
37
+ }
38
+ return false;
39
+ });
40
+ }
41
+
26
42
  const buttonVariants = cva(
27
43
  'hover:cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
28
44
  {
@@ -60,35 +76,66 @@ export interface ButtonProps
60
76
  VariantProps<typeof buttonVariants> {
61
77
  asChild?: boolean;
62
78
  /**
63
- * @deprecated Use `aria-label` for the accessible name and wrap in `<VTooltip>` for a visual tooltip.
64
- * For backward compatibility, `alt` is forwarded to `aria-label` (when not set) AND still
65
- * triggers the legacy VTooltip wrap. Slated for removal in the next major.
79
+ * @deprecated Use `title` instead. `alt` drives the same tooltip but, unlike `title`, it
80
+ * overrides the accessible name even when the button shows a text label — which usually
81
+ * violates WCAG 2.5.3 (Label in Name). That legacy behavior is preserved so existing call
82
+ * sites keep announcing what they always did. Slated for removal in the next major.
66
83
  */
67
84
  alt?: string;
85
+ /**
86
+ * Tooltip text. Renders a `<VTooltip>` around the button and doubles as the accessible name,
87
+ * so icon-only buttons need nothing else. Pass `aria-label` to override the name independently.
88
+ */
68
89
  title?: string;
90
+ /** Which side the `title` tooltip opens on. Defaults to `top`. */
91
+ tooltipPlacement?: 'top' | 'right' | 'bottom' | 'left';
69
92
  isDisabled?: boolean;
70
93
  isLoading?: boolean;
71
94
  }
72
95
 
73
96
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
74
97
  (
75
- { className, variant, size, asChild = false, alt, isDisabled, isLoading, title, onClick, type, ...props },
98
+ {
99
+ className,
100
+ variant,
101
+ size,
102
+ asChild = false,
103
+ alt,
104
+ isDisabled,
105
+ isLoading,
106
+ title,
107
+ tooltipPlacement = 'top',
108
+ onClick,
109
+ type,
110
+ ...props
111
+ },
76
112
  ref,
77
113
  ) => {
78
114
  useDeprecationWarning(
79
115
  'Button.alt',
80
116
  alt !== undefined,
81
- 'use aria-label for the accessible name and wrap in <VTooltip> for a visual tooltip. ' +
82
- '`alt` is forwarded to both for one release.',
117
+ 'use `title` instead it drives the same tooltip and the accessible name. ' +
118
+ '`alt` remains an alias for one release.',
83
119
  );
84
120
 
85
121
  const Comp = asChild ? Slot : 'button';
86
122
  // Default type="button" only when rendering an actual <button>. With asChild,
87
123
  // the rendered element may be an <a> or other tag where injecting `type` is wrong.
88
124
  const resolvedType = asChild ? type : (type ?? 'button');
89
- // Back-fill aria-label from alt during the deprecation window so existing call
90
- // sites keep their accessible name without code changes.
91
- const ariaLabel = props['aria-label'] ?? alt;
125
+ // `title` (or its deprecated alias `alt`) drives the VTooltip below. `title` also back-fills
126
+ // the accessible name, so an icon-only <Button title="Refresh"> is labelled without any
127
+ // extra props or a manual <VTooltip> wrap at the call site.
128
+ //
129
+ // That back-fill is skipped when the button already shows text: turning
130
+ // <Button title="Show only installed apps">Installed</Button> into aria-label="Show only
131
+ // installed apps" would replace the visible name with the tooltip, which breaks WCAG 2.5.3
132
+ // (Label in Name) and makes the control unreachable by the label users actually see.
133
+ //
134
+ // `alt` deliberately does NOT get that treatment: it has always overridden the name
135
+ // unconditionally, and callers rely on that. Preserving it keeps every existing call site
136
+ // announcing exactly what it announced before, and confines the new rule to `title`.
137
+ const tooltip = title ?? alt;
138
+ const ariaLabel = props['aria-label'] ?? alt ?? (hasVisibleText(props.children) ? undefined : title);
92
139
 
93
140
  // asChild renders via Radix Slot, which requires exactly one React child.
94
141
  // Skip the loader wrap in that case — Slot would reject the multi-child array.
@@ -116,9 +163,18 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
116
163
  </Comp>
117
164
  );
118
165
 
119
- if (alt || title) {
166
+ // Note: the native `title` attribute is deliberately NOT forwarded to the DOM — it would
167
+ // stack a second, delayed browser tooltip on top of the VTooltip. `aria-label` above is
168
+ // what exposes the text to screen readers and to getByRole('button', { name }).
169
+ if (tooltip) {
120
170
  return (
121
- <VTooltip description={alt || title} asChild className="cursor-pointer" size="xs" placement="top">
171
+ <VTooltip
172
+ description={tooltip}
173
+ asChild
174
+ className="cursor-pointer"
175
+ size="xs"
176
+ placement={tooltipPlacement}
177
+ >
122
178
  {buttonElement}
123
179
  </VTooltip>
124
180
  );
@@ -190,7 +246,6 @@ const CopyButton = React.forwardRef<HTMLButtonElement, CopyButtonProps>(
190
246
  size={size || 'sm'}
191
247
  onClick={handleCopy}
192
248
  {...props}
193
- aria-label={label}
194
249
  title={label}
195
250
  >
196
251
  {isCopied ? <Check className="text-success" /> : <CopyIcon className="size-4" />}
@@ -318,6 +318,7 @@ const FilterBtn = ({ className }: { className?: string }) => {
318
318
  variant="outline"
319
319
  role="combobox"
320
320
  aria-expanded={open}
321
+ aria-label={t('filter.filter')}
321
322
  size="md"
322
323
  className={cn('transition group flex gap-1.5', className)}
323
324
  >