@vertesia/ui 0.60.0 → 0.61.0

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 (661) hide show
  1. package/lib/esm/core/components/FormItem.js +9 -0
  2. package/lib/esm/core/components/FormItem.js.map +1 -0
  3. package/lib/esm/core/components/InputList.js +4 -3
  4. package/lib/esm/core/components/InputList.js.map +1 -1
  5. package/lib/esm/core/components/index.js +3 -3
  6. package/lib/esm/core/components/index.js.map +1 -1
  7. package/lib/esm/core/components/shadcn/button.js +37 -7
  8. package/lib/esm/core/components/shadcn/button.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/dialog.js +3 -3
  10. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/filters/DynamicLabel.js +38 -0
  12. package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -0
  13. package/lib/esm/core/components/shadcn/filters/comboBox.js +24 -26
  14. package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
  15. package/lib/esm/core/components/shadcn/filters/dateFilter.js +12 -12
  16. package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +1 -1
  17. package/lib/esm/core/components/shadcn/filters/filterBar.js +49 -36
  18. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  19. package/lib/esm/core/components/shadcn/filters/filters.js +31 -23
  20. package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
  21. package/lib/esm/core/components/shadcn/filters/selectFilter.js +33 -24
  22. package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
  23. package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -2
  24. package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
  25. package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
  26. package/lib/esm/core/components/shadcn/input.js +4 -4
  27. package/lib/esm/core/components/shadcn/input.js.map +1 -1
  28. package/lib/esm/core/components/shadcn/selectBox.js +72 -6
  29. package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
  30. package/lib/esm/core/components/styles.js +1 -1
  31. package/lib/esm/core/components/styles.js.map +1 -1
  32. package/lib/esm/core/components/table/index.js +3 -0
  33. package/lib/esm/core/components/table/index.js.map +1 -1
  34. package/lib/esm/core/index.js +2 -1
  35. package/lib/esm/core/index.js.map +1 -1
  36. package/lib/esm/core/utils/cn.js +6 -0
  37. package/lib/esm/core/utils/cn.js.map +1 -0
  38. package/lib/esm/core/utils/index.js +2 -0
  39. package/lib/esm/core/utils/index.js.map +1 -0
  40. package/lib/esm/features/agent/PayloadBuilder.js +174 -0
  41. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -0
  42. package/lib/esm/features/agent/chat/AnimatedThinkingDots.js +207 -0
  43. package/lib/esm/features/agent/chat/AnimatedThinkingDots.js.map +1 -0
  44. package/lib/esm/features/agent/chat/JumpingDots.js +6 -0
  45. package/lib/esm/features/agent/chat/JumpingDots.js.map +1 -0
  46. package/lib/esm/features/agent/chat/ModernAgentConversation.js +409 -0
  47. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -0
  48. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +129 -0
  49. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -0
  50. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +66 -0
  51. package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -0
  52. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js +29 -0
  53. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js.map +1 -0
  54. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +97 -0
  55. package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -0
  56. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +46 -0
  57. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -0
  58. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +352 -0
  59. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -0
  60. package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js +20 -0
  61. package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js.map +1 -0
  62. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +62 -0
  63. package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -0
  64. package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js +23 -0
  65. package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -0
  66. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +51 -0
  67. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -0
  68. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +82 -0
  69. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -0
  70. package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js +13 -0
  71. package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js.map +1 -0
  72. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +105 -0
  73. package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -0
  74. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +154 -0
  75. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -0
  76. package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js +266 -0
  77. package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js.map +1 -0
  78. package/lib/esm/features/agent/chat/WaitingMessages.js +60 -0
  79. package/lib/esm/features/agent/chat/WaitingMessages.js.map +1 -0
  80. package/lib/esm/features/agent/chat/index.js +5 -0
  81. package/lib/esm/features/agent/chat/index.js.map +1 -0
  82. package/lib/esm/features/agent/index.js +3 -0
  83. package/lib/esm/features/agent/index.js.map +1 -0
  84. package/lib/esm/features/errors/PanelErrorBoundary.js +11 -0
  85. package/lib/esm/features/errors/PanelErrorBoundary.js.map +1 -0
  86. package/lib/esm/features/errors/RowErrorBoundary.js +9 -0
  87. package/lib/esm/features/errors/RowErrorBoundary.js.map +1 -0
  88. package/lib/esm/features/errors/VertesiaErrorBoundary.js +15 -0
  89. package/lib/esm/features/errors/VertesiaErrorBoundary.js.map +1 -0
  90. package/lib/esm/features/errors/WidgetErrorBoundary.js +11 -0
  91. package/lib/esm/features/errors/WidgetErrorBoundary.js.map +1 -0
  92. package/lib/esm/features/errors/index.js +5 -0
  93. package/lib/esm/features/errors/index.js.map +1 -0
  94. package/lib/esm/features/facets/EnvironmentFacet.js +39 -0
  95. package/lib/esm/features/facets/EnvironmentFacet.js.map +1 -0
  96. package/lib/esm/features/facets/FacetsNav.js +8 -0
  97. package/lib/esm/features/facets/FacetsNav.js.map +1 -0
  98. package/lib/esm/features/facets/InteractionFacet.js +39 -0
  99. package/lib/esm/features/facets/InteractionFacet.js.map +1 -0
  100. package/lib/esm/features/facets/StringFacet.js +12 -0
  101. package/lib/esm/features/facets/StringFacet.js.map +1 -0
  102. package/lib/esm/features/facets/StringListFacet.js +11 -0
  103. package/lib/esm/features/facets/StringListFacet.js.map +1 -0
  104. package/lib/esm/features/facets/TypeFacet.js +42 -0
  105. package/lib/esm/features/facets/TypeFacet.js.map +1 -0
  106. package/lib/esm/features/facets/TypeOptions.js +19 -0
  107. package/lib/esm/features/facets/TypeOptions.js.map +1 -0
  108. package/lib/esm/features/facets/UserFacet.js +33 -0
  109. package/lib/esm/features/facets/UserFacet.js.map +1 -0
  110. package/lib/esm/features/facets/VFacetsNav.js +114 -0
  111. package/lib/esm/features/facets/VFacetsNav.js.map +1 -0
  112. package/lib/esm/features/facets/VStringFacet.js +17 -0
  113. package/lib/esm/features/facets/VStringFacet.js.map +1 -0
  114. package/lib/esm/features/facets/VTypeFacet.js +56 -0
  115. package/lib/esm/features/facets/VTypeFacet.js.map +1 -0
  116. package/lib/esm/features/facets/VUserFacet.js +31 -0
  117. package/lib/esm/features/facets/VUserFacet.js.map +1 -0
  118. package/lib/esm/features/facets/index.js +12 -0
  119. package/lib/esm/features/facets/index.js.map +1 -0
  120. package/lib/esm/features/facets/utils.js +7 -0
  121. package/lib/esm/features/facets/utils.js.map +1 -0
  122. package/lib/esm/features/index.js +9 -1
  123. package/lib/esm/features/index.js.map +1 -1
  124. package/lib/esm/features/layout/GenericPageNavHeader.js +11 -0
  125. package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -0
  126. package/lib/esm/features/layout/NotFoundView.js +5 -0
  127. package/lib/esm/features/layout/NotFoundView.js.map +1 -0
  128. package/lib/esm/features/layout/index.js +3 -0
  129. package/lib/esm/features/layout/index.js.map +1 -0
  130. package/lib/esm/features/magic-pdf/DownloadPopover.js +13 -0
  131. package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -0
  132. package/lib/esm/features/magic-pdf/MagicPdfView.js +44 -0
  133. package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -0
  134. package/lib/esm/features/magic-pdf/PageSlider.js +57 -0
  135. package/lib/esm/features/magic-pdf/PageSlider.js.map +1 -0
  136. package/lib/esm/features/magic-pdf/PdfPageProvider.js +133 -0
  137. package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -0
  138. package/lib/esm/features/magic-pdf/TextPageView.js +45 -0
  139. package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -0
  140. package/lib/esm/features/magic-pdf/index.js +2 -0
  141. package/lib/esm/features/magic-pdf/index.js.map +1 -0
  142. package/lib/esm/features/magic-pdf/types.js +2 -0
  143. package/lib/esm/features/magic-pdf/types.js.map +1 -0
  144. package/lib/esm/features/magic-pdf/useResizeOnDrag.js +34 -0
  145. package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +1 -0
  146. package/lib/esm/features/store/collections/BrowseCollectionView.js +37 -0
  147. package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -0
  148. package/lib/esm/features/store/collections/CollectionView.js +53 -0
  149. package/lib/esm/features/store/collections/CollectionView.js.map +1 -0
  150. package/lib/esm/features/store/collections/CollectionsTable.js +60 -0
  151. package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -0
  152. package/lib/esm/features/store/collections/CollectionsView.js +94 -0
  153. package/lib/esm/features/store/collections/CollectionsView.js.map +1 -0
  154. package/lib/esm/features/store/collections/EditCollectionView.js +161 -0
  155. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -0
  156. package/lib/esm/features/store/collections/index.js +6 -0
  157. package/lib/esm/features/store/collections/index.js.map +1 -0
  158. package/lib/esm/features/store/index.js +4 -0
  159. package/lib/esm/features/store/index.js.map +1 -0
  160. package/lib/esm/features/store/objects/DocumentPreviewPanel.js +150 -0
  161. package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -0
  162. package/lib/esm/features/store/objects/DocumentSearchResults.js +123 -0
  163. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -0
  164. package/lib/esm/features/store/objects/DocumentSelectionProvider.js +81 -0
  165. package/lib/esm/features/store/objects/DocumentSelectionProvider.js.map +1 -0
  166. package/lib/esm/features/store/objects/DocumentTable.js +278 -0
  167. package/lib/esm/features/store/objects/DocumentTable.js.map +1 -0
  168. package/lib/esm/features/store/objects/ExportPropertiesModal.js +31 -0
  169. package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -0
  170. package/lib/esm/features/store/objects/components/ContentDispositionButton.js +31 -0
  171. package/lib/esm/features/store/objects/components/ContentDispositionButton.js.map +1 -0
  172. package/lib/esm/features/store/objects/components/ContentOverview.js +195 -0
  173. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -0
  174. package/lib/esm/features/store/objects/components/DocumentIcon.js +28 -0
  175. package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -0
  176. package/lib/esm/features/store/objects/components/DocumentInput.js +52 -0
  177. package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -0
  178. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +169 -0
  179. package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -0
  180. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +45 -0
  181. package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -0
  182. package/lib/esm/features/store/objects/components/SelectDocument.js +39 -0
  183. package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -0
  184. package/lib/esm/features/store/objects/components/SelectDocumentModal.js +7 -0
  185. package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -0
  186. package/lib/esm/features/store/objects/components/VectorSearchWidget.js +85 -0
  187. package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -0
  188. package/lib/esm/features/store/objects/components/index.js +10 -0
  189. package/lib/esm/features/store/objects/components/index.js.map +1 -0
  190. package/lib/esm/features/store/objects/components/useDownloadObject.js +21 -0
  191. package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -0
  192. package/lib/esm/features/store/objects/index.js +11 -0
  193. package/lib/esm/features/store/objects/index.js.map +1 -0
  194. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +74 -0
  195. package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -0
  196. package/lib/esm/features/store/objects/layout/documentLayout.js +16 -0
  197. package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -0
  198. package/lib/esm/features/store/objects/layout/index.js +3 -0
  199. package/lib/esm/features/store/objects/layout/index.js.map +1 -0
  200. package/lib/esm/features/store/objects/layout/renderers.js +128 -0
  201. package/lib/esm/features/store/objects/layout/renderers.js.map +1 -0
  202. package/lib/esm/features/store/objects/search/DocumentSearchContext.js +150 -0
  203. package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -0
  204. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +41 -0
  205. package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -0
  206. package/lib/esm/features/store/objects/search/index.js +3 -0
  207. package/lib/esm/features/store/objects/search/index.js.map +1 -0
  208. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +149 -0
  209. package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -0
  210. package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js +2 -0
  211. package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js.map +1 -0
  212. package/lib/esm/features/store/objects/selection/SelectionActions.js +75 -0
  213. package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -0
  214. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +64 -0
  215. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -0
  216. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +53 -0
  217. package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -0
  218. package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js +30 -0
  219. package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js.map +1 -0
  220. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +66 -0
  221. package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -0
  222. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +106 -0
  223. package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -0
  224. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +64 -0
  225. package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -0
  226. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +72 -0
  227. package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -0
  228. package/lib/esm/features/store/objects/selection/actions/index.js +8 -0
  229. package/lib/esm/features/store/objects/selection/actions/index.js.map +1 -0
  230. package/lib/esm/features/store/objects/selection/index.js +5 -0
  231. package/lib/esm/features/store/objects/selection/index.js.map +1 -0
  232. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +476 -0
  233. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -0
  234. package/lib/esm/features/store/objects/upload/index.js +4 -0
  235. package/lib/esm/features/store/objects/upload/index.js.map +1 -0
  236. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +201 -0
  237. package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -0
  238. package/lib/esm/features/store/objects/upload/useUploadHandler.js +230 -0
  239. package/lib/esm/features/store/objects/upload/useUploadHandler.js.map +1 -0
  240. package/lib/esm/features/store/types/ContentObjectTypeView.js +158 -0
  241. package/lib/esm/features/store/types/ContentObjectTypeView.js.map +1 -0
  242. package/lib/esm/features/store/types/ContentObjectTypesSearch.js +82 -0
  243. package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -0
  244. package/lib/esm/features/store/types/ContentObjectTypesTable.js +11 -0
  245. package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -0
  246. package/lib/esm/features/store/types/ContentObjectTypesView.js +55 -0
  247. package/lib/esm/features/store/types/ContentObjectTypesView.js.map +1 -0
  248. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +26 -0
  249. package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -0
  250. package/lib/esm/features/store/types/ObjectSchemaEditor.js +89 -0
  251. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -0
  252. package/lib/esm/features/store/types/SelectContentType.js +43 -0
  253. package/lib/esm/features/store/types/SelectContentType.js.map +1 -0
  254. package/lib/esm/features/store/types/SelectContentTypeModal.js +28 -0
  255. package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -0
  256. package/lib/esm/features/store/types/TableLayoutEditor.js +78 -0
  257. package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -0
  258. package/lib/esm/features/store/types/index.js +11 -0
  259. package/lib/esm/features/store/types/index.js.map +1 -0
  260. package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js +98 -0
  261. package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js.map +1 -0
  262. package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js +15 -0
  263. package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js.map +1 -0
  264. package/lib/esm/features/store/types/search/index.js +3 -0
  265. package/lib/esm/features/store/types/search/index.js.map +1 -0
  266. package/lib/esm/features/user/UserAvatar.js +18 -0
  267. package/lib/esm/features/user/UserAvatar.js.map +1 -0
  268. package/lib/esm/features/user/UserInfo.js +88 -0
  269. package/lib/esm/features/user/UserInfo.js.map +1 -0
  270. package/lib/esm/features/user/index.js +3 -0
  271. package/lib/esm/features/user/index.js.map +1 -0
  272. package/lib/esm/features/utils/index.js +4 -0
  273. package/lib/esm/features/utils/index.js.map +1 -0
  274. package/lib/esm/features/utils/mimeType.js +9 -0
  275. package/lib/esm/features/utils/mimeType.js.map +1 -0
  276. package/lib/esm/features/utils/rendition.js +47 -0
  277. package/lib/esm/features/utils/rendition.js.map +1 -0
  278. package/lib/esm/features/utils/text.js +10 -0
  279. package/lib/esm/features/utils/text.js.map +1 -0
  280. package/lib/esm/layout/FullHeightLayout.js +1 -1
  281. package/lib/esm/layout/FullHeightLayout.js.map +1 -1
  282. package/lib/esm/layout/Sidebar.js +12 -2
  283. package/lib/esm/layout/Sidebar.js.map +1 -1
  284. package/lib/esm/widgets/Progress.js +5 -0
  285. package/lib/esm/widgets/Progress.js.map +1 -0
  286. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +1 -1
  287. package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
  288. package/lib/esm/widgets/form/Form.js +2 -2
  289. package/lib/esm/widgets/form/Form.js.map +1 -1
  290. package/lib/esm/widgets/form/schema.js +11 -5
  291. package/lib/esm/widgets/form/schema.js.map +1 -1
  292. package/lib/esm/widgets/index.js +4 -0
  293. package/lib/esm/widgets/index.js.map +1 -1
  294. package/lib/esm/widgets/popover/Popover.js +73 -0
  295. package/lib/esm/widgets/popover/Popover.js.map +1 -0
  296. package/lib/esm/widgets/popover/context.js +7 -0
  297. package/lib/esm/widgets/popover/context.js.map +1 -0
  298. package/lib/esm/widgets/popover/index.js +3 -0
  299. package/lib/esm/widgets/popover/index.js.map +1 -0
  300. package/lib/esm/widgets/popover/slots.js +22 -0
  301. package/lib/esm/widgets/popover/slots.js.map +1 -0
  302. package/lib/esm/widgets/properties/PropertiesView.js +6 -0
  303. package/lib/esm/widgets/properties/PropertiesView.js.map +1 -0
  304. package/lib/esm/widgets/properties/index.js +2 -0
  305. package/lib/esm/widgets/properties/index.js.map +1 -0
  306. package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js +1 -2
  307. package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js.map +1 -1
  308. package/lib/esm/widgets/schema-editor/editor/Editable.js +9 -10
  309. package/lib/esm/widgets/schema-editor/editor/Editable.js.map +1 -1
  310. package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js +1 -1
  311. package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
  312. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +2 -2
  313. package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
  314. package/lib/esm/widgets/upload/DropZone.js +162 -0
  315. package/lib/esm/widgets/upload/DropZone.js.map +1 -0
  316. package/lib/esm/widgets/upload/UploadResultCategory.js +19 -0
  317. package/lib/esm/widgets/upload/UploadResultCategory.js.map +1 -0
  318. package/lib/esm/widgets/upload/UploadSummary.js +30 -0
  319. package/lib/esm/widgets/upload/UploadSummary.js.map +1 -0
  320. package/lib/esm/widgets/upload/index.js +4 -0
  321. package/lib/esm/widgets/upload/index.js.map +1 -0
  322. package/lib/tsconfig.tsbuildinfo +1 -1
  323. package/lib/types/core/components/FormItem.d.ts +11 -0
  324. package/lib/types/core/components/index.d.ts +3 -3
  325. package/lib/types/core/components/shadcn/button.d.ts +13 -2
  326. package/lib/types/core/components/shadcn/command.d.ts +7 -7
  327. package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +8 -0
  328. package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -5
  329. package/lib/types/core/components/shadcn/filters/dateFilter.d.ts +3 -4
  330. package/lib/types/core/components/shadcn/filters/types.d.ts +7 -1
  331. package/lib/types/core/components/shadcn/input.d.ts +4 -4
  332. package/lib/types/core/components/shadcn/selectBox.d.ts +13 -4
  333. package/lib/types/core/components/table/index.d.ts +1 -0
  334. package/lib/types/core/index.d.ts +2 -1
  335. package/lib/types/core/utils/cn.d.ts +2 -0
  336. package/lib/types/core/utils/index.d.ts +1 -0
  337. package/lib/types/features/agent/PayloadBuilder.d.ts +53 -0
  338. package/lib/types/features/agent/chat/AnimatedThinkingDots.d.ts +37 -0
  339. package/lib/types/features/agent/chat/JumpingDots.d.ts +6 -0
  340. package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +24 -0
  341. package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +21 -0
  342. package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +18 -0
  343. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.d.ts +10 -0
  344. package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +15 -0
  345. package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +12 -0
  346. package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +7 -0
  347. package/lib/types/features/agent/chat/ModernAgentOutput/MessagesContainer.d.ts +9 -0
  348. package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts +8 -0
  349. package/lib/types/features/agent/chat/ModernAgentOutput/SlideInPanel.d.ts +10 -0
  350. package/lib/types/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts +7 -0
  351. package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts +9 -0
  352. package/lib/types/features/agent/chat/ModernAgentOutput/StackedMessages.d.ts +7 -0
  353. package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts +21 -0
  354. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +23 -0
  355. package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts +17 -0
  356. package/lib/types/features/agent/chat/WaitingMessages.d.ts +1 -0
  357. package/lib/types/features/agent/chat/index.d.ts +4 -0
  358. package/lib/types/features/agent/index.d.ts +2 -0
  359. package/lib/types/features/errors/PanelErrorBoundary.d.ts +4 -0
  360. package/lib/types/features/errors/RowErrorBoundary.d.ts +7 -0
  361. package/lib/types/features/errors/VertesiaErrorBoundary.d.ts +11 -0
  362. package/lib/types/features/errors/WidgetErrorBoundary.d.ts +4 -0
  363. package/lib/types/features/errors/index.d.ts +4 -0
  364. package/lib/types/features/facets/EnvironmentFacet.d.ts +9 -0
  365. package/lib/types/features/facets/FacetsNav.d.ts +6 -0
  366. package/lib/types/features/facets/InteractionFacet.d.ts +9 -0
  367. package/lib/types/features/facets/StringFacet.d.ts +10 -0
  368. package/lib/types/features/facets/StringListFacet.d.ts +10 -0
  369. package/lib/types/features/facets/TypeFacet.d.ts +15 -0
  370. package/lib/types/features/facets/TypeOptions.d.ts +3 -0
  371. package/lib/types/features/facets/UserFacet.d.ts +11 -0
  372. package/lib/types/features/facets/VFacetsNav.d.ts +7 -0
  373. package/lib/types/features/facets/VStringFacet.d.ts +15 -0
  374. package/lib/types/features/facets/VTypeFacet.d.ts +8 -0
  375. package/lib/types/features/facets/VUserFacet.d.ts +9 -0
  376. package/lib/types/features/facets/index.d.ts +11 -0
  377. package/lib/types/features/facets/utils.d.ts +3 -0
  378. package/lib/types/features/index.d.ts +9 -1
  379. package/lib/types/features/layout/GenericPageNavHeader.d.ts +12 -0
  380. package/lib/types/features/layout/NotFoundView.d.ts +4 -0
  381. package/lib/types/features/layout/index.d.ts +2 -0
  382. package/lib/types/features/magic-pdf/DownloadPopover.d.ts +6 -0
  383. package/lib/types/features/magic-pdf/MagicPdfView.d.ts +6 -0
  384. package/lib/types/features/magic-pdf/PageSlider.d.ts +7 -0
  385. package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +28 -0
  386. package/lib/types/features/magic-pdf/TextPageView.d.ts +7 -0
  387. package/lib/types/features/magic-pdf/index.d.ts +1 -0
  388. package/lib/types/features/magic-pdf/types.d.ts +1 -0
  389. package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +8 -0
  390. package/lib/types/features/store/collections/BrowseCollectionView.d.ts +6 -0
  391. package/lib/types/features/store/collections/CollectionView.d.ts +5 -0
  392. package/lib/types/features/store/collections/CollectionsTable.d.ts +5 -0
  393. package/lib/types/features/store/collections/CollectionsView.d.ts +10 -0
  394. package/lib/types/features/store/collections/EditCollectionView.d.ts +7 -0
  395. package/lib/types/features/store/collections/index.d.ts +5 -0
  396. package/lib/types/features/store/index.d.ts +3 -0
  397. package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts +7 -0
  398. package/lib/types/features/store/objects/DocumentSearchResults.d.ts +19 -0
  399. package/lib/types/features/store/objects/DocumentSelectionProvider.d.ts +32 -0
  400. package/lib/types/features/store/objects/DocumentTable.d.ts +20 -0
  401. package/lib/types/features/store/objects/ExportPropertiesModal.d.ts +11 -0
  402. package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts +8 -0
  403. package/lib/types/features/store/objects/components/ContentOverview.d.ts +7 -0
  404. package/lib/types/features/store/objects/components/DocumentIcon.d.ts +10 -0
  405. package/lib/types/features/store/objects/components/DocumentInput.d.ts +7 -0
  406. package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +7 -0
  407. package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts +8 -0
  408. package/lib/types/features/store/objects/components/SelectDocument.d.ts +8 -0
  409. package/lib/types/features/store/objects/components/SelectDocumentModal.d.ts +8 -0
  410. package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts +10 -0
  411. package/lib/types/features/store/objects/components/index.d.ts +9 -0
  412. package/lib/types/features/store/objects/components/useDownloadObject.d.ts +3 -0
  413. package/lib/types/features/store/objects/index.d.ts +10 -0
  414. package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +16 -0
  415. package/lib/types/features/store/objects/layout/documentLayout.d.ts +17 -0
  416. package/lib/types/features/store/objects/layout/index.d.ts +2 -0
  417. package/lib/types/features/store/objects/layout/renderers.d.ts +2 -0
  418. package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +48 -0
  419. package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts +15 -0
  420. package/lib/types/features/store/objects/search/index.d.ts +2 -0
  421. package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts +25 -0
  422. package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts +27 -0
  423. package/lib/types/features/store/objects/selection/SelectionActions.d.ts +4 -0
  424. package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts +3 -0
  425. package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts +3 -0
  426. package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts +15 -0
  427. package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -0
  428. package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts +3 -0
  429. package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -0
  430. package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts +3 -0
  431. package/lib/types/features/store/objects/selection/actions/index.d.ts +7 -0
  432. package/lib/types/features/store/objects/selection/index.d.ts +4 -0
  433. package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts +37 -0
  434. package/lib/types/features/store/objects/upload/index.d.ts +3 -0
  435. package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts +29 -0
  436. package/lib/types/features/store/objects/upload/useUploadHandler.d.ts +49 -0
  437. package/lib/types/features/store/types/ContentObjectTypeView.d.ts +5 -0
  438. package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts +5 -0
  439. package/lib/types/features/store/types/ContentObjectTypesTable.d.ts +7 -0
  440. package/lib/types/features/store/types/ContentObjectTypesView.d.ts +8 -0
  441. package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts +14 -0
  442. package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +7 -0
  443. package/lib/types/features/store/types/SelectContentType.d.ts +10 -0
  444. package/lib/types/features/store/types/SelectContentTypeModal.d.ts +32 -0
  445. package/lib/types/features/store/types/TableLayoutEditor.d.ts +8 -0
  446. package/lib/types/features/store/types/index.d.ts +10 -0
  447. package/lib/types/features/store/types/search/ObjectTypeSearchContext.d.ts +35 -0
  448. package/lib/types/features/store/types/search/ObjectTypeSearchProvider.d.ts +10 -0
  449. package/lib/types/features/store/types/search/index.d.ts +2 -0
  450. package/lib/types/features/user/UserAvatar.d.ts +8 -0
  451. package/lib/types/features/user/UserInfo.d.ts +36 -0
  452. package/lib/types/features/user/index.d.ts +2 -0
  453. package/lib/types/features/utils/index.d.ts +3 -0
  454. package/lib/types/features/utils/mimeType.d.ts +4 -0
  455. package/lib/types/features/utils/rendition.d.ts +3 -0
  456. package/lib/types/features/utils/text.d.ts +2 -0
  457. package/lib/types/layout/Sidebar.d.ts +2 -1
  458. package/lib/types/widgets/Progress.d.ts +5 -0
  459. package/lib/types/widgets/form/schema.d.ts +4 -3
  460. package/lib/types/widgets/index.d.ts +4 -0
  461. package/lib/types/widgets/popover/Popover.d.ts +37 -0
  462. package/lib/types/widgets/popover/context.d.ts +7 -0
  463. package/lib/types/widgets/popover/index.d.ts +2 -0
  464. package/lib/types/widgets/popover/slots.d.ts +4 -0
  465. package/lib/types/widgets/properties/PropertiesView.d.ts +10 -0
  466. package/lib/types/widgets/properties/index.d.ts +1 -0
  467. package/lib/types/widgets/upload/DropZone.d.ts +40 -0
  468. package/lib/types/widgets/upload/UploadResultCategory.d.ts +25 -0
  469. package/lib/types/widgets/upload/UploadSummary.d.ts +37 -0
  470. package/lib/types/widgets/upload/index.d.ts +3 -0
  471. package/lib/vertesia-ui-core.js +1 -1
  472. package/lib/vertesia-ui-core.js.map +1 -1
  473. package/lib/vertesia-ui-features.js +1 -1
  474. package/lib/vertesia-ui-features.js.map +1 -1
  475. package/lib/vertesia-ui-layout.js +1 -1
  476. package/lib/vertesia-ui-layout.js.map +1 -1
  477. package/lib/vertesia-ui-router.js.map +1 -1
  478. package/lib/vertesia-ui-session.js.map +1 -1
  479. package/lib/vertesia-ui-widgets.js +1 -1
  480. package/lib/vertesia-ui-widgets.js.map +1 -1
  481. package/package.json +13 -5
  482. package/src/core/components/FormItem.tsx +35 -0
  483. package/src/core/components/InputList.tsx +4 -3
  484. package/src/core/components/index.ts +3 -3
  485. package/src/core/components/shadcn/button.tsx +68 -8
  486. package/src/core/components/shadcn/dialog.tsx +3 -3
  487. package/src/core/components/shadcn/filters/DynamicLabel.tsx +45 -0
  488. package/src/core/components/shadcn/filters/comboBox.tsx +56 -52
  489. package/src/core/components/shadcn/filters/dateFilter.tsx +24 -25
  490. package/src/core/components/shadcn/filters/filterBar.tsx +53 -47
  491. package/src/core/components/shadcn/filters/filters.tsx +43 -30
  492. package/src/core/components/shadcn/filters/selectFilter.tsx +53 -34
  493. package/src/core/components/shadcn/filters/textFilter.tsx +6 -3
  494. package/src/core/components/shadcn/filters/types.ts +8 -1
  495. package/src/core/components/shadcn/input.tsx +5 -5
  496. package/src/core/components/shadcn/selectBox.tsx +138 -33
  497. package/src/core/components/styles.ts +1 -1
  498. package/src/core/components/table/index.tsx +8 -0
  499. package/src/core/index.ts +2 -1
  500. package/src/core/utils/cn.ts +6 -0
  501. package/src/core/utils/index.ts +1 -0
  502. package/src/features/agent/PayloadBuilder.tsx +208 -0
  503. package/src/features/agent/chat/AnimatedThinkingDots.tsx +350 -0
  504. package/src/features/agent/chat/JumpingDots.tsx +16 -0
  505. package/src/features/agent/chat/ModernAgentConversation.tsx +708 -0
  506. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +246 -0
  507. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +231 -0
  508. package/src/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.tsx +66 -0
  509. package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +282 -0
  510. package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +125 -0
  511. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +562 -0
  512. package/src/features/agent/chat/ModernAgentOutput/MessagesContainer.tsx +51 -0
  513. package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +123 -0
  514. package/src/features/agent/chat/ModernAgentOutput/README-image-support.md +43 -0
  515. package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +72 -0
  516. package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +96 -0
  517. package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +185 -0
  518. package/src/features/agent/chat/ModernAgentOutput/StackedMessages.tsx +33 -0
  519. package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +167 -0
  520. package/src/features/agent/chat/ModernAgentOutput/utils.ts +195 -0
  521. package/src/features/agent/chat/ModernAgentOutput/with-types.d.ts +15 -0
  522. package/src/features/agent/chat/SlidingThinkingIndicator.tsx +459 -0
  523. package/src/features/agent/chat/WaitingMessages.ts +66 -0
  524. package/src/features/agent/chat/index.ts +4 -0
  525. package/src/features/agent/index.ts +2 -0
  526. package/src/features/errors/PanelErrorBoundary.tsx +30 -0
  527. package/src/features/errors/RowErrorBoundary.tsx +28 -0
  528. package/src/features/errors/VertesiaErrorBoundary.tsx +28 -0
  529. package/src/features/errors/WidgetErrorBoundary.tsx +27 -0
  530. package/src/features/errors/index.ts +4 -0
  531. package/src/features/facets/EnvironmentFacet.tsx +53 -0
  532. package/src/features/facets/FacetsNav.tsx +19 -0
  533. package/src/features/facets/InteractionFacet.tsx +53 -0
  534. package/src/features/facets/StringFacet.tsx +23 -0
  535. package/src/features/facets/StringListFacet.tsx +22 -0
  536. package/src/features/facets/TypeFacet.tsx +59 -0
  537. package/src/features/facets/TypeOptions.tsx +22 -0
  538. package/src/features/facets/UserFacet.tsx +61 -0
  539. package/src/features/facets/VFacetsNav.tsx +139 -0
  540. package/src/features/facets/VStringFacet.tsx +34 -0
  541. package/src/features/facets/VTypeFacet.tsx +72 -0
  542. package/src/features/facets/VUserFacet.tsx +47 -0
  543. package/src/features/facets/index.ts +11 -0
  544. package/src/features/facets/utils.tsx +9 -0
  545. package/src/features/index.ts +9 -1
  546. package/src/features/layout/GenericPageNavHeader.tsx +48 -0
  547. package/src/features/layout/NotFoundView.tsx +11 -0
  548. package/src/features/layout/index.ts +2 -0
  549. package/src/features/magic-pdf/DownloadPopover.tsx +32 -0
  550. package/src/features/magic-pdf/MagicPdfView.tsx +102 -0
  551. package/src/features/magic-pdf/PageSlider.tsx +112 -0
  552. package/src/features/magic-pdf/PdfPageProvider.tsx +229 -0
  553. package/src/features/magic-pdf/TextPageView.tsx +65 -0
  554. package/src/features/magic-pdf/index.ts +1 -0
  555. package/src/features/magic-pdf/types.ts +1 -0
  556. package/src/features/magic-pdf/useResizeOnDrag.ts +42 -0
  557. package/src/features/store/collections/BrowseCollectionView.tsx +45 -0
  558. package/src/features/store/collections/CollectionView.tsx +94 -0
  559. package/src/features/store/collections/CollectionsTable.tsx +115 -0
  560. package/src/features/store/collections/CollectionsView.tsx +166 -0
  561. package/src/features/store/collections/EditCollectionView.tsx +253 -0
  562. package/src/features/store/collections/index.ts +5 -0
  563. package/src/features/store/index.ts +3 -0
  564. package/src/features/store/objects/DocumentPreviewPanel.tsx +417 -0
  565. package/src/features/store/objects/DocumentSearchResults.tsx +209 -0
  566. package/src/features/store/objects/DocumentSelectionProvider.tsx +99 -0
  567. package/src/features/store/objects/DocumentTable.tsx +409 -0
  568. package/src/features/store/objects/ExportPropertiesModal.tsx +89 -0
  569. package/src/features/store/objects/components/ContentDispositionButton.tsx +45 -0
  570. package/src/features/store/objects/components/ContentOverview.tsx +466 -0
  571. package/src/features/store/objects/components/DocumentIcon.tsx +87 -0
  572. package/src/features/store/objects/components/DocumentInput.tsx +90 -0
  573. package/src/features/store/objects/components/PropertiesEditorModal.tsx +253 -0
  574. package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +136 -0
  575. package/src/features/store/objects/components/SelectDocument.tsx +69 -0
  576. package/src/features/store/objects/components/SelectDocumentModal.tsx +20 -0
  577. package/src/features/store/objects/components/VectorSearchWidget.tsx +115 -0
  578. package/src/features/store/objects/components/index.ts +9 -0
  579. package/src/features/store/objects/components/useDownloadObject.ts +24 -0
  580. package/src/features/store/objects/index.ts +10 -0
  581. package/src/features/store/objects/layout/DocumentTableColumn.tsx +84 -0
  582. package/src/features/store/objects/layout/documentLayout.tsx +69 -0
  583. package/src/features/store/objects/layout/index.ts +2 -0
  584. package/src/features/store/objects/layout/knowledge.md +238 -0
  585. package/src/features/store/objects/layout/renderers.tsx +139 -0
  586. package/src/features/store/objects/search/DocumentSearchContext.ts +181 -0
  587. package/src/features/store/objects/search/DocumentSearchProvider.tsx +54 -0
  588. package/src/features/store/objects/search/index.ts +2 -0
  589. package/src/features/store/objects/selection/ObjectsActionContext.tsx +196 -0
  590. package/src/features/store/objects/selection/ObjectsActionSpec.ts +31 -0
  591. package/src/features/store/objects/selection/SelectionActions.tsx +160 -0
  592. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +114 -0
  593. package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +76 -0
  594. package/src/features/store/objects/selection/actions/ConfirmAction.tsx +46 -0
  595. package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +77 -0
  596. package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +117 -0
  597. package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +77 -0
  598. package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +122 -0
  599. package/src/features/store/objects/selection/actions/index.ts +7 -0
  600. package/src/features/store/objects/selection/index.ts +4 -0
  601. package/src/features/store/objects/upload/DocumentUploadModal.tsx +970 -0
  602. package/src/features/store/objects/upload/index.ts +3 -0
  603. package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +250 -0
  604. package/src/features/store/objects/upload/useUploadHandler.ts +325 -0
  605. package/src/features/store/types/ContentObjectTypeView.tsx +244 -0
  606. package/src/features/store/types/ContentObjectTypesSearch.tsx +111 -0
  607. package/src/features/store/types/ContentObjectTypesTable.tsx +38 -0
  608. package/src/features/store/types/ContentObjectTypesView.tsx +71 -0
  609. package/src/features/store/types/CreateOrUpdateTypeModal.tsx +70 -0
  610. package/src/features/store/types/ObjectSchemaEditor.tsx +127 -0
  611. package/src/features/store/types/SelectContentType.tsx +88 -0
  612. package/src/features/store/types/SelectContentTypeModal.tsx +142 -0
  613. package/src/features/store/types/TableLayoutEditor.tsx +104 -0
  614. package/src/features/store/types/index.ts +10 -0
  615. package/src/features/store/types/search/ObjectTypeSearchContext.tsx +119 -0
  616. package/src/features/store/types/search/ObjectTypeSearchProvider.tsx +24 -0
  617. package/src/features/store/types/search/index.ts +2 -0
  618. package/src/features/user/UserAvatar.tsx +34 -0
  619. package/src/features/user/UserInfo.tsx +215 -0
  620. package/src/features/user/index.ts +2 -0
  621. package/src/features/utils/index.ts +3 -0
  622. package/src/features/utils/mimeType.ts +9 -0
  623. package/src/features/utils/rendition.ts +75 -0
  624. package/src/features/utils/text.ts +10 -0
  625. package/src/layout/FullHeightLayout.tsx +1 -1
  626. package/src/layout/Sidebar.tsx +12 -2
  627. package/src/widgets/Progress.tsx +10 -0
  628. package/src/widgets/codemirror/CodeMirrorEditor.tsx +1 -1
  629. package/src/widgets/form/Form.tsx +2 -2
  630. package/src/widgets/form/schema.ts +14 -7
  631. package/src/widgets/index.ts +5 -1
  632. package/src/widgets/popover/Popover.tsx +171 -0
  633. package/src/widgets/popover/context.ts +15 -0
  634. package/src/widgets/popover/index.ts +2 -0
  635. package/src/widgets/popover/slots.ts +24 -0
  636. package/src/widgets/properties/PropertiesView.tsx +26 -0
  637. package/src/widgets/properties/index.ts +1 -0
  638. package/src/widgets/schema-editor/JSONSchemaEditorModal.tsx +1 -2
  639. package/src/widgets/schema-editor/editor/Editable.tsx +12 -13
  640. package/src/widgets/schema-editor/editor/PropertyViewer.tsx +1 -1
  641. package/src/widgets/schema-editor/editor/SchemaEditor.tsx +4 -4
  642. package/src/widgets/upload/DropZone.tsx +257 -0
  643. package/src/widgets/upload/UploadResultCategory.tsx +81 -0
  644. package/src/widgets/upload/UploadSummary.tsx +116 -0
  645. package/src/widgets/upload/index.ts +3 -0
  646. package/lib/esm/code/index.js +0 -3
  647. package/lib/esm/code/index.js.map +0 -1
  648. package/lib/esm/core/components/Input.js +0 -16
  649. package/lib/esm/core/components/Input.js.map +0 -1
  650. package/lib/esm/form/index.js +0 -3
  651. package/lib/esm/form/index.js.map +0 -1
  652. package/lib/types/code/index.d.ts +0 -0
  653. package/lib/types/core/components/Input.d.ts +0 -8
  654. package/lib/types/form/index.d.ts +0 -0
  655. package/lib/vertesia-ui-code.js +0 -2
  656. package/lib/vertesia-ui-code.js.map +0 -1
  657. package/lib/vertesia-ui-form.js +0 -2
  658. package/lib/vertesia-ui-form.js.map +0 -1
  659. package/src/code/index.ts +0 -1
  660. package/src/core/components/Input.tsx +0 -43
  661. package/src/form/index.ts +0 -1
@@ -0,0 +1,161 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { json } from "@codemirror/lang-json";
3
+ import { Button, ErrorBox, FormItem, Input, Styles, useFetch, useToast } from "@vertesia/ui/core";
4
+ import { useUserSession } from "@vertesia/ui/session";
5
+ import { CodeMirrorEditor, GeneratedForm, ManagedObject } from "@vertesia/ui/widgets";
6
+ import { basicSetup } from "codemirror";
7
+ import { useMemo, useRef, useState } from "react";
8
+ import { SelectContentType, stringifyTableLayout } from "../../store";
9
+ const extensions = [basicSetup, json()];
10
+ export function EditCollectionView({ refetch, collection }) {
11
+ const typeId = collection.type?.id;
12
+ const tableLayoutRef = useRef(undefined);
13
+ const toast = useToast();
14
+ const { client } = useUserSession();
15
+ const [isUpdating, setUpdating] = useState(false);
16
+ const [metadata, setMetadata] = useState({
17
+ name: collection.name,
18
+ description: collection.description || "",
19
+ query: collection.query ? JSON.stringify(collection.query, null, 2) : "",
20
+ tags: collection.tags || [],
21
+ type: collection.type?.id || "",
22
+ allowed_types: collection.allowed_types || [],
23
+ });
24
+ const tableLayoutValue = useMemo(() => {
25
+ return stringifyTableLayout(collection.table_layout);
26
+ }, [collection.table_layout]);
27
+ const onSubmit = () => {
28
+ const query = metadata.query ? JSON.parse(metadata.query) : undefined;
29
+ const payload = {
30
+ name: metadata.name,
31
+ description: metadata.description,
32
+ query: query,
33
+ tags: metadata.tags,
34
+ type: metadata.type,
35
+ allowed_types: metadata.allowed_types,
36
+ };
37
+ let error;
38
+ if (!payload.name) {
39
+ error = "Name is required";
40
+ }
41
+ if (!payload.type) {
42
+ payload.type = null;
43
+ }
44
+ if (error) {
45
+ toast({
46
+ title: "Validation failed",
47
+ description: error,
48
+ status: "error",
49
+ duration: 5000,
50
+ });
51
+ }
52
+ if (tableLayoutRef.current) {
53
+ const layout = tableLayoutRef.current.getValue();
54
+ if (layout) {
55
+ try {
56
+ payload.table_layout = JSON.parse(layout);
57
+ }
58
+ catch (err) {
59
+ toast({
60
+ title: "Invalid Table Layout",
61
+ description: err.message,
62
+ status: "error",
63
+ duration: 5000,
64
+ });
65
+ return;
66
+ }
67
+ }
68
+ else {
69
+ payload.table_layout = null;
70
+ }
71
+ }
72
+ setUpdating(true);
73
+ client.store.collections
74
+ .update(collection.id, payload)
75
+ .then(() => {
76
+ refetch();
77
+ toast({
78
+ title: "Collection updated",
79
+ description: "Collection has been updated successfully",
80
+ status: "success",
81
+ duration: 3000,
82
+ });
83
+ })
84
+ .catch((err) => {
85
+ toast({
86
+ title: "Failed to update collection",
87
+ description: err.message,
88
+ status: "error",
89
+ duration: 5000,
90
+ });
91
+ })
92
+ .finally(() => {
93
+ setUpdating(false);
94
+ });
95
+ };
96
+ const setField = (name, value) => {
97
+ setMetadata({
98
+ ...metadata,
99
+ [name]: value,
100
+ });
101
+ };
102
+ return (_jsxs("div", { className: "flex flex-col gap-4 py-2", children: [_jsx(FormItem, { label: "Name", required: true, children: _jsx(Input, { value: metadata.name, onChange: (v) => setField("name", v) }) }), _jsx(FormItem, { label: "Description", children: _jsx("textarea", { className: Styles.INPUT, value: metadata.description, onChange: (e) => setField("description", e.target.value) }) }), collection.dynamic && (_jsx(FormItem, { label: "Query", description: "Define the query to fetch dynamic content for this collection.", children: _jsx("textarea", { className: Styles.INPUT, value: metadata.query, onChange: (e) => setField("query", e.target.value) }) })), _jsx(FormItem, { label: "Table Layout", description: "Define how the collection should be displayed in tables.", children: _jsx(CodeMirrorEditor, { className: "border-1 rounded-md border-border", value: tableLayoutValue, extensions: extensions, editorRef: tableLayoutRef }) }), _jsx(FormItem, { label: "Type", children: _jsx(SelectContentType, { defaultValue: metadata.type || null, onChange: (v) => {
103
+ if (Array.isArray(v)) {
104
+ setField("type", v.length > 0 ? v[0].id : null);
105
+ }
106
+ else {
107
+ setField("type", v?.id || null);
108
+ }
109
+ }, isClearable: true }) }), _jsx(FormItem, { label: "Allowed Content Types", children: _jsx(SelectContentType, { defaultValue: metadata.allowed_types || null, onChange: (v) => {
110
+ if (Array.isArray(v)) {
111
+ setField("allowed_types", v.map(type => type.id));
112
+ }
113
+ else {
114
+ setField("allowed_types", v ? [v.id] : []);
115
+ }
116
+ }, isClearable: true, multiple: true }) }), _jsx(Button, { size: "lg", className: "w-min my-4", isDisabled: isUpdating, onClick: onSubmit, children: "Save Metadata" }), typeId && _jsx(PropertiesEditor, { typeId: typeId, collection: collection })] }));
117
+ }
118
+ function PropertiesEditor({ typeId, collection }) {
119
+ const { client } = useUserSession();
120
+ const { data: type, error } = useFetch(() => client.store.types.retrieve(typeId), [typeId]);
121
+ if (error) {
122
+ return _jsx(ErrorBox, { title: "Failed to load type", children: error.message });
123
+ }
124
+ return (_jsx(Section, { title: "Properties", children: type && _jsx(PropertiesForm, { collection: collection, schema: type.object_schema }) }));
125
+ }
126
+ function PropertiesForm({ schema = {}, collection }) {
127
+ const { client } = useUserSession();
128
+ const toast = useToast();
129
+ const object = useMemo(() => new ManagedObject(schema, collection.properties || {}), [schema, collection]);
130
+ const [isUpdating, setIsUpdating] = useState(false);
131
+ const _onSave = (data) => {
132
+ const payload = { properties: data || {} };
133
+ setIsUpdating(true);
134
+ client.store.collections
135
+ .update(collection.id, payload)
136
+ .then(() => {
137
+ toast({
138
+ title: "Collection properties updated",
139
+ description: "Collection has been updated successfully",
140
+ status: "success",
141
+ duration: 3000,
142
+ });
143
+ })
144
+ .catch((err) => {
145
+ toast({
146
+ title: "Failed to update collection properties",
147
+ description: err.message,
148
+ status: "error",
149
+ duration: 5000,
150
+ });
151
+ })
152
+ .finally(() => {
153
+ setIsUpdating(false);
154
+ });
155
+ };
156
+ return (_jsx(GeneratedForm, { object: object, onSubmit: _onSave, children: _jsx(Button, { size: "lg", isLoading: isUpdating, className: "my-4", variant: "primary", type: "submit", children: "Save Properties" }) }));
157
+ }
158
+ function Section({ children, title }) {
159
+ return (_jsxs("div", { className: "my-4", children: [_jsx("div", { className: "text-lg text-gray-700 font-semibold border-b border-b-gray-300 py-2 mb-4", children: title }), children] }));
160
+ }
161
+ //# sourceMappingURL=EditCollectionView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditCollectionView.js","sourceRoot":"","sources":["../../../../../src/features/store/collections/EditCollectionView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,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AAO;gBACxB,MAAM,EAAE,OAAO;gBACf,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;QACP,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACV,aAAa,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC;IACX,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,aAAa,IAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,YAC5C,KAAC,MAAM,IAAC,IAAI,EAAC,IAAI,EAAC,SAAS,EAAE,UAAU,EAAE,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,QAAQ,gCAEhF,GACG,CACnB,CAAC;AACN,CAAC;AAMD,SAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAgB;IAC9C,OAAO,CACH,eAAK,SAAS,EAAC,MAAM,aACjB,cAAK,SAAS,EAAC,0EAA0E,YAAE,KAAK,GAAO,EACtG,QAAQ,IACP,CACT,CAAC;AACN,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from "./BrowseCollectionView";
2
+ export * from "./CollectionsTable";
3
+ export * from "./CollectionsView";
4
+ export * from "./CollectionView";
5
+ export * from "./EditCollectionView";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/features/store/collections/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./objects";
2
+ export * from "./types";
3
+ export * from "./collections";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/features/store/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ImageRenditionFormat } from "@vertesia/common";
3
+ import { Button, Spinner, useToast } from "@vertesia/ui/core";
4
+ import { useNavigate } from "@vertesia/ui/router";
5
+ import { useUserSession } from "@vertesia/ui/session";
6
+ import { JSONDisplay } from "@vertesia/ui/widgets";
7
+ import { ChevronRight, Download, FileText, Info, LayoutGrid, Maximize2, X, } from "lucide-react";
8
+ import { useEffect, useState } from "react";
9
+ import Markdown from "react-markdown";
10
+ import remarkGfm from "remark-gfm";
11
+ export function DocumentPreviewPanel({ objectId, isOpen, onClose, }) {
12
+ const navigate = useNavigate();
13
+ const { client, store } = useUserSession();
14
+ const [object, setObject] = useState(null);
15
+ const [isLoading, setIsLoading] = useState(false);
16
+ const [loadingText, setLoadingText] = useState(false);
17
+ const [text, setText] = useState();
18
+ const [imageUrl, setImageUrl] = useState();
19
+ const [currentTab, setCurrentTab] = useState("preview");
20
+ const toast = useToast();
21
+ useEffect(() => {
22
+ if (objectId && isOpen) {
23
+ setIsLoading(true);
24
+ store.objects
25
+ .retrieve(objectId, "+embeddings")
26
+ .then((result) => {
27
+ setObject(result);
28
+ // If the object has text, use it
29
+ if (result.text) {
30
+ setText(result.text);
31
+ }
32
+ else {
33
+ // Otherwise, fetch text
34
+ loadObjectText(result.id);
35
+ }
36
+ // If it's an image, load the image URL
37
+ const content = result.content;
38
+ const isImage = content &&
39
+ content.source &&
40
+ content.type &&
41
+ content.type.startsWith("image/");
42
+ if (isImage) {
43
+ loadImageUrl(result);
44
+ }
45
+ })
46
+ .catch((error) => {
47
+ console.error("Error loading object:", error);
48
+ toast({
49
+ title: "Error",
50
+ description: "Failed to load document",
51
+ status: "error",
52
+ duration: 3000,
53
+ });
54
+ })
55
+ .finally(() => {
56
+ setIsLoading(false);
57
+ });
58
+ }
59
+ else {
60
+ // Reset state when panel closes
61
+ setObject(null);
62
+ setText(undefined);
63
+ setImageUrl(undefined);
64
+ }
65
+ }, [objectId, isOpen, store.objects]);
66
+ const loadObjectText = async (id) => {
67
+ setLoadingText(true);
68
+ try {
69
+ const result = await store.objects.getObjectText(id);
70
+ setText(result.text);
71
+ }
72
+ catch (error) {
73
+ console.error("Error loading text:", error);
74
+ }
75
+ finally {
76
+ setLoadingText(false);
77
+ }
78
+ };
79
+ const loadImageUrl = async (obj) => {
80
+ try {
81
+ // Try to get a rendition first
82
+ const rendition = await client.objects.getRendition(obj.id, {
83
+ max_hw: 1024,
84
+ format: ImageRenditionFormat.jpeg,
85
+ generate_if_missing: false,
86
+ });
87
+ // Don't use rendition object to avoid type issues
88
+ if (rendition.status === "found") {
89
+ console.log("Found rendition");
90
+ }
91
+ // Get download URL
92
+ const downloadUrlResult = await client.files.getDownloadUrl(obj.content.source);
93
+ setImageUrl(downloadUrlResult.url);
94
+ }
95
+ catch (error) {
96
+ console.error("Error loading image:", error);
97
+ }
98
+ };
99
+ const handleViewFullDocument = () => {
100
+ if (object) {
101
+ navigate(`/legal/objects/${object.id}`);
102
+ onClose();
103
+ }
104
+ };
105
+ const seemsMarkdown = text &&
106
+ (text.startsWith("#") || text.includes("\n#") || text.includes("\n*"));
107
+ const isImage = object?.content?.type && object.content.type.startsWith("image/");
108
+ const isPdf = object?.content?.type === "application/pdf";
109
+ if (!isOpen)
110
+ return null;
111
+ return (_jsxs("div", { className: `fixed inset-y-0 right-0 w-2/5 dark:bg-slate-900 shadow-xl z-50 flex flex-col transition-transform duration-300 transform ${isOpen ? "translate-x-0" : "translate-x-full"}`, children: [_jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-b dark:border-gray-700 bg-gradient-to-r from-indigo-50 to-gray-50 dark:from-gray-800 dark:to-gray-900", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(FileText, { className: "h-5 w-5 text-indigo-600 mr-2" }), _jsx("h2", { className: "text-lg font-semibold text-gray-800 dark:text-gray-200 truncate", children: isLoading
112
+ ? "Loading document..."
113
+ : object?.name || "Document Preview" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsxs(Button, { variant: "ghost", size: "sm", onClick: handleViewFullDocument, className: "flex items-center gap-1 text-indigo-600 hover:text-indigo-800", children: [_jsx(Maximize2, { className: "h-4 w-4" }), _jsx("span", { children: "Full View" })] }), _jsx(Button, { variant: "ghost", size: "sm", onClick: onClose, className: "flex items-center text-gray-600 hover:text-gray-800 dark:text-gray-300 dark:hover:text-gray-100", children: _jsx(X, { className: "h-5 w-5" }) })] })] }), isLoading ? (_jsx("div", { className: "flex-1 flex items-center justify-center", children: _jsxs("div", { className: "text-center", children: [_jsx(Spinner, { size: "lg", className: "text-indigo-600 dark:text-indigo-400 mb-2" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading document..." })] }) })) : (_jsxs("div", { className: "flex-1 flex flex-col h-full", children: [_jsx("div", { className: "border-b", children: _jsxs("div", { className: "flex px-4", children: [_jsx("button", { className: `py-2 px-4 font-medium border-b-2 ${currentTab === "preview"
114
+ ? "border-indigo-600 text-indigo-700 dark:text-indigo-300"
115
+ : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`, onClick: () => setCurrentTab("preview"), children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(LayoutGrid, { className: "h-4 w-4" }), _jsx("span", { children: "Preview" })] }) }), _jsx("button", { className: `py-2 px-4 font-medium border-b-2 ${currentTab === "properties"
116
+ ? "border-indigo-600 text-indigo-700 dark:text-indigo-300"
117
+ : "border-transparent text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`, onClick: () => setCurrentTab("properties"), children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Info, { className: "h-4 w-4" }), _jsx("span", { children: "Properties" })] }) })] }) }), _jsxs("div", { className: "flex-1 overflow-auto p-4", children: [currentTab === "preview" && (_jsxs("div", { className: "h-full", children: [loadingText ? (_jsx("div", { className: "flex items-center justify-center h-40", children: _jsx(Spinner, { size: "md", className: "text-indigo-600 dark:text-indigo-400" }) })) : text ? (_jsx("div", { className: "shadow rounded-md p-4 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800", children: seemsMarkdown ? (_jsx("div", { className: "prose prose-sm max-w-none prose-p:my-2 prose-pre:bg-gray-800 prose-pre:my-2 prose-headings:text-indigo-700 dark:prose-invert dark:prose-headings:text-indigo-300", children: _jsx(Markdown, { remarkPlugins: [remarkGfm], children: text }) })) : (_jsx("pre", { className: "text-wrap whitespace-pre-wrap dark:text-gray-200", children: text })) })) : null, isImage && (_jsx("div", { className: "mt-4", children: imageUrl ? (_jsx("div", { className: "border border-gray-200 dark:border-gray-700 rounded-md p-2 bg-white dark:bg-gray-800", children: _jsx("img", { src: imageUrl, alt: object?.name, className: "mx-auto max-h-[70vh] object-contain" }) })) : (_jsx("div", { className: "flex items-center justify-center h-40", children: _jsx(Spinner, { size: "md", className: "text-indigo-600 dark:text-indigo-400" }) })) })), isPdf && (_jsxs("div", { className: "flex flex-col items-center justify-center h-64 border border-gray-200 dark:border-gray-700 rounded-md p-4 bg-gray-50 dark:bg-gray-800", children: [_jsx(FileText, { className: "h-16 w-16 text-indigo-300 dark:text-indigo-400 mb-4" }), _jsxs("p", { className: "text-gray-600 dark:text-gray-400 text-center mb-4", children: ["PDF document preview is available in full view. TODO", " "] }), _jsx(Button, { onClick: handleViewFullDocument, className: "bg-indigo-600 hover:bg-indigo-700 text-white", children: "Open Full Document View" })] })), !isImage && !text && !isPdf && !loadingText && (_jsxs("div", { className: "flex flex-col items-center justify-center h-64 border border-gray-200 dark:border-gray-700 rounded-md p-4 bg-gray-50 dark:bg-gray-800", children: [_jsx(FileText, { className: "h-16 w-16 text-gray-300 dark:text-gray-600 mb-4" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400 text-center", children: "No preview available for this document type." })] }))] })), currentTab === "properties" && object && (_jsxs("div", { className: "h-full", children: [object.properties ? (_jsx("div", { className: "shadow rounded-md p-4 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800", children: _jsx(JSONDisplay, { value: object.properties }) })) : (_jsxs("div", { className: "flex flex-col items-center justify-center h-64 border border-gray-200 dark:border-gray-700 rounded-md p-4 bg-gray-50 dark:bg-gray-800", children: [_jsx(Info, { className: "h-16 w-16 text-gray-300 dark:text-gray-600 mb-4" }), _jsx("p", { className: "text-gray-600 dark:text-gray-400 text-center", children: "No properties available for this document." })] })), _jsxs("div", { className: "mt-4", children: [_jsx("h3", { className: "text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2", children: "Document Information" }), _jsx("div", { className: "shadow rounded-md p-4 border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800", children: _jsxs("div", { className: "grid grid-cols-2 gap-y-2 gap-x-4 text-sm", children: [_jsx("div", { className: "text-gray-500 dark:text-gray-400", children: "ID" }), _jsx("div", { className: "font-medium dark:text-gray-200", children: object.id }), _jsx("div", { className: "text-gray-500 dark:text-gray-400", children: "Type" }), _jsx("div", { className: "font-medium dark:text-gray-200", children: object.type?.name || "Unknown" }), _jsx("div", { className: "text-gray-500 dark:text-gray-400", children: "Content Type" }), _jsx("div", { className: "font-medium dark:text-gray-200", children: object.content?.type || "N/A" }), _jsx("div", { className: "text-gray-500", children: "Size" }), _jsx("div", { className: "font-medium", children: object.content && "size" in object.content
118
+ ? formatFileSize(object.content.size)
119
+ : "Unknown" }), _jsx("div", { className: "text-gray-500", children: "Created" }), _jsx("div", { className: "font-medium", children: object.created_at
120
+ ? new Date(object.created_at).toLocaleString()
121
+ : "N/A" }), _jsx("div", { className: "text-gray-500", children: "Updated" }), _jsx("div", { className: "font-medium", children: object.updated_at
122
+ ? new Date(object.updated_at).toLocaleString()
123
+ : "N/A" })] }) })] })] }))] })] })), _jsxs("div", { className: "flex items-center justify-between p-4 border-t bg-gray-50 dark:bg-gray-800 dark:border-gray-700", children: [_jsx("div", { children: object?.content?.source && (_jsxs(Button, { onClick: () => {
124
+ if (object?.content?.source) {
125
+ client.files
126
+ .getDownloadUrl(object.content.source)
127
+ .then((result) => {
128
+ window.open(result.url, "_blank");
129
+ })
130
+ .catch((error) => {
131
+ console.error("Error getting download URL:", error);
132
+ toast({
133
+ title: "Error",
134
+ description: "Failed to download file",
135
+ status: "error",
136
+ duration: 3000,
137
+ });
138
+ });
139
+ }
140
+ }, variant: "outline", className: "text-indigo-600 border-indigo-300 hover:bg-indigo-50", children: [_jsx(Download, { className: "h-4 w-4 mr-2" }), "Download"] })) }), _jsxs(Button, { onClick: handleViewFullDocument, className: "bg-indigo-600 hover:bg-indigo-700 text-white", children: ["Open Full Document", _jsx(ChevronRight, { className: "h-4 w-4 ml-2" })] })] })] }));
141
+ }
142
+ function formatFileSize(bytes) {
143
+ if (bytes === 0)
144
+ return "0 Bytes";
145
+ const k = 1024;
146
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
147
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
148
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
149
+ }
150
+ //# sourceMappingURL=DocumentPreviewPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentPreviewPanel.js","sourceRoot":"","sources":["../../../../../src/features/store/objects/DocumentPreviewPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,SAAS,EACT,CAAC,GACF,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS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EpD,OAAO,UAAU,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { Button, Divider, ErrorBox, SidePanel, Spinner, useDebounce, useIntersectionObserver, useToast } from '@vertesia/ui/core';
4
+ import { useNavigate } from "@vertesia/ui/router";
5
+ import { useUserSession } from '@vertesia/ui/session';
6
+ import { Download, RefreshCw, SquareArrowOutUpRight } from 'lucide-react';
7
+ import { VFacetsNav } from "../../facets";
8
+ import { VectorSearchWidget } from './components/VectorSearchWidget';
9
+ import { ContentDispositionButton, DocumentTable, useDocumentSearch, useDocumentUploadHandler, useWatchDocumentSearchFacets, useWatchDocumentSearchResult } from "../../store";
10
+ import { ContentOverview } from './components/ContentOverview';
11
+ import { useDownloadDocument } from './components/useDownloadObject';
12
+ const defaultLayout = [
13
+ { name: "ID", field: "id", type: "string?slice=-7" },
14
+ { name: "Name", field: ".", type: "objectLink" },
15
+ { name: "Type", field: "type.name", type: "string" },
16
+ { name: "Status", field: "status", type: "string" },
17
+ { name: "Updated At", field: "updated_at", type: "date" },
18
+ ];
19
+ function getTableLayout(registry, type) {
20
+ const layout = type ? registry.getTypeLayout(type) : defaultLayout;
21
+ return layout ?? defaultLayout;
22
+ }
23
+ export function DocumentSearchResultsWithDropZone({ onUploadDone = async () => { }, layout }) {
24
+ const search = useDocumentSearch();
25
+ const toast = useToast();
26
+ // Create a wrapper around the onUploadDone callback that also refreshes the search
27
+ const handleUploadDone = async (objectIds) => {
28
+ // First, call the original callback
29
+ await onUploadDone(objectIds);
30
+ // Use a timeout to let the backend catch up, then refresh the search results
31
+ setTimeout(() => {
32
+ console.log('Delayed refresh after upload to ensure backend consistency');
33
+ search.search().then(() => {
34
+ // Notify the user that the list has been refreshed
35
+ toast({
36
+ title: "Document list refreshed",
37
+ description: "The document list has been updated with your uploaded files.",
38
+ status: "info",
39
+ duration: 3000,
40
+ });
41
+ }).catch(err => {
42
+ console.error('Failed to refresh search results:', err);
43
+ });
44
+ }, 1000); // 1-second delay for backend processing
45
+ };
46
+ // Use the enhanced standard upload handler with smart processing
47
+ const uploadHandler = useDocumentUploadHandler(handleUploadDone);
48
+ // Wrap the uploadHandler to ensure the collectionId is passed
49
+ const wrappedUploadHandler = (files, type) => {
50
+ // Get the collection ID from the search context
51
+ const collectionId = search.collectionId;
52
+ return uploadHandler(files, type, collectionId);
53
+ };
54
+ return _jsx(DocumentSearchResults, { layout: layout, onUpload: wrappedUploadHandler });
55
+ }
56
+ export function DocumentSearchResults({ layout, onUpload, allowFilter = true, allowSearch = true }) {
57
+ // Get the search context to access collectionId
58
+ const searchContext = useDocumentSearch();
59
+ const [isReady, setIsReady] = useState(false);
60
+ const [selectedObject, setSelectedObject] = useState(null);
61
+ const { typeRegistry } = useUserSession();
62
+ const { search, isLoading, error, objects } = useWatchDocumentSearchResult();
63
+ const [vQuery, setVQuery] = useState(undefined);
64
+ const [actualLayout, setActualLayout] = useState(typeRegistry ? layout || getTableLayout(typeRegistry, search.query.type) : defaultLayout);
65
+ //TODO _setRefreshTrigger state not used
66
+ const [refreshTrigger, _setRefreshTrigger] = useState(0);
67
+ const [loaded, setLoaded] = useState(0);
68
+ const [isGridView, setIsGridView] = useState(localStorage.getItem(ContentDispositionButton.LAST_DISPLAYED_VIEW) === "grid");
69
+ const loadMoreRef = useRef(null);
70
+ useIntersectionObserver(loadMoreRef, () => {
71
+ if (isReady && objects.length > 0 && objects.length != loaded) {
72
+ setIsReady(false);
73
+ search.loadMore().finally(() => {
74
+ setLoaded(objects.length);
75
+ setIsReady(true);
76
+ });
77
+ }
78
+ }, { deps: [isReady, objects.length] });
79
+ useEffect(() => {
80
+ search.search().then(() => setIsReady(true));
81
+ }, []);
82
+ //TODO _setSearchTerm state not used
83
+ const [searchTerm, _setSearchTerm] = useState("");
84
+ const debounceValue = useDebounce(searchTerm, 500);
85
+ useEffect(() => {
86
+ search.query.name = searchTerm;
87
+ search.search().then(() => setIsReady(true));
88
+ }, [debounceValue]);
89
+ useEffect(() => {
90
+ if (vQuery) {
91
+ search.query.vector = vQuery;
92
+ if (!actualLayout.find((c) => c.name === "Vector Similarity")) {
93
+ const layout = [
94
+ ...actualLayout,
95
+ {
96
+ name: "Vector Similarity",
97
+ field: "score",
98
+ },
99
+ ];
100
+ setActualLayout(layout);
101
+ }
102
+ search.search().then(() => setIsReady(true));
103
+ }
104
+ else {
105
+ delete search.query.vector;
106
+ search.search().then(() => setIsReady(true));
107
+ }
108
+ }, [vQuery?.values]);
109
+ const facets = useWatchDocumentSearchFacets();
110
+ const facetSearch = useDocumentSearch();
111
+ const handleRefetch = () => {
112
+ search.search().then(() => setIsReady(true));
113
+ };
114
+ return (_jsxs("div", { className: "flex flex-col gap-y-2", children: [_jsx(OverviewDrawer, { object: selectedObject, onClose: () => setSelectedObject(null) }), error && _jsx(ErrorBox, { title: "Error", children: error.message }), _jsxs("div", { className: "flex flex-row gap-4 items-center justify-between w-full", children: [allowSearch && _jsx(VectorSearchWidget, { onChange: setVQuery, isLoading: isLoading, refresh: refreshTrigger }), _jsxs("div", { className: "flex gap-1 items-center", children: [_jsx(Button, { variant: "outline", onClick: handleRefetch, alt: "Refresh", children: _jsx(RefreshCw, { size: 16 }) }), _jsx(ContentDispositionButton, { onUpdate: setIsGridView })] })] }), allowFilter && _jsx(VFacetsNav, { facets: facets, search: facetSearch, textSearch: "Name or ID" }), _jsx(DocumentTable, { objects: objects, isLoading: !objects.length && isLoading, layout: actualLayout, onRowClick: setSelectedObject, onUpload: onUpload, isGridView: isGridView, collectionId: searchContext.collectionId }), isLoading && _jsx("div", { className: 'flex justify-center', children: _jsx(Spinner, { size: 'xl' }) }), _jsx("div", { ref: loadMoreRef })] }));
115
+ }
116
+ function OverviewDrawer({ object, onClose }) {
117
+ const { store } = useUserSession();
118
+ const toast = useToast();
119
+ const navigate = useNavigate();
120
+ const onDownload = useDownloadDocument(store, toast, object?.content?.source);
121
+ return object ? (_jsxs(SidePanel, { title: object.properties?.title || object.name, isOpen: true, onClose: onClose, children: [_jsxs("div", { className: "flex items-center gap-x-2", children: [_jsx(Button, { variant: "ghost", size: "sm", title: "Open Object", onClick: () => navigate(`/objects/${object.id}`), children: _jsx(SquareArrowOutUpRight, { className: "size-4" }) }), object.content?.source && (_jsx(Button, { variant: "ghost", size: "sm", title: "Download", onClick: onDownload, children: _jsx(Download, { className: "size-4" }) }))] }), _jsx(Divider, { className: "my-2" }), _jsx("div", { className: "pt-2", children: _jsx(ContentOverview, { object: object, loadText: true }) })] })) : null;
122
+ }
123
+ //# sourceMappingURL=DocumentSearchResults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentSearchResults.js","sourceRoot":"","sources":["../../../../../src/features/store/objects/DocumentSearchResults.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAgB,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,iBAAiB,EAAE,wBAAwB,E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M,GAAG,EAC5B,cAAK,SAAS,EAAC,MAAM,YACjB,KAAC,eAAe,IAAC,MAAM,EAAE,MAAkC,EAAE,QAAQ,SAAG,GACtE,IACE,CACf,CAAC,CAAC,CAAC,IAAI,CAAC;AACb,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useState } from "react";
3
+ export class DocumentSelection {
4
+ object;
5
+ objects;
6
+ setState;
7
+ /**
8
+ * The collection id to which the selected objects belong to.
9
+ */
10
+ collectionId;
11
+ singleSelection = false;
12
+ constructor(object, collectionId, objects, setState) {
13
+ this.object = object;
14
+ this.objects = objects;
15
+ this.setState = setState;
16
+ this.singleSelection = Object.keys(this.objects).length === 0;
17
+ this.collectionId = collectionId;
18
+ }
19
+ isSingleSelection() {
20
+ return this.singleSelection;
21
+ }
22
+ hasSelection() {
23
+ return this.object !== undefined || this.size() !== 0;
24
+ }
25
+ size() {
26
+ return Object.keys(this.objects).length;
27
+ }
28
+ getObjectIds() {
29
+ return Object.keys(this.objects);
30
+ }
31
+ getObjectId() {
32
+ return this.object?.id;
33
+ }
34
+ clone() {
35
+ return new DocumentSelection(this.object, this.collectionId, this.objects, this.setState);
36
+ }
37
+ add(object) {
38
+ this.objects[object.id] = object;
39
+ this.singleSelection = Object.keys(this.objects).length === 0;
40
+ this.setState(this.clone());
41
+ }
42
+ remove(objectId) {
43
+ delete this.objects[objectId];
44
+ this.singleSelection = Object.keys(this.objects).length === 0;
45
+ this.setState(this.clone());
46
+ }
47
+ addAll(objects) {
48
+ for (const obj of objects) {
49
+ this.objects[obj.id] = obj;
50
+ }
51
+ this.setState(this.clone());
52
+ }
53
+ isSelected(objectId) {
54
+ return this.objects[objectId] !== undefined;
55
+ }
56
+ removeAll() {
57
+ this.objects = {};
58
+ this.singleSelection = true;
59
+ this.setState(this.clone());
60
+ }
61
+ }
62
+ const DocumentSelectionContext = createContext(undefined);
63
+ export function useDocumentSelection() {
64
+ const selection = useContext(DocumentSelectionContext);
65
+ if (!selection) {
66
+ throw new Error("useObjectSelection must be used within a ObjectSelectionProvider");
67
+ }
68
+ return selection;
69
+ }
70
+ export function useOptionalDocumentSelection() {
71
+ return useContext(DocumentSelectionContext);
72
+ }
73
+ export function DocumentSelectionProvider({ value, collectionId, children }) {
74
+ const [selection, setSelection] = useState();
75
+ useEffect(() => {
76
+ const selection = new DocumentSelection(value, collectionId, {}, setSelection);
77
+ setSelection(selection);
78
+ }, [value]);
79
+ return selection && (_jsx(DocumentSelectionContext.Provider, { value: selection, children: children }));
80
+ }
81
+ //# sourceMappingURL=DocumentSelectionProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DocumentSelectionProvider.js","sourceRoot":"","sources":["../../../../../src/features/store/objects/DocumentSelectionProvider.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvE,MAAM,OAAO,iBAAiB;IAQP;IAAgF;IAAoD;IAPvJ;;OAEG;IACH,YAAY,CAAsB;IAElC,eAAe,GAAG,KAAK,CAAC;IAExB,YAAmB,MAAqC,EAAE,YAAgC,EAAS,OAA0C,EAAU,QAAgD;QAApL,WAAM,GAAN,MAAM,CAA+B;QAA2C,YAAO,GAAP,OAAO,CAAmC;QAAU,aAAQ,GAAR,QAAQ,CAAwC;QACnM,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACrC,CAAC;IAED,iBAAiB;QACb,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED,YAAY;QACR,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI;QACA,OAAO,MAA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