@vertesia/ui 0.59.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,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { ContentObjectTypesTable } from './ContentObjectTypesTable';
4
+ import { useWatchSearchResult } from './search/ObjectTypeSearchContext';
5
+ import { useUserSession } from '@vertesia/ui/session';
6
+ import { EmptyCollection, ErrorBox, Input, SelectBox, useToast } from '@vertesia/ui/core';
7
+ import { useDebounce, useIntersectionObserver } from '@vertesia/ui/core';
8
+ import { CreateOrUpdateTypeModal } from './CreateOrUpdateTypeModal';
9
+ var ChunkableOptions;
10
+ (function (ChunkableOptions) {
11
+ ChunkableOptions["true"] = "Yes";
12
+ ChunkableOptions["false"] = "No";
13
+ })(ChunkableOptions || (ChunkableOptions = {}));
14
+ ;
15
+ export function ContentObjectTypesSearch({ isDirty = false }) {
16
+ const session = useUserSession();
17
+ const { store } = session;
18
+ const toast = useToast();
19
+ const [isReady, setIsReady] = useState(false);
20
+ const { search, isLoading, error, objects } = useWatchSearchResult();
21
+ const [searchTerm, setSearchTerm] = useState('');
22
+ const debounceValue = useDebounce(searchTerm, 500);
23
+ const loadMoreRef = useRef(null);
24
+ useIntersectionObserver(loadMoreRef, () => {
25
+ isReady && search.loadMore();
26
+ }, { deps: [isReady] });
27
+ useEffect(() => {
28
+ search.search().then(() => setIsReady(true));
29
+ }, []);
30
+ useEffect(() => {
31
+ search.query.name = searchTerm;
32
+ search.search().then(() => setIsReady(true));
33
+ }, [debounceValue]);
34
+ const [chunkable, setChunkable] = useState(undefined);
35
+ const onChunkableChange = (data) => {
36
+ setChunkable(data);
37
+ };
38
+ useEffect(() => {
39
+ search.query.chunkable = chunkable ? chunkable == 'Yes' : undefined;
40
+ search.search().then(() => setIsReady(true));
41
+ }, [chunkable]);
42
+ useEffect(() => {
43
+ if (isDirty && isReady) {
44
+ search.search().then(() => setIsReady(true));
45
+ }
46
+ }, [isDirty]);
47
+ const [showCreateModal, setShowCreateModal] = useState(false);
48
+ const onOpenCreateModal = () => {
49
+ setShowCreateModal(true);
50
+ };
51
+ if (error) {
52
+ return (_jsx(ErrorBox, { title: "Failed to fetch ObjectTypes", children: error.message }));
53
+ }
54
+ ;
55
+ const onCloseCreateModal = async (payload) => {
56
+ if (!payload) {
57
+ setShowCreateModal(false);
58
+ return Promise.resolve();
59
+ }
60
+ return store.types.create(payload).then(async () => {
61
+ toast({
62
+ status: 'success',
63
+ title: 'Type created',
64
+ duration: 2000
65
+ });
66
+ session.reloadTypes();
67
+ search.search().then(() => setIsReady(true));
68
+ }).catch(err => {
69
+ toast({
70
+ status: 'error',
71
+ title: 'Error creating type',
72
+ description: err.message,
73
+ duration: 5000
74
+ });
75
+ });
76
+ };
77
+ return (_jsxs("div", { children: [_jsxs("div", { className: "flex gap-4", children: [_jsx(Input, { placeholder: "Filter by Name", value: searchTerm, onChange: setSearchTerm }), _jsx(SelectBox, { className: "w-60", isClearable: true, options: Object.values(ChunkableOptions), value: chunkable, onChange: onChunkableChange, placeholder: "Is Chunkable" })] }), _jsxs("div", { className: "w-full", children: [(!isLoading && objects?.length === 0) ?
78
+ _jsx(EmptyCollection, { title: "No Type", buttonLabel: 'Create Type', onClick: onOpenCreateModal, children: "Get started by creating a new Type." })
79
+ :
80
+ _jsx(ContentObjectTypesTable, { objects: objects, isLoading: isLoading }), _jsx(CreateOrUpdateTypeModal, { okLabel: "Create", title: "Create Type", isOpen: showCreateModal, onClose: onCloseCreateModal })] })] }));
81
+ }
82
+ //# sourceMappingURL=ContentObjectTypesSearch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentObjectTypesSearch.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ContentObjectTypesSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAA6B,MAAM,2BAA2B,CAAC;AAE/F,IAAK,gBAA+C;AAApD,WAAK,gBAAgB;IAAG,gCAAY,CAAA;IAAE,gCAAY,CAAA;AAAC,CAAC,EAA/C,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Q,EAAC,KAAK,EAAC,aAAa,EAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,GAAI,IACpH,IACJ,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { TBody, Table } from "@vertesia/ui/core";
3
+ import { useNavigate } from "@vertesia/ui/router";
4
+ import dayjs from "dayjs";
5
+ import relativeTime from "dayjs/plugin/relativeTime";
6
+ dayjs.extend(relativeTime);
7
+ export function ContentObjectTypesTable({ objects, isLoading }) {
8
+ const navigate = useNavigate();
9
+ return (_jsx("div", { children: _jsxs(Table, { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Name" }), _jsx("th", { children: "Is Chunkable?" }), _jsx("th", { children: "Updated At" })] }) }), _jsx(TBody, { isLoading: isLoading, columns: 3, children: objects?.map((obj) => (_jsxs("tr", { onClick: () => navigate(`/types/${obj.id}`), className: 'cursor-pointer hover:bg-muted', children: [_jsx("td", { children: obj.name }), _jsx("td", { children: obj.is_chunkable ? 'Yes' : 'No' }), _jsx("td", { children: dayjs(obj.updated_at).fromNow() })] }, obj.id))) })] }) }));
10
+ }
11
+ //# sourceMappingURL=ContentObjectTypesTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentObjectTypesTable.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ContentObjectTypesTable.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAErD,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AAM3B,MAAM,UAAU,uBAAuB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAgC;IACxF,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,OAAO,CACH,wBACI,MAAC,KAAK,IAAC,SAAS,EAAC,QAAQ,aACrB,0BACI,yBACI,gCAAa,EACb,yCAAsB,EACtB,sCAAmB,IAClB,GACD,EACR,KAAC,KAAK,IAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,YAClC,OAAO,EAAE,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE,CAAC,CACxB,cAAiB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,EAAC,+BAA+B,aACnG,uBAAK,GAAG,CAAC,IAAI,GAAM,EACnB,uBAAK,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,GAAM,EAC1C,uBAAK,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,GAAM,KAHrC,GAAG,CAAC,EAAE,CAIV,CACR,CAAC,GACE,IACJ,GACN,CACT,CAAA;AACL,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { Button, useToast } from '@vertesia/ui/core';
4
+ import { FullHeightLayout } from '@vertesia/ui/layout';
5
+ import { useUserSession } from '@vertesia/ui/session';
6
+ import { GenericPageNavHeader } from "../../layout";
7
+ import { ContentObjectTypesSearch } from './ContentObjectTypesSearch';
8
+ import { ObjectTypeSearchProvider } from './search/ObjectTypeSearchProvider';
9
+ import { CreateOrUpdateTypeModal } from './CreateOrUpdateTypeModal';
10
+ export var ChunkableOptions;
11
+ (function (ChunkableOptions) {
12
+ ChunkableOptions["true"] = "Yes";
13
+ ChunkableOptions["false"] = "No";
14
+ })(ChunkableOptions || (ChunkableOptions = {}));
15
+ ;
16
+ export function ContentObjectTypesView({}) {
17
+ const toast = useToast();
18
+ const [showCreateModal, setShowCreateModal] = useState(false);
19
+ const session = useUserSession();
20
+ const { store } = session;
21
+ const actions = _jsx(Button, { variant: "primary", onClick: () => setShowCreateModal(true), children: "Create Type" }, "create");
22
+ const [isDirty, setIsDirty] = useState(false);
23
+ useEffect(() => {
24
+ if (isDirty) {
25
+ setIsDirty(false);
26
+ }
27
+ }, [isDirty]);
28
+ const onCloseCreateModal = async (payload) => {
29
+ if (!payload) {
30
+ setShowCreateModal(false);
31
+ return Promise.resolve();
32
+ }
33
+ return store.types.create(payload).then(async () => {
34
+ toast({
35
+ status: 'success',
36
+ title: 'Type created',
37
+ duration: 2000
38
+ });
39
+ session.reloadTypes();
40
+ setIsDirty(true);
41
+ }).catch(err => {
42
+ toast({
43
+ status: 'error',
44
+ title: 'Error creating type',
45
+ description: err.message,
46
+ duration: 5000
47
+ });
48
+ });
49
+ };
50
+ const breadcrumbs = [
51
+ _jsx("span", { children: "Content Type" }, '0')
52
+ ];
53
+ return (_jsxs(FullHeightLayout, { children: [_jsx(GenericPageNavHeader, { actions: actions, breadcrumbs: breadcrumbs, title: "Content Types" }), _jsx(CreateOrUpdateTypeModal, { okLabel: "Create", title: "Create Type", isOpen: showCreateModal, onClose: onCloseCreateModal }), _jsx(ObjectTypeSearchProvider, { children: _jsx(FullHeightLayout.Body, { children: _jsx(ContentObjectTypesSearch, { isDirty: isDirty }) }) })] }));
54
+ }
55
+ //# sourceMappingURL=ContentObjectTypesView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentObjectTypesView.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ContentObjectTypesView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD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AAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YAC/C,KAAK,CAAC;gBACF,MAAM,EAAE,SAAS;gBACjB,KAAK,EAAE,cAAc;gBACrB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YACH,OAAO,CAAC,WAAW,EAAE,CAAC;YACtB,UAAU,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,KAAK,CAAC;gBACF,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EAAE,GAAG,CAAC,OAAO;gBACxB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG;QAChB,2CAAU,GAAG,CAAoB;KACpC,CAAC;IAEF,OAAO,CACH,MAAC,gBAAgB,eACb,KAAC,oBAAoB,IAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAC,eAAe,GAAG,EAC1F,KAAC,uBAAuB,IAAC,OAAO,EAAC,QAAQ,EAAC,KAAK,EAAC,aAAa,EAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,GAAI,EACtH,KAAC,wBAAwB,cACrB,KAAC,gBAAgB,CAAC,IAAI,cAClB,KAAC,wBAAwB,IAAC,OAAO,EAAE,OAAO,GAA6B,GACnD,GACD,IACZ,CACtB,CAAC;AACN,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { Button, Input, Modal, ModalBody, ModalFooter, ModalTitle, Switch, useToast } from '@vertesia/ui/core';
4
+ export function CreateOrUpdateTypeModal({ title, isOpen, onClose, okLabel, initialPayload }) {
5
+ const toast = useToast();
6
+ const [name, setName] = useState(initialPayload?.name);
7
+ const [description, setDescription] = useState(initialPayload?.description);
8
+ const [strictMode, setStrictMode] = useState(initialPayload?.strict_mode ?? false);
9
+ const onSave = () => {
10
+ if (!name) {
11
+ toast({
12
+ status: 'error',
13
+ title: 'Name is required',
14
+ duration: 5000
15
+ });
16
+ return;
17
+ }
18
+ const payload = { name, description, strict_mode: strictMode };
19
+ onClose(payload).then(() => onClose());
20
+ setName(undefined);
21
+ setDescription(undefined);
22
+ setStrictMode(false);
23
+ };
24
+ return (_jsxs(Modal, { isOpen: isOpen, onClose: () => onClose(), children: [_jsx(ModalTitle, { children: title }), _jsx(ModalBody, { className: "pt-0", children: _jsxs("div", { className: 'h-full flex flex-col gap-4 content-between', children: [_jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-muted", children: "Name" }), _jsx(Input, { value: name, onChange: setName })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium text-muted", children: "Description" }), _jsx(Input, { value: description, onChange: setDescription })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx("label", { className: "block text-sm font-medium text-muted-foreground", children: "Strict Mode" }), _jsx(Switch, { value: strictMode, onChange: setStrictMode })] }), _jsx("div", { className: "text-xs text-muted-foreground", children: "When enabled, objects will be validated against the schema at generation and save time." })] }) }), _jsx(ModalFooter, { children: _jsxs("div", { className: 'flex justify-end gap-4', children: [_jsx(Button, { variant: "secondary", onClick: () => onClose(), children: "Cancel" }), _jsx(Button, { variant: "primary", onClick: () => onSave(), children: okLabel })] }) })] }));
25
+ }
26
+ //# sourceMappingURL=CreateOrUpdateTypeModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CreateOrUpdateTypeModal.js","sourceRoot":"","sources":["../../../../../src/features/store/types/CreateOrUpdateTypeModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,E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pE,KAAC,KAAK,IAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAI,IACvC,EACN,0BACI,gBAAO,SAAS,EAAC,sCAAsC,4BAAoB,EAC3E,KAAC,KAAK,IAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,GAAI,IACrD,EACN,eAAK,SAAS,EAAC,mCAAmC,aAC9C,gBAAO,SAAS,EAAC,iDAAiD,4BAAoB,EACtF,KAAC,MAAM,IAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,GAAI,IACpD,EACN,cAAK,SAAS,EAAC,+BAA+B,wGAExC,IACJ,GACE,EACZ,KAAC,WAAW,cACR,eAAK,SAAS,EAAC,wBAAwB,aACnC,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,uBAAiB,EACrE,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,YAAG,OAAO,GAAU,IACnE,GACI,IACV,CACX,CAAA;AACL,CAAC"}
@@ -0,0 +1,89 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { basicSetup } from 'codemirror';
3
+ import { useMemo, useRef, useState } from 'react';
4
+ import { useUserSession } from '@vertesia/ui/session';
5
+ import { json } from '@codemirror/lang-json';
6
+ import { CodeMirrorEditor } from '@vertesia/ui/widgets';
7
+ import { Button, useToast } from '@vertesia/ui/core';
8
+ import { SchemaEditor, useSchema } from '@vertesia/ui/widgets';
9
+ const CODE_MIRROR_EXTENSIONS = [basicSetup, json()];
10
+ export function ObjectSchemaEditor({ objectType, onSchemaUpdate }) {
11
+ const { store } = useUserSession();
12
+ const toast = useToast();
13
+ const [isUpdating, setUpdating] = useState(false);
14
+ const schema = useSchema(objectType.object_schema);
15
+ const editorRef = useRef(undefined);
16
+ const [displayJson, setDisplayJson] = useState(false);
17
+ const value = useMemo(() => {
18
+ return jsonToContent(schema.schema);
19
+ }, [schema]);
20
+ const onSave = () => {
21
+ if (displayJson) {
22
+ if (!updateSchemaFromJson()) {
23
+ return;
24
+ }
25
+ }
26
+ setUpdating(true);
27
+ store.types.update(objectType.id, { object_schema: schema.schema }).then(() => {
28
+ onSchemaUpdate(schema);
29
+ toast({
30
+ status: 'success',
31
+ title: 'Schema updated',
32
+ description: 'The schema has been updated successfully',
33
+ duration: 2000
34
+ });
35
+ }).catch((err) => {
36
+ toast({
37
+ status: 'error',
38
+ title: 'Failed to update schema',
39
+ description: err.message,
40
+ duration: 5000
41
+ });
42
+ }).finally(() => {
43
+ setUpdating(false);
44
+ });
45
+ };
46
+ const handleOnSave = () => {
47
+ if (displayJson) {
48
+ if (!updateSchemaFromJson()) {
49
+ return;
50
+ }
51
+ }
52
+ setDisplayJson(prev => !prev);
53
+ };
54
+ const updateSchemaFromJson = () => {
55
+ if (editorRef.current) {
56
+ const value = editorRef.current.getValue();
57
+ try {
58
+ const newSchema = contentToJson(value);
59
+ schema.replaceSchema(newSchema);
60
+ }
61
+ catch (err) {
62
+ toast({
63
+ status: 'error',
64
+ title: 'Invalid JSON Schema',
65
+ description: err.message,
66
+ duration: 5000
67
+ });
68
+ return false;
69
+ }
70
+ }
71
+ return true;
72
+ };
73
+ return (_jsxs("div", { className: "mx-2 my-2 rounded-md border border-solid shadow-md border-spacing-2", children: [_jsxs("div", { className: "flex items-center rounded-t-md border-b gap-x-2 py-2 px-4", children: [_jsx("div", { className: "text-lg font-semibold", children: "Schema Editor" }), _jsx("div", { children: _jsx(Button, { variant: "outline", size: "sm", onClick: handleOnSave, children: displayJson ? "Edit Schema" : "Edit Json" }) }), _jsx("div", { className: "ml-auto flex gap-x-2", children: _jsx(Button, { isLoading: isUpdating, variant: "outline", size: "sm", onClick: onSave, children: "Save Changes" }) })] }), _jsx("div", { className: "px-4 py-2", children: displayJson
74
+ ? _jsx(CodeMirrorEditor, { value: value, extensions: CODE_MIRROR_EXTENSIONS, editorRef: editorRef })
75
+ : _jsx(SchemaEditor, { schema: schema }) })] }));
76
+ }
77
+ function jsonToContent(json) {
78
+ if (!json) {
79
+ return '';
80
+ }
81
+ return JSON.stringify(json, null, 2);
82
+ }
83
+ function contentToJson(content) {
84
+ if (!content?.trim()) {
85
+ return undefined;
86
+ }
87
+ return JSON.parse(content.trim());
88
+ }
89
+ //# sourceMappingURL=ObjectSchemaEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectSchemaEditor.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ObjectSchemaEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAa,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAMpD,MAAM,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,cAAc,EAA2B;IACtF,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,MAAM,CAAwB,SAAS,CAAC,CAAC;I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C9F,CAAC,CAAC,KAAC,YAAY,IAAC,MAAM,EAAE,MAAM,GAAI,GAExC,IACJ,CACT,CAAC;AACN,CAAC;AAED,SAAS,aAAa,CAAC,IAA4B;IAC/C,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,OAAO,EAAE,CAAA;IACb,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,aAAa,CAAC,OAAkC;IACrD,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { VSelectBox } from "@vertesia/ui/core";
3
+ import { useUserSession } from "@vertesia/ui/session";
4
+ import { useEffect, useState } from "react";
5
+ const optionLabel = (t) => {
6
+ if (t === null)
7
+ return 'None';
8
+ return (_jsxs("div", { children: [_jsx("div", { className: "text-sm", children: t.name }), _jsx("div", { className: "text-xs text-gray-500", children: t.description })] }));
9
+ };
10
+ export function SelectContentType({ className, defaultValue, onChange, isClearable, multiple }) {
11
+ const session = useUserSession();
12
+ const [isMounted, setIsMounted] = useState(false);
13
+ const [selectedType, setSelectedType] = useState();
14
+ const [selectedTypes, setSelectedTypes] = useState([]);
15
+ useEffect(() => {
16
+ if (!isMounted) {
17
+ setIsMounted(true);
18
+ if (session.typeRegistry && defaultValue) {
19
+ if (multiple && Array.isArray(defaultValue)) {
20
+ const types = session.typeRegistry.types.filter(t => defaultValue.includes(t.id));
21
+ setSelectedTypes(types);
22
+ }
23
+ const type = session.typeRegistry.types.find(t => t.id === defaultValue);
24
+ if (type) {
25
+ setSelectedType(type);
26
+ }
27
+ }
28
+ }
29
+ }, [session.typeRegistry, defaultValue, multiple]);
30
+ const _onChange = (option) => {
31
+ setSelectedType(option || undefined);
32
+ onChange(option);
33
+ };
34
+ const _onChangeMultiple = (options) => {
35
+ setSelectedTypes(options);
36
+ onChange(options);
37
+ };
38
+ if (multiple) {
39
+ return (_jsx("div", { className: 'flex flex-col gap-4 content-between', children: _jsx(VSelectBox, { options: session.typeRegistry?.types || [], value: selectedTypes, onChange: _onChangeMultiple, placeholder: "Choose Content Types...", optionLabel: optionLabel, className: className || "text-sm bg-background", filterBy: "name", isClearable: isClearable || false, multiple: true }) }));
40
+ }
41
+ return (_jsx("div", { className: 'flex flex-col gap-4 content-between', children: _jsx(VSelectBox, { options: session.typeRegistry?.types || [], value: selectedType, onChange: _onChange, placeholder: "Choose a Content Type...", optionLabel: optionLabel, className: className || "text-sm bg-background", filterBy: "name", isClearable: isClearable || false }) }));
42
+ }
43
+ //# sourceMappingURL=SelectContentType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectContentType.js","sourceRoot":"","sources":["../../../../../src/features/store/types/SelectContentType.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,CAA+B,EAAE,EAAE;IACpD,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IAE9B,OAAO,CACH,0BACI,cAAK,SAAS,EAAC,SAAS,YAAE,CAAC,CAAC,IAAI,GAAO,EACvC,cAAK,SAAS,EAAC,uBAAuB,YAAE,CAAC,CAAC,WAAW,GAAO,IAC1D,CACT,CAAC;AACN,CAAC,CAAC;AASF,MAAM,UAAU,iBAAiB,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAyB;IACjH,MAAM,OAAO,GAAG,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BAAgB,CAAC,OAAO,CAAC,CAAC;QAC1B,QAAQ,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CACH,cAAK,SAAS,EAAC,qCAAqC,YAChD,KAAC,UAAU,IACP,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,EAC1C,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EAAC,yBAAyB,EACrC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,IAAI,uBAAuB,EAC/C,QAAQ,EAAC,MAAM,EACf,WAAW,EAAE,WAAW,IAAI,KAAY,EACxC,QAAQ,SACV,GACA,CACT,CAAC;IACN,CAAC;IAED,OAAO,CACH,cAAK,SAAS,EAAC,qCAAqC,YAChD,KAAC,UAAU,IACP,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,KAAK,IAAI,EAAE,EAC1C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,SAAS,EACnB,WAAW,EAAC,0BAA0B,EACtC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,IAAI,uBAAuB,EAC/C,QAAQ,EAAC,MAAM,EACf,WAAW,EAAE,WAAW,IAAI,KAAY,GAC1C,GACA,CACT,CAAC;AACN,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { Button, Modal, ModalBody, ModalFooter, ModalTitle, SelectBox, } from "@vertesia/ui/core";
4
+ import { useUserSession } from "@vertesia/ui/session";
5
+ import { CheckCircleIcon } from "lucide-react";
6
+ /**
7
+ * A dedicated modal for selecting content types.
8
+ *
9
+ * This is a lightweight modal specifically for selecting a content type,
10
+ * without any file upload functionality. Used for changing types, setting
11
+ * types in other contexts, etc.
12
+ */
13
+ export function SelectContentTypeModal({ isOpen, onClose, title = "Select Content Type", children, initialSelectedType = null, confirmLabel = "Select Type", allowNone = true, }) {
14
+ const { typeRegistry } = useUserSession();
15
+ const [selectedType, setSelectedType] = useState(initialSelectedType);
16
+ // Get available types from the registry
17
+ const types = typeRegistry?.types || [];
18
+ // Handle close/cancel
19
+ const handleClose = () => {
20
+ onClose(undefined);
21
+ };
22
+ // Handle type selection and confirmation
23
+ const handleConfirm = () => {
24
+ onClose(selectedType?.id ?? null);
25
+ };
26
+ return (_jsxs(Modal, { isOpen: isOpen, onClose: handleClose, className: "w-full max-w-xl mx-auto", children: [_jsx(ModalTitle, { children: title }), _jsxs(ModalBody, { className: "p-6", children: [children, _jsxs("div", { className: "mb-4 mt-4", children: [_jsxs("label", { className: "block text-sm font-medium mb-2", children: ["Content Type ", allowNone && _jsx("span", { className: "text-gray-500 font-normal", children: "(Optional)" })] }), allowNone ? (_jsx(SelectBox, { options: types, value: selectedType, optionLabel: (type) => type ? type.name : 'Select a content type', placeholder: "Select a content type or leave empty for automatic detection", onChange: (selected) => setSelectedType(selected || null), filterBy: "name", isClearable: true })) : (_jsx(SelectBox, { options: types, value: selectedType, optionLabel: (type) => type ? type.name : 'Select a content type', placeholder: "Select a content type", onChange: (selected) => setSelectedType(selected || null), filterBy: "name" })), allowNone && (_jsxs("div", { className: "mt-2 text-sm text-blue-600 flex items-center", children: [_jsx(CheckCircleIcon, { className: "h-4 w-4 mr-1" }), _jsxs("span", { children: [_jsx("strong", { children: "Type selection is optional." }), " Leave empty to let Vertesia choose the appropriate type"] })] }))] }), selectedType ? (_jsxs("div", { className: "text-sm text-gray-500 bg-gray-50 p-3 rounded-md mb-4", children: [_jsx("div", { className: "font-medium", children: selectedType.name }), selectedType.description && (_jsx("div", { className: "mt-1", children: selectedType.description }))] })) : allowNone && (_jsxs("div", { className: "text-sm text-blue-600 bg-blue-50 p-3 rounded-md mb-4", children: [_jsx("div", { className: "font-medium", children: "Automatic Type Detection" }), _jsxs("div", { className: "mt-1", children: ["Vertesia will analyze each file's content and automatically select the most appropriate type.", _jsx("br", {}), _jsx("span", { className: "mt-1 block font-medium", children: "This is recommended for most uploads." })] })] }))] }), _jsxs(ModalFooter, { children: [_jsx(Button, { variant: "ghost", onClick: handleClose, children: "Cancel" }), _jsx(Button, { onClick: handleConfirm, children: selectedType ? `${confirmLabel}: ${selectedType.name}` : allowNone ? "Let Vertesia Choose" : confirmLabel })] })] }));
27
+ }
28
+ //# sourceMappingURL=SelectContentTypeModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectContentTypeModal.js","sourceRoot":"","sources":["../../../../../src/features/store/types/SelectContentTypeModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC5C,OAAO,EACH,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,GACZ,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAwB/C;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,EACnC,MAAM,EACN,OAAO,EACP,KAAK,GAAG,qBAAqB,EAC7B,QAAQ,EACR,mBAAmB,GAAG,IAAI,EAC1B,YAAY,GAAG,aAAa,EAC5B,SAAS,GAAG,IAAI,GACU;IAC1B,MAAM,EAAE,YAAY,EAAE,GAAG,cAAc,EAAE,CAAC;IAC1C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAA+B,mBAAmB,CAAC,CAAC;IAEpG,wCAAwC;IACxC,MAAM,KAAK,GAAG,YAAY,EAAE,KAAK,IAAI,EAAE,CAAC;IAExC,sBAAsB;IACtB,MAAM,WAAW,GAAG,GAAG,EAAE;QACrB,OAAO,CAAC,SAAS,CAAC,CAAC;IACvB,CAAC,CAAC;IAEF,yCAAyC;IACzC,MAAM,aAAa,GAAG,GAAG,EAAE;QACvB,OAAO,CAAC,YAAY,EAA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/G,CACT,IACC,EAEL,YAAY,CAAC,CAAC,CAAC,CACZ,eAAK,SAAS,EAAC,sDAAsD,aACjE,cAAK,SAAS,EAAC,aAAa,YAAE,YAAY,CAAC,IAAI,GAAO,EACrD,YAAY,CAAC,WAAW,IAAI,CACzB,cAAK,SAAS,EAAC,MAAM,YAAE,YAAY,CAAC,WAAW,GAAO,CACzD,IACC,CACT,CAAC,CAAC,CAAC,SAAS,IAAI,CACb,eAAK,SAAS,EAAC,sDAAsD,aACjE,cAAK,SAAS,EAAC,aAAa,yCAA+B,EAC3D,eAAK,SAAS,EAAC,MAAM,8GAEjB,cAAM,EACN,eAAM,SAAS,EAAC,wBAAwB,sDAA6C,IACnF,IACJ,CACT,IACO,EACZ,MAAC,WAAW,eACR,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,EAAC,OAAO,EAAE,WAAW,uBAEnC,EACT,KAAC,MAAM,IACH,OAAO,EAAE,aAAa,YAErB,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,GACrG,IACC,IACV,CACX,CAAC;AACN,CAAC"}
@@ -0,0 +1,78 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { basicSetup } from 'codemirror';
3
+ import { useMemo, useRef, useState } from 'react';
4
+ import { json } from '@codemirror/lang-json';
5
+ import { Button, useToast } from '@vertesia/ui/core';
6
+ import { useUserSession } from '@vertesia/ui/session';
7
+ import { CodeMirrorEditor } from '@vertesia/ui/widgets';
8
+ const extensions = [basicSetup, json()];
9
+ export function TableLayoutEditor({ objectType, onLayoutUpdate }) {
10
+ const toast = useToast();
11
+ const [isUpdating, setUpdating] = useState(false);
12
+ const { store } = useUserSession();
13
+ const editorRef = useRef(undefined);
14
+ const value = useMemo(() => {
15
+ return stringifyTableLayout(objectType.table_layout);
16
+ }, [objectType.table_layout]);
17
+ const validationError = (title, message) => {
18
+ toast({
19
+ status: 'error',
20
+ title: title,
21
+ description: message,
22
+ duration: 5000
23
+ });
24
+ };
25
+ const onSave = () => {
26
+ if (!editorRef.current) {
27
+ return;
28
+ }
29
+ const value = editorRef.current.getValue();
30
+ let table_layout;
31
+ if (!value) {
32
+ table_layout = null;
33
+ }
34
+ else {
35
+ try {
36
+ table_layout = JSON.parse(value);
37
+ }
38
+ catch (err) {
39
+ return validationError('Invalid JSON', err.message);
40
+ }
41
+ }
42
+ if (!Array.isArray(table_layout)) {
43
+ return validationError('Invalid JSON', 'The table layout must be an array');
44
+ }
45
+ if (table_layout.some((col) => !col || !col.name || !col.field)) {
46
+ return validationError('Invalid JSON', 'A table layout entry must contain the following properties:] {field, name, converter?}');
47
+ }
48
+ setUpdating(true);
49
+ store.types.update(objectType.id, {
50
+ table_layout
51
+ }).then((response) => {
52
+ toast({
53
+ status: 'success',
54
+ title: 'Table Layout updated',
55
+ description: 'The table layout has been updated successfully',
56
+ duration: 2000
57
+ });
58
+ onLayoutUpdate(response.table_layout);
59
+ }).catch((err) => {
60
+ toast({
61
+ status: 'error',
62
+ title: 'Failed to update table layout',
63
+ description: err.message,
64
+ duration: 5000
65
+ });
66
+ }).finally(() => {
67
+ setUpdating(false);
68
+ });
69
+ };
70
+ return (_jsxs("div", { className: "mx-2 my-2 rounded-md border border-solid shadow-xs", children: [_jsxs("div", { className: "flex items-center rounded-t-md gap-x-2 bg-gray-50 dark:bg-slate-800 py-2 px-2", children: [_jsx("div", { className: "text-lg font-semibold ", children: "Table Layout Editor" }), _jsx("div", { className: "ml-auto flex gap-x-2", children: _jsx(Button, { isLoading: isUpdating, variant: "secondary", onClick: onSave, children: "Save Changes" }) })] }), _jsx("div", { className: "px-4 py-2", children: _jsx(CodeMirrorEditor, { value: value, extensions: extensions, editorRef: editorRef }) })] }));
71
+ }
72
+ export function stringifyTableLayout(obj) {
73
+ if (!obj) {
74
+ return '[\n\n]';
75
+ }
76
+ return JSON.stringify(obj, null, 2);
77
+ }
78
+ //# sourceMappingURL=TableLayoutEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableLayoutEditor.js","sourceRoot":"","sources":["../../../../../src/features/store/types/TableLayoutEditor.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAa,MAAM,sBAAsB,CAAC;AAEnE,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAMxC,MAAM,UAAU,iBAAiB,CAAC,EAAE,UAAU,EAAE,cAAc,EAA0B;IACpF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IAEzB,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IAEnC,MAAM,SAAS,GAAG,MAAM,CAAwB,SAAS,CAAC,CAAC;IAE3D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACvB,OAAO,oBAAoB,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IACzD,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAA;IAE7B,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,OAAe,EAAE,EAAE;QACvD,KAAK,CAAC;YACF,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,KAAK;YACZ,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACjB,C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AY,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,KAAK,CAAC;gBACF,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,+BAA+B;gBACtC,WAAW,EAAE,GAAG,CAAC,OAAO;gBACxB,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAA;QACN,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YACZ,WAAW,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACP,CAAC,CAAA;IAGD,OAAO,CACH,eAAK,SAAS,EAAC,oDAAoD,aAC/D,eAAK,SAAS,EAAC,+EAA+E,aAC1F,cAAK,SAAS,EAAC,wBAAwB,oCAA0B,EACjE,cAAK,SAAS,EAAC,sBAAsB,YACjC,KAAC,MAAM,IAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,6BAAuB,GACvF,IACJ,EACN,cAAK,SAAS,EAAC,WAAW,YACtB,KAAC,gBAAgB,IAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAI,GAC9E,IACJ,CACT,CAAA;AACL,CAAC;AAGD,MAAM,UAAU,oBAAoB,CAAC,GAAQ;IACzC,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from "./ContentObjectTypesSearch";
2
+ export * from "./ContentObjectTypesTable";
3
+ export * from "./ContentObjectTypesView";
4
+ export * from "./ContentObjectTypeView";
5
+ export * from "./CreateOrUpdateTypeModal";
6
+ export * from "./ObjectSchemaEditor";
7
+ export * from "./search";
8
+ export * from "./SelectContentType";
9
+ export * from "./SelectContentTypeModal";
10
+ export * from "./TableLayoutEditor";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/features/store/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { SharedState, useWatchSharedState } from "@vertesia/ui/core";
2
+ import { createContext, useContext } from "react";
3
+ export class ObjectTypeSearch {
4
+ client;
5
+ limit;
6
+ result = new SharedState({ objects: [], isLoading: false });
7
+ query = {};
8
+ constructor(client, limit = 100) {
9
+ this.client = client;
10
+ this.limit = limit;
11
+ }
12
+ get objects() {
13
+ return this.result.value.objects;
14
+ }
15
+ get error() {
16
+ return this.result.value.error;
17
+ }
18
+ get isRunning() {
19
+ return this.result.value.isLoading;
20
+ }
21
+ getFilterValue(name) {
22
+ return this.query[name];
23
+ }
24
+ setFilterValue(name, value) {
25
+ this.query[name] = value;
26
+ this.search();
27
+ }
28
+ reset(isLoading = false) {
29
+ this.result.value = {
30
+ objects: [],
31
+ isLoading
32
+ };
33
+ }
34
+ _updateRunningState(value) {
35
+ const prev = this.result.value;
36
+ this.result.value = {
37
+ objects: prev.objects,
38
+ isLoading: value,
39
+ error: prev.error
40
+ };
41
+ }
42
+ async _search(loadMore = false) {
43
+ if (this.isRunning) {
44
+ return Promise.resolve(false);
45
+ }
46
+ this.result.value = {
47
+ isLoading: true,
48
+ objects: loadMore ? this.objects : [],
49
+ };
50
+ const limit = this.limit;
51
+ const offset = this.objects.length;
52
+ return this.client.types.list({
53
+ limit,
54
+ offset,
55
+ query: this.query
56
+ }).then(async (result) => {
57
+ this.result.value = {
58
+ isLoading: false,
59
+ objects: this.objects.concat(result)
60
+ };
61
+ return true;
62
+ }).catch((err) => {
63
+ this.result.value = {
64
+ error: err,
65
+ isLoading: false,
66
+ objects: this.objects
67
+ };
68
+ throw err;
69
+ });
70
+ }
71
+ search() {
72
+ if (this.isRunning) {
73
+ return Promise.resolve(false);
74
+ }
75
+ return this._search(false);
76
+ }
77
+ loadMore() {
78
+ if (this.isRunning) {
79
+ return Promise.resolve(false);
80
+ }
81
+ return this._search(true);
82
+ }
83
+ }
84
+ const ObjectTypeSearchContext = createContext(undefined);
85
+ export function useSearch() {
86
+ return useContext(ObjectTypeSearchContext);
87
+ }
88
+ export function useWatchSearchResult() {
89
+ const search = useSearch();
90
+ const result = useWatchSharedState(search.result);
91
+ return { ...result, search };
92
+ }
93
+ export function useSearchCount() {
94
+ const search = useSearch();
95
+ return search.objects.length;
96
+ }
97
+ export { ObjectTypeSearchContext };
98
+ //# sourceMappingURL=ObjectTypeSearchContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectTypeSearchContext.js","sourceRoot":"","sources":["../../../../../../src/features/store/types/search/ObjectTypeSearchContext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AASlD,MAAM,OAAO,gBAAgB;IAKN;IAA4C;IAJ/D,MAAM,GAAG,IAAI,WAAW,CAAyB,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAEpF,KAAK,GAA0B,EAAE,CAAC;IAElC,YAAmB,MAAmC,EAAS,QAAQ,GAAG;QAAvD,WAAM,GAAN,MAAM,CAA6B;QAAS,UAAK,GAAL,KAAK,CAAM;IAAI,CAAC;IAE/E,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,O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AAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc;IAC1B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;AACjC,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useUserSession } from "@vertesia/ui/session";
3
+ import { useMemo } from "react";
4
+ import { ObjectTypeSearch, ObjectTypeSearchContext } from "./ObjectTypeSearchContext";
5
+ export function ObjectTypeSearchProvider({ children, limit, name, chunkable: chunkable }) {
6
+ const { store } = useUserSession();
7
+ const search = useMemo(() => {
8
+ const search = new ObjectTypeSearch(store, limit);
9
+ search.query.name = name;
10
+ search.query.chunkable = chunkable;
11
+ return search;
12
+ }, [limit]);
13
+ return (_jsx(ObjectTypeSearchContext.Provider, { value: search, children: children }));
14
+ }
15
+ //# sourceMappingURL=ObjectTypeSearchProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectTypeSearchProvider.js","sourceRoot":"","sources":["../../../../../../src/features/store/types/search/ObjectTypeSearchProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAStF,MAAM,UAAU,wBAAwB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAuB;IACzG,MAAM,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAClD,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;QACnC,OAAO,MAAM,CAAC;IAClB,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,CACH,KAAC,uBAAuB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAAG,QAAQ,GAAoC,CACjG,CAAA;AACL,CAAC"}