@vertesia/ui 1.5.0-dev.20260807.073259Z → 1.5.0-dev.20260901.005903Z

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 (502) hide show
  1. package/README.md +1 -7
  2. package/lib/core/components/FormItem.d.ts.map +1 -1
  3. package/lib/core/components/FormItem.js +2 -3
  4. package/lib/core/components/FormItem.js.map +1 -1
  5. package/lib/core/components/InfoTip.d.ts +20 -0
  6. package/lib/core/components/InfoTip.d.ts.map +1 -0
  7. package/lib/core/components/InfoTip.js +18 -0
  8. package/lib/core/components/InfoTip.js.map +1 -0
  9. package/lib/core/components/index.d.ts +1 -0
  10. package/lib/core/components/index.d.ts.map +1 -1
  11. package/lib/core/components/index.js +1 -0
  12. package/lib/core/components/index.js.map +1 -1
  13. package/lib/core/components/shadcn/Panel.d.ts.map +1 -1
  14. package/lib/core/components/shadcn/Panel.js +3 -3
  15. package/lib/core/components/shadcn/Panel.js.map +1 -1
  16. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js +1 -1
  17. package/lib/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -1
  18. package/lib/core/components/shadcn/filters/filter/dateFilter.d.ts.map +1 -1
  19. package/lib/core/components/shadcn/filters/filter/dateFilter.js +1 -1
  20. package/lib/core/components/shadcn/filters/filter/dateFilter.js.map +1 -1
  21. package/lib/core/components/shadcn/filters/filters.d.ts.map +1 -1
  22. package/lib/core/components/shadcn/filters/filters.js +1 -1
  23. package/lib/core/components/shadcn/filters/filters.js.map +1 -1
  24. package/lib/core/components/shadcn/index.d.ts +1 -0
  25. package/lib/core/components/shadcn/index.d.ts.map +1 -1
  26. package/lib/core/components/shadcn/index.js +1 -0
  27. package/lib/core/components/shadcn/index.js.map +1 -1
  28. package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
  29. package/lib/core/components/shadcn/modal/dialog.js +1 -3
  30. package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
  31. package/lib/core/components/shadcn/overflowTabs.d.ts +59 -0
  32. package/lib/core/components/shadcn/overflowTabs.d.ts.map +1 -0
  33. package/lib/core/components/shadcn/overflowTabs.js +173 -0
  34. package/lib/core/components/shadcn/overflowTabs.js.map +1 -0
  35. package/lib/core/components/shadcn/selectBox.js +2 -2
  36. package/lib/core/components/shadcn/selectBox.js.map +1 -1
  37. package/lib/core/components/shadcn/theme/ThemeProvider.d.ts +3 -1
  38. package/lib/core/components/shadcn/theme/ThemeProvider.d.ts.map +1 -1
  39. package/lib/core/components/shadcn/theme/ThemeProvider.js +8 -9
  40. package/lib/core/components/shadcn/theme/ThemeProvider.js.map +1 -1
  41. package/lib/core/utils/dayjs.d.ts +12 -0
  42. package/lib/core/utils/dayjs.d.ts.map +1 -0
  43. package/lib/core/utils/dayjs.js +16 -0
  44. package/lib/core/utils/dayjs.js.map +1 -0
  45. package/lib/env/index.d.ts +17 -0
  46. package/lib/env/index.d.ts.map +1 -1
  47. package/lib/env/index.js +18 -1
  48. package/lib/env/index.js.map +1 -1
  49. package/lib/features/agent/PayloadBuilder.d.ts +1 -0
  50. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  51. package/lib/features/agent/PayloadBuilder.js +22 -5
  52. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  53. package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
  54. package/lib/features/agent/chat/AgentRightPanel.js +3 -135
  55. package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
  56. package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
  57. package/lib/features/agent/chat/ArtifactsTab.js +1 -1
  58. package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
  59. package/lib/features/agent/chat/AskUserWidget.d.ts.map +1 -1
  60. package/lib/features/agent/chat/AskUserWidget.js +19 -4
  61. package/lib/features/agent/chat/AskUserWidget.js.map +1 -1
  62. package/lib/features/agent/chat/ModernAgentConversation.d.ts +6 -0
  63. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  64. package/lib/features/agent/chat/ModernAgentConversation.js +99 -29
  65. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  66. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.d.ts.map +1 -1
  67. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js +10 -9
  68. package/lib/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.js.map +1 -1
  69. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  70. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +5 -8
  71. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  72. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
  73. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +45 -4
  74. package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
  75. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js +1 -1
  76. package/lib/features/agent/chat/ModernAgentOutput/BatchProgressPanel.js.map +1 -1
  77. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  78. package/lib/features/agent/chat/ModernAgentOutput/Header.js +3 -3
  79. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  80. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  81. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +1 -1
  82. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  83. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.d.ts.map +1 -1
  84. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js +1 -1
  85. package/lib/features/agent/chat/ModernAgentOutput/StreamingMessage.js.map +1 -1
  86. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +1 -1
  87. package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
  88. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts.map +1 -1
  89. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +9 -121
  90. package/lib/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
  91. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +6 -0
  92. package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
  93. package/lib/features/agent/chat/ModernAgentOutput/utils.js +19 -11
  94. package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  95. package/lib/features/agent/chat/VegaLiteChart.d.ts.map +1 -1
  96. package/lib/features/agent/chat/VegaLiteChart.js +11 -3
  97. package/lib/features/agent/chat/VegaLiteChart.js.map +1 -1
  98. package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
  99. package/lib/features/agent/chat/hooks/useAgentStream.js +3 -0
  100. package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
  101. package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +1 -1
  102. package/lib/features/document-viewer/UniversalDocumentViewer.js +1 -1
  103. package/lib/features/document-viewer/UniversalDocumentViewer.js.map +1 -1
  104. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +14 -2
  105. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  106. package/lib/features/facets/AgentRunnerFacetsNav.js +20 -2
  107. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  108. package/lib/features/facets/CollectionsFacetsNav.d.ts +3 -3
  109. package/lib/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
  110. package/lib/features/facets/CollectionsFacetsNav.js +6 -1
  111. package/lib/features/facets/CollectionsFacetsNav.js.map +1 -1
  112. package/lib/features/facets/DocumentsFacetsNav.d.ts +3 -3
  113. package/lib/features/facets/DocumentsFacetsNav.d.ts.map +1 -1
  114. package/lib/features/facets/DocumentsFacetsNav.js +20 -8
  115. package/lib/features/facets/DocumentsFacetsNav.js.map +1 -1
  116. package/lib/features/facets/InteractionsFacetsNav.d.ts +3 -3
  117. package/lib/features/facets/InteractionsFacetsNav.d.ts.map +1 -1
  118. package/lib/features/facets/InteractionsFacetsNav.js +11 -1
  119. package/lib/features/facets/InteractionsFacetsNav.js.map +1 -1
  120. package/lib/features/facets/PromptsFacetsNav.d.ts +3 -3
  121. package/lib/features/facets/PromptsFacetsNav.d.ts.map +1 -1
  122. package/lib/features/facets/PromptsFacetsNav.js +6 -1
  123. package/lib/features/facets/PromptsFacetsNav.js.map +1 -1
  124. package/lib/features/facets/RunsFacetsNav.d.ts +4 -14
  125. package/lib/features/facets/RunsFacetsNav.d.ts.map +1 -1
  126. package/lib/features/facets/RunsFacetsNav.js +26 -15
  127. package/lib/features/facets/RunsFacetsNav.js.map +1 -1
  128. package/lib/features/facets/WorkflowExecutionsFacetsNav.d.ts +4 -3
  129. package/lib/features/facets/WorkflowExecutionsFacetsNav.d.ts.map +1 -1
  130. package/lib/features/facets/WorkflowExecutionsFacetsNav.js +18 -10
  131. package/lib/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -1
  132. package/lib/features/facets/index.d.ts +1 -1
  133. package/lib/features/facets/index.d.ts.map +1 -1
  134. package/lib/features/facets/index.js.map +1 -1
  135. package/lib/features/facets/utils/SearchInterface.d.ts +4 -3
  136. package/lib/features/facets/utils/SearchInterface.d.ts.map +1 -1
  137. package/lib/features/facets/utils/SearchInterface.js +4 -0
  138. package/lib/features/facets/utils/SearchInterface.js.map +1 -1
  139. package/lib/features/layout/GenericPageNavHeader.d.ts +8 -1
  140. package/lib/features/layout/GenericPageNavHeader.d.ts.map +1 -1
  141. package/lib/features/layout/GenericPageNavHeader.js +9 -1
  142. package/lib/features/layout/GenericPageNavHeader.js.map +1 -1
  143. package/lib/features/magic-pdf/DownloadPopover.d.ts +3 -2
  144. package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
  145. package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
  146. package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -1
  147. package/lib/features/magic-pdf/GroundedExtractionView.js +51 -64
  148. package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
  149. package/lib/features/oauth/McpConnectionsButton.d.ts +1 -1
  150. package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
  151. package/lib/features/oauth/McpConnectionsButton.js +2 -2
  152. package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
  153. package/lib/features/oauth/McpConnectionsDialog.d.ts +1 -1
  154. package/lib/features/oauth/McpConnectionsDialog.js +2 -2
  155. package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
  156. package/lib/features/oauth/useMcpConnections.d.ts +4 -5
  157. package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
  158. package/lib/features/oauth/useMcpConnections.js +20 -4
  159. package/lib/features/oauth/useMcpConnections.js.map +1 -1
  160. package/lib/features/pdf-viewer/PdfPageRenderer.d.ts.map +1 -1
  161. package/lib/features/pdf-viewer/PdfPageRenderer.js +9 -11
  162. package/lib/features/pdf-viewer/PdfPageRenderer.js.map +1 -1
  163. package/lib/features/pdf-viewer/lazyReactPdf.d.ts +10 -0
  164. package/lib/features/pdf-viewer/lazyReactPdf.d.ts.map +1 -0
  165. package/lib/features/pdf-viewer/lazyReactPdf.js +25 -0
  166. package/lib/features/pdf-viewer/lazyReactPdf.js.map +1 -0
  167. package/lib/features/store/collections/CollectionsTable.d.ts.map +1 -1
  168. package/lib/features/store/collections/CollectionsTable.js +1 -3
  169. package/lib/features/store/collections/CollectionsTable.js.map +1 -1
  170. package/lib/features/store/collections/EditCollectionView.js +1 -1
  171. package/lib/features/store/collections/EditCollectionView.js.map +1 -1
  172. package/lib/features/store/objects/ExportPropertiesModal.d.ts +3 -1
  173. package/lib/features/store/objects/ExportPropertiesModal.d.ts.map +1 -1
  174. package/lib/features/store/objects/ExportPropertiesModal.js +5 -5
  175. package/lib/features/store/objects/ExportPropertiesModal.js.map +1 -1
  176. package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
  177. package/lib/features/store/objects/components/ContentOverview.js +4 -10
  178. package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
  179. package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
  180. package/lib/features/store/objects/components/TextEditorPanel.js +8 -3
  181. package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
  182. package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
  183. package/lib/features/store/objects/layout/renderers.js +1 -5
  184. package/lib/features/store/objects/layout/renderers.js.map +1 -1
  185. package/lib/features/store/objects/search/DocumentSearchContext.d.ts +44 -62
  186. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  187. package/lib/features/store/objects/search/DocumentSearchContext.js +47 -2
  188. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  189. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
  190. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js +5 -0
  191. package/lib/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
  192. package/lib/features/store/objects/upload/DocumentUploadModal.d.ts +6 -1
  193. package/lib/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
  194. package/lib/features/store/objects/upload/DocumentUploadModal.js +4 -3
  195. package/lib/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  196. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.d.ts.map +1 -1
  197. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.js +2 -2
  198. package/lib/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -1
  199. package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
  200. package/lib/features/store/types/ContentObjectTypesTable.js +1 -3
  201. package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
  202. package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
  203. package/lib/features/store/types/IntakePolicyEditor.js +12 -2
  204. package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
  205. package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -1
  206. package/lib/features/store/types/IntakePolicyForm.js +15 -15
  207. package/lib/features/store/types/IntakePolicyForm.js.map +1 -1
  208. package/lib/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
  209. package/lib/features/store/types/ObjectSchemaEditor.js +6 -2
  210. package/lib/features/store/types/ObjectSchemaEditor.js.map +1 -1
  211. package/lib/features/store/types/TableLayoutEditor.d.ts.map +1 -1
  212. package/lib/features/store/types/TableLayoutEditor.js +2 -0
  213. package/lib/features/store/types/TableLayoutEditor.js.map +1 -1
  214. package/lib/features/store/types/TypeRegistry.d.ts +282 -0
  215. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  216. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +281 -0
  217. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  218. package/lib/features/user/UserInfo.d.ts.map +1 -1
  219. package/lib/features/user/UserInfo.js +2 -4
  220. package/lib/features/user/UserInfo.js.map +1 -1
  221. package/lib/features/views/ViewActions.d.ts +32 -0
  222. package/lib/features/views/ViewActions.d.ts.map +1 -0
  223. package/lib/features/views/ViewActions.js +186 -0
  224. package/lib/features/views/ViewActions.js.map +1 -0
  225. package/lib/features/views/ViewDropTarget.d.ts +15 -0
  226. package/lib/features/views/ViewDropTarget.d.ts.map +1 -0
  227. package/lib/features/views/ViewDropTarget.js +79 -0
  228. package/lib/features/views/ViewDropTarget.js.map +1 -0
  229. package/lib/features/views/ViewExperience.d.ts +3 -2
  230. package/lib/features/views/ViewExperience.d.ts.map +1 -1
  231. package/lib/features/views/ViewExperience.js +103 -12
  232. package/lib/features/views/ViewExperience.js.map +1 -1
  233. package/lib/features/views/ViewNavigation.d.ts +1 -1
  234. package/lib/features/views/ViewNavigation.d.ts.map +1 -1
  235. package/lib/features/views/ViewNavigation.js +14 -5
  236. package/lib/features/views/ViewNavigation.js.map +1 -1
  237. package/lib/features/views/ViewResults.d.ts +1 -1
  238. package/lib/features/views/ViewResults.d.ts.map +1 -1
  239. package/lib/features/views/ViewResults.js +124 -34
  240. package/lib/features/views/ViewResults.js.map +1 -1
  241. package/lib/features/views/index.d.ts +1 -0
  242. package/lib/features/views/index.d.ts.map +1 -1
  243. package/lib/features/views/index.js +1 -0
  244. package/lib/features/views/index.js.map +1 -1
  245. package/lib/features/views/types.d.ts +46 -1
  246. package/lib/features/views/types.d.ts.map +1 -1
  247. package/lib/features/views/viewState.d.ts.map +1 -1
  248. package/lib/features/views/viewState.js +34 -0
  249. package/lib/features/views/viewState.js.map +1 -1
  250. package/lib/i18n/LanguageProvider.d.ts +3 -1
  251. package/lib/i18n/LanguageProvider.d.ts.map +1 -1
  252. package/lib/i18n/LanguageProvider.js +9 -7
  253. package/lib/i18n/LanguageProvider.js.map +1 -1
  254. package/lib/i18n/instance.d.ts +2 -0
  255. package/lib/i18n/instance.d.ts.map +1 -1
  256. package/lib/i18n/instance.js +45 -26
  257. package/lib/i18n/instance.js.map +1 -1
  258. package/lib/i18n/locales/ar.json +296 -15
  259. package/lib/i18n/locales/de.json +294 -13
  260. package/lib/i18n/locales/en.json +65 -4
  261. package/lib/i18n/locales/es.json +295 -14
  262. package/lib/i18n/locales/fr.json +294 -13
  263. package/lib/i18n/locales/it.json +294 -13
  264. package/lib/i18n/locales/ja.json +292 -10
  265. package/lib/i18n/locales/ko.json +292 -10
  266. package/lib/i18n/locales/pt.json +294 -13
  267. package/lib/i18n/locales/ru.json +291 -10
  268. package/lib/i18n/locales/tr.json +291 -10
  269. package/lib/i18n/locales/zh-TW.json +292 -10
  270. package/lib/i18n/locales/zh.json +292 -10
  271. package/lib/router/RouteComponent.d.ts +8 -0
  272. package/lib/router/RouteComponent.d.ts.map +1 -1
  273. package/lib/router/RouteComponent.js +41 -9
  274. package/lib/router/RouteComponent.js.map +1 -1
  275. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  276. package/lib/session/UserSessionProvider.js +20 -29
  277. package/lib/session/UserSessionProvider.js.map +1 -1
  278. package/lib/session/auth/composable.d.ts.map +1 -1
  279. package/lib/session/auth/composable.js +25 -19
  280. package/lib/session/auth/composable.js.map +1 -1
  281. package/lib/session/auth/domainRouting.d.ts +11 -0
  282. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  283. package/lib/session/auth/domainRouting.js +13 -0
  284. package/lib/session/auth/domainRouting.js.map +1 -1
  285. package/lib/session/auth/firebase.js +1 -1
  286. package/lib/session/auth/firebase.js.map +1 -1
  287. package/lib/session/useUXTracking.d.ts.map +1 -1
  288. package/lib/session/useUXTracking.js +6 -1
  289. package/lib/session/useUXTracking.js.map +1 -1
  290. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  291. package/lib/shell/VertesiaShell.js +2 -1
  292. package/lib/shell/VertesiaShell.js.map +1 -1
  293. package/lib/shell/apps/AppInstallationProvider.d.ts +4 -2
  294. package/lib/shell/apps/AppInstallationProvider.d.ts.map +1 -1
  295. package/lib/shell/apps/IframeAppContextSync.d.ts +3 -0
  296. package/lib/shell/apps/IframeAppContextSync.d.ts.map +1 -0
  297. package/lib/shell/apps/IframeAppContextSync.js +95 -0
  298. package/lib/shell/apps/IframeAppContextSync.js.map +1 -0
  299. package/lib/shell/apps/iframe-auth.d.ts +55 -0
  300. package/lib/shell/apps/iframe-auth.d.ts.map +1 -0
  301. package/lib/shell/apps/iframe-auth.js +154 -0
  302. package/lib/shell/apps/iframe-auth.js.map +1 -0
  303. package/lib/shell/apps/index.d.ts +2 -0
  304. package/lib/shell/apps/index.d.ts.map +1 -1
  305. package/lib/shell/apps/index.js +2 -0
  306. package/lib/shell/apps/index.js.map +1 -1
  307. package/lib/vertesia-ui-core.js +199 -4
  308. package/lib/vertesia-ui-core.js.map +1 -1
  309. package/lib/vertesia-ui-env.js +1 -1
  310. package/lib/vertesia-ui-env.js.map +1 -1
  311. package/lib/vertesia-ui-features.js +975 -35
  312. package/lib/vertesia-ui-features.js.map +1 -1
  313. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js +5 -0
  314. package/lib/vertesia-ui-i18n.BJBGsq-8.chunk.js.map +1 -0
  315. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js +5 -0
  316. package/lib/vertesia-ui-i18n.BY5YG5cX.chunk.js.map +1 -0
  317. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js +5 -0
  318. package/lib/vertesia-ui-i18n.Bd5_1BXO.chunk.js.map +1 -0
  319. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js +5 -0
  320. package/lib/vertesia-ui-i18n.Bvwej2HH.chunk.js.map +1 -0
  321. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js +5 -0
  322. package/lib/vertesia-ui-i18n.CMT3f4gf.chunk.js.map +1 -0
  323. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js +5 -0
  324. package/lib/vertesia-ui-i18n.D56DNPJW.chunk.js.map +1 -0
  325. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js +5 -0
  326. package/lib/vertesia-ui-i18n.DDzKLNx6.chunk.js.map +1 -0
  327. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js +5 -0
  328. package/lib/vertesia-ui-i18n.D_Am1LpF.chunk.js.map +1 -0
  329. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js +5 -0
  330. package/lib/vertesia-ui-i18n.DrZizgGV.chunk.js.map +1 -0
  331. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js +5 -0
  332. package/lib/vertesia-ui-i18n.DwHsq86z.chunk.js.map +1 -0
  333. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js +5 -0
  334. package/lib/vertesia-ui-i18n.PLpo0Bbz.chunk.js.map +1 -0
  335. package/lib/vertesia-ui-i18n.js +2 -38
  336. package/lib/vertesia-ui-i18n.js.map +1 -1
  337. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js +5 -0
  338. package/lib/vertesia-ui-i18n.xVbXALqz.chunk.js.map +1 -0
  339. package/lib/vertesia-ui-layout.js +80 -1
  340. package/lib/vertesia-ui-layout.js.map +1 -1
  341. package/lib/vertesia-ui-rich-text.js +278 -4
  342. package/lib/vertesia-ui-rich-text.js.map +1 -1
  343. package/lib/vertesia-ui-router.js +1 -1
  344. package/lib/vertesia-ui-router.js.map +1 -1
  345. package/lib/vertesia-ui-session.js +1 -1
  346. package/lib/vertesia-ui-session.js.map +1 -1
  347. package/lib/vertesia-ui-shell.js +118 -1
  348. package/lib/vertesia-ui-shell.js.map +1 -1
  349. package/lib/vertesia-ui-widgets.js +336 -20
  350. package/lib/vertesia-ui-widgets.js.map +1 -1
  351. package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
  352. package/lib/widgets/markdown/MarkdownRenderer.js +43 -2
  353. package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
  354. package/lib/widgets/markdown/MermaidDiagram.d.ts.map +1 -1
  355. package/lib/widgets/markdown/MermaidDiagram.js +35 -22
  356. package/lib/widgets/markdown/MermaidDiagram.js.map +1 -1
  357. package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
  358. package/lib/widgets/monacoEditor/MonacoEditor.js +14 -10
  359. package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
  360. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  361. package/package.json +24 -29
  362. package/src/core/components/FormItem.tsx +2 -5
  363. package/src/core/components/InfoTip.test.tsx +33 -0
  364. package/src/core/components/InfoTip.tsx +32 -0
  365. package/src/core/components/index.ts +1 -0
  366. package/src/core/components/shadcn/Panel.tsx +3 -7
  367. package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +1 -1
  368. package/src/core/components/shadcn/filters/filter/dateFilter.tsx +1 -1
  369. package/src/core/components/shadcn/filters/filters.tsx +1 -1
  370. package/src/core/components/shadcn/index.ts +1 -0
  371. package/src/core/components/shadcn/modal/dialog.test.tsx +35 -0
  372. package/src/core/components/shadcn/modal/dialog.tsx +0 -4
  373. package/src/core/components/shadcn/overflowTabs.tsx +320 -0
  374. package/src/core/components/shadcn/selectBox.tsx +2 -2
  375. package/src/core/components/shadcn/theme/ThemeProvider.tsx +10 -9
  376. package/src/core/utils/dayjs.ts +17 -0
  377. package/src/css/base.css +78 -0
  378. package/src/env/index.test.ts +94 -0
  379. package/src/env/index.ts +36 -1
  380. package/src/features/agent/PayloadBuilder.test.ts +68 -0
  381. package/src/features/agent/PayloadBuilder.tsx +28 -4
  382. package/src/features/agent/chat/AgentRightPanel.tsx +2 -252
  383. package/src/features/agent/chat/ArtifactsTab.tsx +1 -0
  384. package/src/features/agent/chat/AskUserWidget.test.tsx +20 -1
  385. package/src/features/agent/chat/AskUserWidget.tsx +22 -6
  386. package/src/features/agent/chat/ModernAgentConversation.test.tsx +160 -0
  387. package/src/features/agent/chat/ModernAgentConversation.tsx +111 -31
  388. package/src/features/agent/chat/ModernAgentOutput/ActiveWorkstreamsSummary.tsx +86 -67
  389. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +90 -7
  390. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +4 -6
  391. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.test.ts +103 -1
  392. package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +50 -4
  393. package/src/features/agent/chat/ModernAgentOutput/BatchProgressPanel.tsx +1 -1
  394. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +18 -1
  395. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +1 -1
  396. package/src/features/agent/chat/ModernAgentOutput/StreamingMessage.tsx +1 -1
  397. package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +1 -1
  398. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +37 -167
  399. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +94 -0
  400. package/src/features/agent/chat/ModernAgentOutput/utils.ts +19 -10
  401. package/src/features/agent/chat/VegaLiteChart.tsx +32 -14
  402. package/src/features/agent/chat/hooks/useAgentStream.test.tsx +18 -0
  403. package/src/features/agent/chat/hooks/useAgentStream.ts +3 -0
  404. package/src/features/document-viewer/UniversalDocumentViewer.tsx +1 -1
  405. package/src/features/facets/AgentRunnerFacetsNav.tsx +44 -4
  406. package/src/features/facets/CollectionsFacetsNav.tsx +15 -4
  407. package/src/features/facets/DocumentsFacetsNav.tsx +25 -8
  408. package/src/features/facets/FacetQueryHandlers.test.ts +84 -0
  409. package/src/features/facets/InteractionsFacetsNav.tsx +20 -4
  410. package/src/features/facets/PromptsFacetsNav.tsx +15 -4
  411. package/src/features/facets/RunsFacetsNav.test.ts +59 -0
  412. package/src/features/facets/RunsFacetsNav.tsx +40 -30
  413. package/src/features/facets/WorkflowExecutionsFacetsNav.test.ts +57 -0
  414. package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +36 -16
  415. package/src/features/facets/index.ts +1 -0
  416. package/src/features/facets/utils/SearchInterface.tsx +12 -3
  417. package/src/features/layout/GenericPageNavHeader.tsx +16 -0
  418. package/src/features/magic-pdf/DownloadPopover.tsx +1 -2
  419. package/src/features/magic-pdf/GroundedExtractionView.test.tsx +7 -1
  420. package/src/features/magic-pdf/GroundedExtractionView.tsx +162 -242
  421. package/src/features/oauth/McpConnectionsButton.test.tsx +18 -1
  422. package/src/features/oauth/McpConnectionsButton.tsx +6 -2
  423. package/src/features/oauth/McpConnectionsDialog.tsx +3 -3
  424. package/src/features/oauth/useMcpConnections.test.ts +1 -0
  425. package/src/features/oauth/useMcpConnections.ts +24 -7
  426. package/src/features/pdf-viewer/PdfPageRenderer.tsx +76 -71
  427. package/src/features/pdf-viewer/lazyReactPdf.ts +33 -0
  428. package/src/features/store/collections/CollectionsTable.tsx +1 -4
  429. package/src/features/store/collections/EditCollectionView.tsx +1 -1
  430. package/src/features/store/objects/ExportPropertiesModal.tsx +25 -16
  431. package/src/features/store/objects/components/ContentOverview.tsx +2 -28
  432. package/src/features/store/objects/components/TextEditorPanel.tsx +13 -3
  433. package/src/features/store/objects/layout/renderers.tsx +1 -6
  434. package/src/features/store/objects/search/DocumentSearchContext.test.ts +45 -0
  435. package/src/features/store/objects/search/DocumentSearchContext.ts +54 -4
  436. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +5 -0
  437. package/src/features/store/objects/upload/DocumentUploadModal.tsx +10 -3
  438. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +15 -6
  439. package/src/features/store/types/ContentObjectTypesTable.tsx +1 -4
  440. package/src/features/store/types/IntakePolicyEditor.tsx +14 -5
  441. package/src/features/store/types/IntakePolicyForm.tsx +120 -20
  442. package/src/features/store/types/ObjectSchemaEditor.tsx +6 -2
  443. package/src/features/store/types/TableLayoutEditor.tsx +2 -0
  444. package/src/features/user/UserInfo.test.tsx +10 -0
  445. package/src/features/user/UserInfo.tsx +2 -7
  446. package/src/features/views/ViewActions.test.tsx +80 -0
  447. package/src/features/views/ViewActions.tsx +352 -0
  448. package/src/features/views/ViewDropTarget.test.tsx +150 -0
  449. package/src/features/views/ViewDropTarget.tsx +140 -0
  450. package/src/features/views/ViewExperience.test.tsx +72 -0
  451. package/src/features/views/ViewExperience.tsx +189 -22
  452. package/src/features/views/ViewMedia.test.tsx +180 -0
  453. package/src/features/views/ViewNavigation.test.tsx +42 -0
  454. package/src/features/views/ViewNavigation.tsx +43 -5
  455. package/src/features/views/ViewResults.tsx +243 -26
  456. package/src/features/views/index.ts +1 -0
  457. package/src/features/views/types.ts +50 -0
  458. package/src/features/views/viewState.test.ts +7 -1
  459. package/src/features/views/viewState.ts +32 -0
  460. package/src/i18n/LanguageProvider.tsx +15 -8
  461. package/src/i18n/instance.test.ts +30 -0
  462. package/src/i18n/instance.ts +67 -40
  463. package/src/i18n/locales/ar.json +1192 -911
  464. package/src/i18n/locales/de.json +1148 -867
  465. package/src/i18n/locales/en.json +65 -4
  466. package/src/i18n/locales/es.json +1159 -878
  467. package/src/i18n/locales/fr.json +1159 -878
  468. package/src/i18n/locales/it.json +1159 -878
  469. package/src/i18n/locales/ja.json +1148 -866
  470. package/src/i18n/locales/ko.json +1148 -866
  471. package/src/i18n/locales/pt.json +1159 -878
  472. package/src/i18n/locales/ru.json +1170 -889
  473. package/src/i18n/locales/tr.json +1148 -867
  474. package/src/i18n/locales/zh-TW.json +1148 -866
  475. package/src/i18n/locales/zh.json +1148 -866
  476. package/src/i18n/rtl.test.ts +16 -7
  477. package/src/rich-text/VertesiaRichTextEditor.test.tsx +33 -1
  478. package/src/router/RouteComponent.test.tsx +139 -0
  479. package/src/router/RouteComponent.tsx +54 -9
  480. package/src/session/UserSessionProvider.tsx +20 -31
  481. package/src/session/auth/composable.scope.test.ts +1 -1
  482. package/src/session/auth/composable.test.ts +61 -1
  483. package/src/session/auth/composable.ts +29 -23
  484. package/src/session/auth/domainRouting.test.ts +24 -1
  485. package/src/session/auth/domainRouting.ts +29 -0
  486. package/src/session/auth/firebase.ts +1 -1
  487. package/src/session/useUXTracking.tsx +6 -1
  488. package/src/shell/VertesiaShell.tsx +2 -0
  489. package/src/shell/apps/IframeAppContextSync.test.tsx +196 -0
  490. package/src/shell/apps/IframeAppContextSync.tsx +101 -0
  491. package/src/shell/apps/iframe-auth.test.ts +118 -0
  492. package/src/shell/apps/iframe-auth.ts +193 -0
  493. package/src/shell/apps/index.ts +2 -0
  494. package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +12 -3
  495. package/src/widgets/markdown/MarkdownRenderer.tsx +50 -2
  496. package/src/widgets/markdown/MermaidDiagram.tsx +38 -22
  497. package/src/widgets/monacoEditor/MonacoEditor.tsx +27 -20
  498. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +0 -25
  499. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +0 -1
  500. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +0 -42
  501. package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +0 -1
  502. package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +0 -86
@@ -0,0 +1,352 @@
1
+ import type { VertesiaClient } from '@vertesia/client';
2
+ import type {
3
+ ExecuteViewRequest,
4
+ ViewActionConfiguration,
5
+ ViewExecutionDefinition,
6
+ ViewExecutionResult,
7
+ ViewHit,
8
+ } from '@vertesia/common';
9
+ import {
10
+ Button,
11
+ Checkbox,
12
+ ConfirmModal,
13
+ Popover,
14
+ PopoverContent,
15
+ PopoverTrigger,
16
+ SelectList,
17
+ useToast,
18
+ } from '@vertesia/ui/core';
19
+ import { useUITranslation } from '@vertesia/ui/i18n';
20
+ import { Download, EllipsisVertical, Trash2, X } from 'lucide-react';
21
+ import { createContext, type ReactNode, useCallback, useContext, useId, useMemo, useRef, useState } from 'react';
22
+ import { ExportPropertiesModal } from '../store/objects/ExportPropertiesModal.js';
23
+ import type {
24
+ ViewActionContext,
25
+ ViewActionContribution,
26
+ ViewExperienceContributions,
27
+ ViewSelectionController,
28
+ } from './types.js';
29
+
30
+ interface PendingAction {
31
+ action: ViewActionConfiguration;
32
+ hits: ViewHit[];
33
+ }
34
+
35
+ interface ViewActionsRuntime {
36
+ actions: ViewActionConfiguration[];
37
+ runningActionId?: string;
38
+ run: (action: ViewActionConfiguration, hits: ViewHit[]) => void;
39
+ }
40
+
41
+ const ViewActionsContext = createContext<ViewActionsRuntime | undefined>(undefined);
42
+
43
+ export function useViewActions(): ViewActionsRuntime | undefined {
44
+ return useContext(ViewActionsContext);
45
+ }
46
+
47
+ interface ViewActionsProviderProps {
48
+ children: ReactNode;
49
+ definition: ViewExecutionDefinition;
50
+ request: ExecuteViewRequest;
51
+ result: ViewExecutionResult;
52
+ selection?: ViewSelectionController;
53
+ contributions?: ViewExperienceContributions;
54
+ client?: VertesiaClient;
55
+ canDelete: boolean;
56
+ refresh: () => Promise<void>;
57
+ }
58
+
59
+ function selectionMatches(action: ViewActionConfiguration, hits: ViewHit[]): boolean {
60
+ const requirement = action.requires_selection ?? (action.placement === 'toolbar' ? 'none' : 'any');
61
+ if (requirement === 'none') return true;
62
+ if (requirement === 'single') return hits.length === 1;
63
+ if (requirement === 'multiple') return hits.length > 1;
64
+ return hits.length > 0;
65
+ }
66
+
67
+ function triggerDownload(response: { type: string; name: string; data: string }): void {
68
+ const url = window.URL.createObjectURL(new Blob([response.data], { type: response.type }));
69
+ const anchor = document.createElement('a');
70
+ anchor.download = response.name;
71
+ anchor.href = url;
72
+ anchor.click();
73
+ window.setTimeout(() => window.URL.revokeObjectURL(url), 0);
74
+ }
75
+
76
+ export function ViewActionsProvider({
77
+ children,
78
+ definition,
79
+ request,
80
+ result,
81
+ selection,
82
+ contributions,
83
+ client,
84
+ canDelete,
85
+ refresh,
86
+ }: ViewActionsProviderProps) {
87
+ const { t } = useUITranslation();
88
+ const toast = useToast();
89
+ const [pending, setPending] = useState<PendingAction>();
90
+ const [exportHits, setExportHits] = useState<ViewHit[]>();
91
+ const [isExporting, setIsExporting] = useState(false);
92
+ const [runningActionId, setRunningActionId] = useState<string>();
93
+ const runningActionRef = useRef(false);
94
+ const actionsConfiguration = definition.results?.actions;
95
+
96
+ const baseContext = useMemo<Omit<ViewActionContext, 'action' | 'hits'>>(
97
+ () => ({
98
+ definition,
99
+ request,
100
+ result,
101
+ refresh,
102
+ clearSelection: () => selection?.clear(),
103
+ }),
104
+ [definition, refresh, request, result, selection],
105
+ );
106
+
107
+ const actions = useMemo(() => {
108
+ const configured = (actionsConfiguration?.items ?? []).filter((action) => {
109
+ const contribution = contributions?.actions?.[action.handler];
110
+ return contribution !== undefined && (contribution.isAvailable?.(baseContext) ?? true);
111
+ });
112
+ if (!selection || actionsConfiguration?.include_defaults === false || !client) return configured;
113
+
114
+ const excluded = new Set(actionsConfiguration?.exclude_defaults ?? []);
115
+ const defaults: ViewActionConfiguration[] = [];
116
+ if (!excluded.has('export')) {
117
+ defaults.push({
118
+ id: 'export',
119
+ label: t('store.actions.exportProperties'),
120
+ handler: 'export',
121
+ placement: 'selection',
122
+ requires_selection: 'any',
123
+ });
124
+ }
125
+ if (canDelete && !excluded.has('delete')) {
126
+ defaults.push({
127
+ id: 'delete',
128
+ label: t('store.actions.delete'),
129
+ handler: 'delete',
130
+ placement: 'selection',
131
+ requires_selection: 'any',
132
+ destructive: true,
133
+ confirm: true,
134
+ });
135
+ }
136
+ return [...defaults, ...configured];
137
+ }, [actionsConfiguration, baseContext, canDelete, client, contributions?.actions, selection, t]);
138
+
139
+ const execute = useCallback(
140
+ async ({ action, hits }: PendingAction) => {
141
+ if (runningActionRef.current) return;
142
+ runningActionRef.current = true;
143
+ setRunningActionId(action.id);
144
+ try {
145
+ if (action.handler === 'delete') {
146
+ if (!client) return;
147
+ const response = await client.store.objects.delete(hits.map((hit) => hit.id));
148
+ toast({
149
+ status: response.failed.length > 0 ? 'warning' : 'success',
150
+ title: t('view.deletedObjects', { count: response.deleted }),
151
+ });
152
+ selection?.clear();
153
+ await refresh();
154
+ return;
155
+ }
156
+
157
+ const contribution: ViewActionContribution | undefined = contributions?.actions?.[action.handler];
158
+ if (!contribution) return;
159
+ await contribution.run({ ...baseContext, action, hits });
160
+ } catch (error: unknown) {
161
+ console.error('View action failed:', error);
162
+ toast({
163
+ status: 'error',
164
+ title: t('view.actionFailed'),
165
+ description: t('view.actionFailedDescription'),
166
+ });
167
+ } finally {
168
+ runningActionRef.current = false;
169
+ setRunningActionId(undefined);
170
+ setPending(undefined);
171
+ }
172
+ },
173
+ [baseContext, client, contributions?.actions, refresh, selection, t, toast],
174
+ );
175
+
176
+ const run = useCallback(
177
+ (action: ViewActionConfiguration, hits: ViewHit[]) => {
178
+ if (!selectionMatches(action, hits) || runningActionRef.current) return;
179
+ if (action.handler === 'export') {
180
+ setExportHits(hits);
181
+ return;
182
+ }
183
+ if (action.confirm) {
184
+ setPending({ action, hits });
185
+ return;
186
+ }
187
+ void execute({ action, hits });
188
+ },
189
+ [execute],
190
+ );
191
+
192
+ const closeExport = useCallback(
193
+ (format?: string | null) => {
194
+ if (!format || !exportHits?.length || !client) {
195
+ setExportHits(undefined);
196
+ return;
197
+ }
198
+ setIsExporting(true);
199
+ void client.store.objects
200
+ .exportProperties({ objectIds: exportHits.map((hit) => hit.id), type: format })
201
+ .then((response) => {
202
+ triggerDownload(response);
203
+ toast({ status: 'success', title: t('store.actions.exportProperties') });
204
+ setExportHits(undefined);
205
+ })
206
+ .catch((error: unknown) => {
207
+ console.error('View export failed:', error);
208
+ toast({
209
+ status: 'error',
210
+ title: t('store.actions.errorExportProperties'),
211
+ description: t('view.actionFailedDescription'),
212
+ });
213
+ })
214
+ .finally(() => setIsExporting(false));
215
+ },
216
+ [client, exportHits, t, toast],
217
+ );
218
+
219
+ const value = useMemo<ViewActionsRuntime>(
220
+ () => ({ actions, runningActionId, run }),
221
+ [actions, run, runningActionId],
222
+ );
223
+
224
+ return (
225
+ <ViewActionsContext.Provider value={value}>
226
+ {children}
227
+ <ExportPropertiesModal
228
+ isOpen={exportHits !== undefined}
229
+ isExporting={isExporting}
230
+ onClose={closeExport}
231
+ allowExportAll={false}
232
+ />
233
+ <ConfirmModal
234
+ isOpen={pending !== undefined}
235
+ title={pending?.action.label ?? t('modal.confirm')}
236
+ content={t('view.confirmAction', {
237
+ action: pending?.action.label ?? '',
238
+ count: pending?.hits.length ?? 0,
239
+ })}
240
+ isLoading={runningActionId !== undefined}
241
+ onConfirm={() => {
242
+ if (pending) void execute(pending);
243
+ }}
244
+ onCancel={() => setPending(undefined)}
245
+ confirmationValue={pending?.action.handler === 'delete' ? 'delete' : undefined}
246
+ confirmationLabel={pending?.action.handler === 'delete' ? t('view.typeDeleteToConfirm') : undefined}
247
+ confirmationPlaceholder={pending?.action.handler === 'delete' ? 'delete' : undefined}
248
+ />
249
+ </ViewActionsContext.Provider>
250
+ );
251
+ }
252
+
253
+ export function ViewActionsToolbar({
254
+ selection,
255
+ page,
256
+ showSelectPage = false,
257
+ }: {
258
+ selection?: ViewSelectionController;
259
+ page: ViewHit[];
260
+ showSelectPage?: boolean;
261
+ }) {
262
+ const { t } = useUITranslation();
263
+ const runtime = useViewActions();
264
+ const selectPageId = useId();
265
+ if (!runtime) return null;
266
+ const selected = selection?.selectedHits ?? [];
267
+ const selectedOnPage = selection ? page.filter((hit) => selection.isSelected(hit.id)).length : 0;
268
+ const allOnPageSelected = page.length > 0 && selectedOnPage === page.length;
269
+ const canSelectPage = showSelectPage && selection?.selectAll && page.length > 0;
270
+ const actions = runtime.actions.filter(
271
+ (action) =>
272
+ ((action.placement ?? 'selection') === 'toolbar' ||
273
+ ((action.placement ?? 'selection') === 'selection' && selected.length > 0)) &&
274
+ selectionMatches(action, selected),
275
+ );
276
+ if (actions.length === 0 && selected.length === 0 && !canSelectPage) return null;
277
+
278
+ return (
279
+ <div className="flex flex-wrap items-center gap-2">
280
+ {canSelectPage && selection && (
281
+ <div className="flex items-center gap-2">
282
+ <Checkbox
283
+ id={selectPageId}
284
+ checked={allOnPageSelected ? true : selectedOnPage > 0 ? 'indeterminate' : false}
285
+ onCheckedChange={(checked) => selection.togglePage(page, checked === true)}
286
+ />
287
+ <label htmlFor={selectPageId} className="text-sm text-muted">
288
+ {t('view.selectPage')}
289
+ </label>
290
+ </div>
291
+ )}
292
+ {selected.length > 0 && (
293
+ <>
294
+ <span className="text-sm text-muted">{t('view.selectedCount', { count: selected.length })}</span>
295
+ <Button
296
+ type="button"
297
+ variant="ghost"
298
+ size="icon"
299
+ aria-label={t('view.clearSelection')}
300
+ onClick={selection?.clear}
301
+ >
302
+ <X className="size-4" />
303
+ </Button>
304
+ </>
305
+ )}
306
+ {actions.map((action) => (
307
+ <Button
308
+ key={action.id}
309
+ type="button"
310
+ variant={action.destructive ? 'destructive' : 'outline'}
311
+ size="sm"
312
+ disabled={runtime.runningActionId !== undefined}
313
+ onClick={() => runtime.run(action, selected)}
314
+ >
315
+ {action.handler === 'export' && <Download className="size-4" />}
316
+ {action.handler === 'delete' && <Trash2 className="size-4" />}
317
+ {action.label}
318
+ </Button>
319
+ ))}
320
+ </div>
321
+ );
322
+ }
323
+
324
+ export function ViewRowActions({ hit }: { hit: ViewHit }) {
325
+ const { t } = useUITranslation();
326
+ const runtime = useViewActions();
327
+ const actions = runtime?.actions.filter(
328
+ (action) => (action.placement ?? 'selection') === 'row' && selectionMatches(action, [hit]),
329
+ );
330
+ if (!runtime || !actions?.length) return null;
331
+
332
+ return (
333
+ <Popover>
334
+ <PopoverTrigger>
335
+ <Button type="button" variant="ghost" size="icon" aria-label={t('view.actions')}>
336
+ <EllipsisVertical className="size-4" />
337
+ </Button>
338
+ </PopoverTrigger>
339
+ <PopoverContent className="w-52 p-1" align="end" sideOffset={6}>
340
+ <SelectList
341
+ options={actions}
342
+ optionLayout={(action) => ({
343
+ label: action.label,
344
+ className: action.destructive ? 'text-destructive' : undefined,
345
+ })}
346
+ onChange={(action) => runtime.run(action, [hit])}
347
+ noCheck
348
+ />
349
+ </PopoverContent>
350
+ </Popover>
351
+ );
352
+ }
@@ -0,0 +1,150 @@
1
+ import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react';
2
+ import { ContentObjectStatus, type ViewExecutionDefinition, type ViewExecutionResult } from '@vertesia/common';
3
+ import { afterEach, describe, expect, it, vi } from 'vitest';
4
+ import { renderWithProviders } from '../../__tests__/test-utils.js';
5
+ import { ViewDropTarget } from './ViewDropTarget.js';
6
+
7
+ vi.mock('../store/objects/upload/DocumentUploadModal.js', () => ({
8
+ DocumentUploadModal: ({
9
+ isOpen,
10
+ files,
11
+ collectionId,
12
+ selectedFolder,
13
+ initialTypeId,
14
+ defaultProperties,
15
+ allowFolders,
16
+ }: {
17
+ isOpen: boolean;
18
+ files: File[];
19
+ collectionId?: string;
20
+ selectedFolder?: string;
21
+ initialTypeId?: string;
22
+ defaultProperties?: Record<string, unknown>;
23
+ allowFolders?: boolean;
24
+ }) =>
25
+ isOpen ? (
26
+ <div
27
+ data-testid="upload-modal"
28
+ data-collection-id={collectionId}
29
+ data-location={selectedFolder}
30
+ data-type-id={initialTypeId}
31
+ data-properties={JSON.stringify(defaultProperties)}
32
+ data-allow-folders={String(allowFolders)}
33
+ >
34
+ {files.map((file) => file.name).join(',')}
35
+ </div>
36
+ ) : null,
37
+ }));
38
+
39
+ const definition: ViewExecutionDefinition = {
40
+ name: 'Inbox',
41
+ results: {
42
+ default_display: 'list',
43
+ displays: [{ id: 'list', label: 'List', type: 'list', title: { field: 'name' } }],
44
+ drop: {
45
+ handler: 'upload',
46
+ params: {
47
+ type_id: 'invoice',
48
+ collection_id: 'inbox',
49
+ location: '/Inbox',
50
+ properties: { source: 'view' },
51
+ allow_folders: false,
52
+ },
53
+ },
54
+ },
55
+ };
56
+
57
+ const result: ViewExecutionResult = {
58
+ view: 'inbox',
59
+ revision: 1,
60
+ definition,
61
+ display: 'list',
62
+ search: { requested_mode: 'browse', applied_mode: 'browse', warnings: [] },
63
+ hits: [
64
+ {
65
+ id: 'document-1',
66
+ document: {
67
+ id: 'document-1',
68
+ name: 'Invoice',
69
+ created_at: '2026-01-01T00:00:00.000Z',
70
+ created_by: 'user-1',
71
+ updated_at: '2026-01-01T00:00:00.000Z',
72
+ updated_by: 'user-1',
73
+ location: '/Inbox',
74
+ status: ContentObjectStatus.completed,
75
+ properties: {},
76
+ revision: { root: 'document-1', head: true },
77
+ },
78
+ },
79
+ ],
80
+ total: 1,
81
+ navigation: {},
82
+ took: 1,
83
+ };
84
+
85
+ function dropFile(target: HTMLElement, name: string): File {
86
+ const file = new File(['content'], name, { type: 'application/pdf' });
87
+ fireEvent.drop(target, { dataTransfer: { files: [file] } });
88
+ return file;
89
+ }
90
+
91
+ describe('ViewDropTarget', () => {
92
+ afterEach(() => {
93
+ cleanup();
94
+ vi.clearAllMocks();
95
+ });
96
+
97
+ it('opens the built-in uploader for a JSON-configured upload drop', async () => {
98
+ renderWithProviders(
99
+ <ViewDropTarget definition={definition} request={{}} result={result} canWrite refresh={vi.fn()}>
100
+ <div>View results</div>
101
+ </ViewDropTarget>,
102
+ );
103
+
104
+ const target = screen.getByText('View results').parentElement;
105
+ expect(target).not.toBeNull();
106
+ dropFile(target as HTMLElement, 'invoice.pdf');
107
+
108
+ const modal = await screen.findByTestId('upload-modal');
109
+ expect(modal.textContent).toContain('invoice.pdf');
110
+ expect(modal.dataset).toMatchObject({
111
+ collectionId: 'inbox',
112
+ location: '/Inbox',
113
+ typeId: 'invoice',
114
+ properties: '{"source":"view"}',
115
+ allowFolders: 'false',
116
+ });
117
+ });
118
+
119
+ it('runs a code contribution instead of the configured upload action', async () => {
120
+ const run = vi.fn();
121
+ renderWithProviders(
122
+ <ViewDropTarget
123
+ definition={definition}
124
+ request={{ query: 'open invoices' }}
125
+ result={result}
126
+ contribution={{ run }}
127
+ canWrite
128
+ refresh={vi.fn()}
129
+ >
130
+ <div>View results</div>
131
+ </ViewDropTarget>,
132
+ );
133
+
134
+ const target = screen.getByText('View results').parentElement;
135
+ expect(target).not.toBeNull();
136
+ const file = dropFile(target as HTMLElement, 'invoice.pdf');
137
+
138
+ await waitFor(() => {
139
+ expect(run).toHaveBeenCalledOnce();
140
+ expect(run).toHaveBeenCalledWith(
141
+ expect.objectContaining({
142
+ configuration: definition.results?.drop,
143
+ files: [file],
144
+ request: { query: 'open invoices' },
145
+ }),
146
+ );
147
+ });
148
+ expect(screen.queryByTestId('upload-modal')).toBeNull();
149
+ });
150
+ });
@@ -0,0 +1,140 @@
1
+ import type { ExecuteViewRequest, ViewExecutionDefinition, ViewExecutionResult } from '@vertesia/common';
2
+ import { Spinner, useToast } from '@vertesia/ui/core';
3
+ import { useUITranslation } from '@vertesia/ui/i18n';
4
+ import { DropZone } from '@vertesia/ui/widgets';
5
+ import { type DragEvent, type ReactNode, useCallback, useRef, useState } from 'react';
6
+ import { DocumentUploadModal } from '../store/objects/upload/DocumentUploadModal.js';
7
+ import type { ViewDropContribution } from './types.js';
8
+
9
+ interface ViewDropTargetProps {
10
+ children: ReactNode;
11
+ definition: ViewExecutionDefinition;
12
+ request: ExecuteViewRequest;
13
+ result: ViewExecutionResult;
14
+ contribution?: ViewDropContribution;
15
+ canWrite: boolean;
16
+ refresh: () => Promise<void>;
17
+ }
18
+
19
+ function droppedFiles(event: DragEvent<HTMLDivElement>): File[] {
20
+ if (event.dataTransfer.items) {
21
+ return Array.from(event.dataTransfer.items)
22
+ .filter((item) => item.kind === 'file')
23
+ .map((item) => item.getAsFile())
24
+ .filter((file): file is File => file !== null);
25
+ }
26
+ return Array.from(event.dataTransfer.files);
27
+ }
28
+
29
+ export function ViewDropTarget({
30
+ children,
31
+ definition,
32
+ request,
33
+ result,
34
+ contribution,
35
+ canWrite,
36
+ refresh,
37
+ }: ViewDropTargetProps) {
38
+ const { t } = useUITranslation();
39
+ const toast = useToast();
40
+ const configuration = definition.results?.drop;
41
+ const builtinEnabled = configuration?.handler === 'upload' && canWrite;
42
+ const enabled = contribution !== undefined || builtinEnabled;
43
+ const [isDragging, setIsDragging] = useState(false);
44
+ const [isRunning, setIsRunning] = useState(false);
45
+ const [files, setFiles] = useState<File[]>([]);
46
+ const runningRef = useRef(false);
47
+
48
+ const handleFiles = useCallback(
49
+ async (nextFiles: File[]) => {
50
+ if (!nextFiles.length) return;
51
+ if (contribution) {
52
+ if (runningRef.current) return;
53
+ runningRef.current = true;
54
+ setIsRunning(true);
55
+ try {
56
+ await contribution.run({ configuration, files: nextFiles, definition, request, result, refresh });
57
+ } catch (error: unknown) {
58
+ console.error('View drop action failed:', error);
59
+ toast({
60
+ status: 'error',
61
+ title: t('view.dropFailed'),
62
+ description: t('view.actionFailedDescription'),
63
+ });
64
+ } finally {
65
+ runningRef.current = false;
66
+ setIsRunning(false);
67
+ }
68
+ return;
69
+ }
70
+ if (builtinEnabled) setFiles(nextFiles);
71
+ },
72
+ [builtinEnabled, configuration, contribution, definition, refresh, request, result, t, toast],
73
+ );
74
+
75
+ if (!enabled) return children;
76
+
77
+ const params = configuration?.params;
78
+ return (
79
+ <>
80
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: HTML has no dedicated semantic element for a native file drop target. */}
81
+ <div
82
+ className="relative min-h-48"
83
+ onDragEnter={(event) => {
84
+ event.preventDefault();
85
+ setIsDragging(true);
86
+ }}
87
+ onDragOver={(event) => {
88
+ event.preventDefault();
89
+ setIsDragging(true);
90
+ }}
91
+ onDragLeave={(event) => {
92
+ event.preventDefault();
93
+ if (!event.currentTarget.contains(event.relatedTarget as Node)) setIsDragging(false);
94
+ }}
95
+ onDrop={(event) => {
96
+ event.preventDefault();
97
+ event.stopPropagation();
98
+ setIsDragging(false);
99
+ if ((event.target as Element).closest('[data-view-drop-zone]')) return;
100
+ void handleFiles(droppedFiles(event));
101
+ }}
102
+ >
103
+ {children}
104
+ {isRunning && (
105
+ <div className="absolute inset-0 z-40 flex items-center justify-center bg-background/80">
106
+ <Spinner size="xl" />
107
+ </div>
108
+ )}
109
+ <div
110
+ data-view-drop-zone
111
+ className={`pointer-events-none absolute inset-0 ${isDragging ? 'z-50' : '-z-10'}`}
112
+ >
113
+ <DropZone
114
+ onDrop={(nextFiles) => void handleFiles(nextFiles)}
115
+ message={t('view.dropFiles')}
116
+ buttonLabel={t('view.selectFiles')}
117
+ allowFolders={params?.allow_folders ?? true}
118
+ className={`pointer-events-auto absolute inset-0 bg-background/90 ${isDragging ? 'flex' : 'hidden'}`}
119
+ />
120
+ </div>
121
+ </div>
122
+ {builtinEnabled && (
123
+ <DocumentUploadModal
124
+ isOpen={files.length > 0}
125
+ onClose={() => setFiles([])}
126
+ files={files}
127
+ collectionId={params?.collection_id}
128
+ selectedFolder={params?.location}
129
+ initialTypeId={params?.type_id}
130
+ defaultProperties={params?.properties}
131
+ allowFolders={params?.allow_folders ?? true}
132
+ title={t('view.uploadToView')}
133
+ onUploadComplete={(uploadResult) => {
134
+ if (uploadResult.success) void refresh();
135
+ }}
136
+ />
137
+ )}
138
+ </>
139
+ );
140
+ }