@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.
- package/lib/esm/core/components/FormItem.js +9 -0
- package/lib/esm/core/components/FormItem.js.map +1 -0
- package/lib/esm/core/components/InputList.js +4 -3
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/index.js +3 -3
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/button.js +37 -7
- package/lib/esm/core/components/shadcn/button.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +3 -3
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js +38 -0
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js +24 -26
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +12 -12
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +49 -36
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +31 -23
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +33 -24
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -2
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
- package/lib/esm/core/components/shadcn/input.js +4 -4
- package/lib/esm/core/components/shadcn/input.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +72 -6
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/styles.js +1 -1
- package/lib/esm/core/components/styles.js.map +1 -1
- package/lib/esm/core/components/table/index.js +3 -0
- package/lib/esm/core/components/table/index.js.map +1 -1
- package/lib/esm/core/index.js +2 -1
- package/lib/esm/core/index.js.map +1 -1
- package/lib/esm/core/utils/cn.js +6 -0
- package/lib/esm/core/utils/cn.js.map +1 -0
- package/lib/esm/core/utils/index.js +2 -0
- package/lib/esm/core/utils/index.js.map +1 -0
- package/lib/esm/features/agent/PayloadBuilder.js +174 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js +207 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/JumpingDots.js +6 -0
- package/lib/esm/features/agent/chat/JumpingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +409 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +129 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +66 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js +29 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +97 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +46 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +352 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js +20 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +62 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js +23 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +51 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +82 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js +13 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +105 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +154 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js +266 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js.map +1 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js +60 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/index.js +5 -0
- package/lib/esm/features/agent/chat/index.js.map +1 -0
- package/lib/esm/features/agent/index.js +3 -0
- package/lib/esm/features/agent/index.js.map +1 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js +11 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/RowErrorBoundary.js +9 -0
- package/lib/esm/features/errors/RowErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js +15 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js +11 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/index.js +5 -0
- package/lib/esm/features/errors/index.js.map +1 -0
- package/lib/esm/features/facets/EnvironmentFacet.js +39 -0
- package/lib/esm/features/facets/EnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/FacetsNav.js +8 -0
- package/lib/esm/features/facets/FacetsNav.js.map +1 -0
- package/lib/esm/features/facets/InteractionFacet.js +39 -0
- package/lib/esm/features/facets/InteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/StringFacet.js +12 -0
- package/lib/esm/features/facets/StringFacet.js.map +1 -0
- package/lib/esm/features/facets/StringListFacet.js +11 -0
- package/lib/esm/features/facets/StringListFacet.js.map +1 -0
- package/lib/esm/features/facets/TypeFacet.js +42 -0
- package/lib/esm/features/facets/TypeFacet.js.map +1 -0
- package/lib/esm/features/facets/TypeOptions.js +19 -0
- package/lib/esm/features/facets/TypeOptions.js.map +1 -0
- package/lib/esm/features/facets/UserFacet.js +33 -0
- package/lib/esm/features/facets/UserFacet.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +114 -0
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/VStringFacet.js +17 -0
- package/lib/esm/features/facets/VStringFacet.js.map +1 -0
- package/lib/esm/features/facets/VTypeFacet.js +56 -0
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -0
- package/lib/esm/features/facets/VUserFacet.js +31 -0
- package/lib/esm/features/facets/VUserFacet.js.map +1 -0
- package/lib/esm/features/facets/index.js +12 -0
- package/lib/esm/features/facets/index.js.map +1 -0
- package/lib/esm/features/facets/utils.js +7 -0
- package/lib/esm/features/facets/utils.js.map +1 -0
- package/lib/esm/features/index.js +9 -1
- package/lib/esm/features/index.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +11 -0
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -0
- package/lib/esm/features/layout/NotFoundView.js +5 -0
- package/lib/esm/features/layout/NotFoundView.js.map +1 -0
- package/lib/esm/features/layout/index.js +3 -0
- package/lib/esm/features/layout/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js +13 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js +44 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -0
- package/lib/esm/features/magic-pdf/PageSlider.js +57 -0
- package/lib/esm/features/magic-pdf/PageSlider.js.map +1 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +133 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -0
- package/lib/esm/features/magic-pdf/TextPageView.js +45 -0
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -0
- package/lib/esm/features/magic-pdf/index.js +2 -0
- package/lib/esm/features/magic-pdf/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/types.js +2 -0
- package/lib/esm/features/magic-pdf/types.js.map +1 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js +34 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +1 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js +37 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionView.js +53 -0
- package/lib/esm/features/store/collections/CollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionsTable.js +60 -0
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionsView.js +94 -0
- package/lib/esm/features/store/collections/CollectionsView.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +161 -0
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/index.js +6 -0
- package/lib/esm/features/store/collections/index.js.map +1 -0
- package/lib/esm/features/store/index.js +4 -0
- package/lib/esm/features/store/index.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +150 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js +123 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js +81 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentTable.js +278 -0
- package/lib/esm/features/store/objects/DocumentTable.js.map +1 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js +31 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js +31 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js +195 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js +28 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js +52 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +169 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +45 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js +39 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +7 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +85 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -0
- package/lib/esm/features/store/objects/components/index.js +10 -0
- package/lib/esm/features/store/objects/components/index.js.map +1 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js +21 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -0
- package/lib/esm/features/store/objects/index.js +11 -0
- package/lib/esm/features/store/objects/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +74 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js +16 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -0
- package/lib/esm/features/store/objects/layout/index.js +3 -0
- package/lib/esm/features/store/objects/layout/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/renderers.js +128 -0
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +150 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +41 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -0
- package/lib/esm/features/store/objects/search/index.js +3 -0
- package/lib/esm/features/store/objects/search/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +149 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js +2 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js.map +1 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js +75 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +64 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +53 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js +30 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +66 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +106 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +64 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +72 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/index.js +8 -0
- package/lib/esm/features/store/objects/selection/actions/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/index.js +5 -0
- package/lib/esm/features/store/objects/selection/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +476 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -0
- package/lib/esm/features/store/objects/upload/index.js +4 -0
- package/lib/esm/features/store/objects/upload/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +201 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js +230 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypeView.js +158 -0
- package/lib/esm/features/store/types/ContentObjectTypeView.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js +82 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js +11 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesView.js +55 -0
- package/lib/esm/features/store/types/ContentObjectTypesView.js.map +1 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +26 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +89 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentType.js +43 -0
- package/lib/esm/features/store/types/SelectContentType.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js +28 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js +78 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -0
- package/lib/esm/features/store/types/index.js +11 -0
- package/lib/esm/features/store/types/index.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js +98 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js +15 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js.map +1 -0
- package/lib/esm/features/store/types/search/index.js +3 -0
- package/lib/esm/features/store/types/search/index.js.map +1 -0
- package/lib/esm/features/user/UserAvatar.js +18 -0
- package/lib/esm/features/user/UserAvatar.js.map +1 -0
- package/lib/esm/features/user/UserInfo.js +88 -0
- package/lib/esm/features/user/UserInfo.js.map +1 -0
- package/lib/esm/features/user/index.js +3 -0
- package/lib/esm/features/user/index.js.map +1 -0
- package/lib/esm/features/utils/index.js +4 -0
- package/lib/esm/features/utils/index.js.map +1 -0
- package/lib/esm/features/utils/mimeType.js +9 -0
- package/lib/esm/features/utils/mimeType.js.map +1 -0
- package/lib/esm/features/utils/rendition.js +47 -0
- package/lib/esm/features/utils/rendition.js.map +1 -0
- package/lib/esm/features/utils/text.js +10 -0
- package/lib/esm/features/utils/text.js.map +1 -0
- package/lib/esm/layout/FullHeightLayout.js +1 -1
- package/lib/esm/layout/FullHeightLayout.js.map +1 -1
- package/lib/esm/layout/Sidebar.js +12 -2
- package/lib/esm/layout/Sidebar.js.map +1 -1
- package/lib/esm/widgets/Progress.js +5 -0
- package/lib/esm/widgets/Progress.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +1 -1
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/esm/widgets/form/Form.js +2 -2
- package/lib/esm/widgets/form/Form.js.map +1 -1
- package/lib/esm/widgets/form/schema.js +11 -5
- package/lib/esm/widgets/form/schema.js.map +1 -1
- package/lib/esm/widgets/index.js +4 -0
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/popover/Popover.js +73 -0
- package/lib/esm/widgets/popover/Popover.js.map +1 -0
- package/lib/esm/widgets/popover/context.js +7 -0
- package/lib/esm/widgets/popover/context.js.map +1 -0
- package/lib/esm/widgets/popover/index.js +3 -0
- package/lib/esm/widgets/popover/index.js.map +1 -0
- package/lib/esm/widgets/popover/slots.js +22 -0
- package/lib/esm/widgets/popover/slots.js.map +1 -0
- package/lib/esm/widgets/properties/PropertiesView.js +6 -0
- package/lib/esm/widgets/properties/PropertiesView.js.map +1 -0
- package/lib/esm/widgets/properties/index.js +2 -0
- package/lib/esm/widgets/properties/index.js.map +1 -0
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js +1 -2
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/Editable.js +9 -10
- package/lib/esm/widgets/schema-editor/editor/Editable.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js +1 -1
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +2 -2
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/lib/esm/widgets/upload/DropZone.js +162 -0
- package/lib/esm/widgets/upload/DropZone.js.map +1 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js +19 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js.map +1 -0
- package/lib/esm/widgets/upload/UploadSummary.js +30 -0
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -0
- package/lib/esm/widgets/upload/index.js +4 -0
- package/lib/esm/widgets/upload/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/FormItem.d.ts +11 -0
- package/lib/types/core/components/index.d.ts +3 -3
- package/lib/types/core/components/shadcn/button.d.ts +13 -2
- package/lib/types/core/components/shadcn/command.d.ts +7 -7
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +8 -0
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -5
- package/lib/types/core/components/shadcn/filters/dateFilter.d.ts +3 -4
- package/lib/types/core/components/shadcn/filters/types.d.ts +7 -1
- package/lib/types/core/components/shadcn/input.d.ts +4 -4
- package/lib/types/core/components/shadcn/selectBox.d.ts +13 -4
- package/lib/types/core/components/table/index.d.ts +1 -0
- package/lib/types/core/index.d.ts +2 -1
- package/lib/types/core/utils/cn.d.ts +2 -0
- package/lib/types/core/utils/index.d.ts +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +53 -0
- package/lib/types/features/agent/chat/AnimatedThinkingDots.d.ts +37 -0
- package/lib/types/features/agent/chat/JumpingDots.d.ts +6 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +24 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +21 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +18 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +15 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +12 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessagesContainer.d.ts +9 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts +8 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlideInPanel.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts +9 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/StackedMessages.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts +21 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +23 -0
- package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts +17 -0
- package/lib/types/features/agent/chat/WaitingMessages.d.ts +1 -0
- package/lib/types/features/agent/chat/index.d.ts +4 -0
- package/lib/types/features/agent/index.d.ts +2 -0
- package/lib/types/features/errors/PanelErrorBoundary.d.ts +4 -0
- package/lib/types/features/errors/RowErrorBoundary.d.ts +7 -0
- package/lib/types/features/errors/VertesiaErrorBoundary.d.ts +11 -0
- package/lib/types/features/errors/WidgetErrorBoundary.d.ts +4 -0
- package/lib/types/features/errors/index.d.ts +4 -0
- package/lib/types/features/facets/EnvironmentFacet.d.ts +9 -0
- package/lib/types/features/facets/FacetsNav.d.ts +6 -0
- package/lib/types/features/facets/InteractionFacet.d.ts +9 -0
- package/lib/types/features/facets/StringFacet.d.ts +10 -0
- package/lib/types/features/facets/StringListFacet.d.ts +10 -0
- package/lib/types/features/facets/TypeFacet.d.ts +15 -0
- package/lib/types/features/facets/TypeOptions.d.ts +3 -0
- package/lib/types/features/facets/UserFacet.d.ts +11 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +7 -0
- package/lib/types/features/facets/VStringFacet.d.ts +15 -0
- package/lib/types/features/facets/VTypeFacet.d.ts +8 -0
- package/lib/types/features/facets/VUserFacet.d.ts +9 -0
- package/lib/types/features/facets/index.d.ts +11 -0
- package/lib/types/features/facets/utils.d.ts +3 -0
- package/lib/types/features/index.d.ts +9 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts +12 -0
- package/lib/types/features/layout/NotFoundView.d.ts +4 -0
- package/lib/types/features/layout/index.d.ts +2 -0
- package/lib/types/features/magic-pdf/DownloadPopover.d.ts +6 -0
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts +6 -0
- package/lib/types/features/magic-pdf/PageSlider.d.ts +7 -0
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +28 -0
- package/lib/types/features/magic-pdf/TextPageView.d.ts +7 -0
- package/lib/types/features/magic-pdf/index.d.ts +1 -0
- package/lib/types/features/magic-pdf/types.d.ts +1 -0
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +8 -0
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts +6 -0
- package/lib/types/features/store/collections/CollectionView.d.ts +5 -0
- package/lib/types/features/store/collections/CollectionsTable.d.ts +5 -0
- package/lib/types/features/store/collections/CollectionsView.d.ts +10 -0
- package/lib/types/features/store/collections/EditCollectionView.d.ts +7 -0
- package/lib/types/features/store/collections/index.d.ts +5 -0
- package/lib/types/features/store/index.d.ts +3 -0
- package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts +7 -0
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts +19 -0
- package/lib/types/features/store/objects/DocumentSelectionProvider.d.ts +32 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts +20 -0
- package/lib/types/features/store/objects/ExportPropertiesModal.d.ts +11 -0
- package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts +8 -0
- package/lib/types/features/store/objects/components/ContentOverview.d.ts +7 -0
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +10 -0
- package/lib/types/features/store/objects/components/DocumentInput.d.ts +7 -0
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +7 -0
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts +8 -0
- package/lib/types/features/store/objects/components/SelectDocument.d.ts +8 -0
- package/lib/types/features/store/objects/components/SelectDocumentModal.d.ts +8 -0
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts +10 -0
- package/lib/types/features/store/objects/components/index.d.ts +9 -0
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +3 -0
- package/lib/types/features/store/objects/index.d.ts +10 -0
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +16 -0
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +17 -0
- package/lib/types/features/store/objects/layout/index.d.ts +2 -0
- package/lib/types/features/store/objects/layout/renderers.d.ts +2 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +48 -0
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts +15 -0
- package/lib/types/features/store/objects/search/index.d.ts +2 -0
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts +25 -0
- package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts +27 -0
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts +15 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -0
- package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -0
- package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/index.d.ts +7 -0
- package/lib/types/features/store/objects/selection/index.d.ts +4 -0
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts +37 -0
- package/lib/types/features/store/objects/upload/index.d.ts +3 -0
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts +29 -0
- package/lib/types/features/store/objects/upload/useUploadHandler.d.ts +49 -0
- package/lib/types/features/store/types/ContentObjectTypeView.d.ts +5 -0
- package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts +5 -0
- package/lib/types/features/store/types/ContentObjectTypesTable.d.ts +7 -0
- package/lib/types/features/store/types/ContentObjectTypesView.d.ts +8 -0
- package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts +14 -0
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +7 -0
- package/lib/types/features/store/types/SelectContentType.d.ts +10 -0
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts +32 -0
- package/lib/types/features/store/types/TableLayoutEditor.d.ts +8 -0
- package/lib/types/features/store/types/index.d.ts +10 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchContext.d.ts +35 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchProvider.d.ts +10 -0
- package/lib/types/features/store/types/search/index.d.ts +2 -0
- package/lib/types/features/user/UserAvatar.d.ts +8 -0
- package/lib/types/features/user/UserInfo.d.ts +36 -0
- package/lib/types/features/user/index.d.ts +2 -0
- package/lib/types/features/utils/index.d.ts +3 -0
- package/lib/types/features/utils/mimeType.d.ts +4 -0
- package/lib/types/features/utils/rendition.d.ts +3 -0
- package/lib/types/features/utils/text.d.ts +2 -0
- package/lib/types/layout/Sidebar.d.ts +2 -1
- package/lib/types/widgets/Progress.d.ts +5 -0
- package/lib/types/widgets/form/schema.d.ts +4 -3
- package/lib/types/widgets/index.d.ts +4 -0
- package/lib/types/widgets/popover/Popover.d.ts +37 -0
- package/lib/types/widgets/popover/context.d.ts +7 -0
- package/lib/types/widgets/popover/index.d.ts +2 -0
- package/lib/types/widgets/popover/slots.d.ts +4 -0
- package/lib/types/widgets/properties/PropertiesView.d.ts +10 -0
- package/lib/types/widgets/properties/index.d.ts +1 -0
- package/lib/types/widgets/upload/DropZone.d.ts +40 -0
- package/lib/types/widgets/upload/UploadResultCategory.d.ts +25 -0
- package/lib/types/widgets/upload/UploadSummary.d.ts +37 -0
- package/lib/types/widgets/upload/index.d.ts +3 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +13 -5
- package/src/core/components/FormItem.tsx +35 -0
- package/src/core/components/InputList.tsx +4 -3
- package/src/core/components/index.ts +3 -3
- package/src/core/components/shadcn/button.tsx +68 -8
- package/src/core/components/shadcn/dialog.tsx +3 -3
- package/src/core/components/shadcn/filters/DynamicLabel.tsx +45 -0
- package/src/core/components/shadcn/filters/comboBox.tsx +56 -52
- package/src/core/components/shadcn/filters/dateFilter.tsx +24 -25
- package/src/core/components/shadcn/filters/filterBar.tsx +53 -47
- package/src/core/components/shadcn/filters/filters.tsx +43 -30
- package/src/core/components/shadcn/filters/selectFilter.tsx +53 -34
- package/src/core/components/shadcn/filters/textFilter.tsx +6 -3
- package/src/core/components/shadcn/filters/types.ts +8 -1
- package/src/core/components/shadcn/input.tsx +5 -5
- package/src/core/components/shadcn/selectBox.tsx +138 -33
- package/src/core/components/styles.ts +1 -1
- package/src/core/components/table/index.tsx +8 -0
- package/src/core/index.ts +2 -1
- package/src/core/utils/cn.ts +6 -0
- package/src/core/utils/index.ts +1 -0
- package/src/features/agent/PayloadBuilder.tsx +208 -0
- package/src/features/agent/chat/AnimatedThinkingDots.tsx +350 -0
- package/src/features/agent/chat/JumpingDots.tsx +16 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +708 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +246 -0
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +231 -0
- package/src/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.tsx +66 -0
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +282 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +125 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +562 -0
- package/src/features/agent/chat/ModernAgentOutput/MessagesContainer.tsx +51 -0
- package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +123 -0
- package/src/features/agent/chat/ModernAgentOutput/README-image-support.md +43 -0
- package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +72 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +96 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +185 -0
- package/src/features/agent/chat/ModernAgentOutput/StackedMessages.tsx +33 -0
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +167 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +195 -0
- package/src/features/agent/chat/ModernAgentOutput/with-types.d.ts +15 -0
- package/src/features/agent/chat/SlidingThinkingIndicator.tsx +459 -0
- package/src/features/agent/chat/WaitingMessages.ts +66 -0
- package/src/features/agent/chat/index.ts +4 -0
- package/src/features/agent/index.ts +2 -0
- package/src/features/errors/PanelErrorBoundary.tsx +30 -0
- package/src/features/errors/RowErrorBoundary.tsx +28 -0
- package/src/features/errors/VertesiaErrorBoundary.tsx +28 -0
- package/src/features/errors/WidgetErrorBoundary.tsx +27 -0
- package/src/features/errors/index.ts +4 -0
- package/src/features/facets/EnvironmentFacet.tsx +53 -0
- package/src/features/facets/FacetsNav.tsx +19 -0
- package/src/features/facets/InteractionFacet.tsx +53 -0
- package/src/features/facets/StringFacet.tsx +23 -0
- package/src/features/facets/StringListFacet.tsx +22 -0
- package/src/features/facets/TypeFacet.tsx +59 -0
- package/src/features/facets/TypeOptions.tsx +22 -0
- package/src/features/facets/UserFacet.tsx +61 -0
- package/src/features/facets/VFacetsNav.tsx +139 -0
- package/src/features/facets/VStringFacet.tsx +34 -0
- package/src/features/facets/VTypeFacet.tsx +72 -0
- package/src/features/facets/VUserFacet.tsx +47 -0
- package/src/features/facets/index.ts +11 -0
- package/src/features/facets/utils.tsx +9 -0
- package/src/features/index.ts +9 -1
- package/src/features/layout/GenericPageNavHeader.tsx +48 -0
- package/src/features/layout/NotFoundView.tsx +11 -0
- package/src/features/layout/index.ts +2 -0
- package/src/features/magic-pdf/DownloadPopover.tsx +32 -0
- package/src/features/magic-pdf/MagicPdfView.tsx +102 -0
- package/src/features/magic-pdf/PageSlider.tsx +112 -0
- package/src/features/magic-pdf/PdfPageProvider.tsx +229 -0
- package/src/features/magic-pdf/TextPageView.tsx +65 -0
- package/src/features/magic-pdf/index.ts +1 -0
- package/src/features/magic-pdf/types.ts +1 -0
- package/src/features/magic-pdf/useResizeOnDrag.ts +42 -0
- package/src/features/store/collections/BrowseCollectionView.tsx +45 -0
- package/src/features/store/collections/CollectionView.tsx +94 -0
- package/src/features/store/collections/CollectionsTable.tsx +115 -0
- package/src/features/store/collections/CollectionsView.tsx +166 -0
- package/src/features/store/collections/EditCollectionView.tsx +253 -0
- package/src/features/store/collections/index.ts +5 -0
- package/src/features/store/index.ts +3 -0
- package/src/features/store/objects/DocumentPreviewPanel.tsx +417 -0
- package/src/features/store/objects/DocumentSearchResults.tsx +209 -0
- package/src/features/store/objects/DocumentSelectionProvider.tsx +99 -0
- package/src/features/store/objects/DocumentTable.tsx +409 -0
- package/src/features/store/objects/ExportPropertiesModal.tsx +89 -0
- package/src/features/store/objects/components/ContentDispositionButton.tsx +45 -0
- package/src/features/store/objects/components/ContentOverview.tsx +466 -0
- package/src/features/store/objects/components/DocumentIcon.tsx +87 -0
- package/src/features/store/objects/components/DocumentInput.tsx +90 -0
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +253 -0
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +136 -0
- package/src/features/store/objects/components/SelectDocument.tsx +69 -0
- package/src/features/store/objects/components/SelectDocumentModal.tsx +20 -0
- package/src/features/store/objects/components/VectorSearchWidget.tsx +115 -0
- package/src/features/store/objects/components/index.ts +9 -0
- package/src/features/store/objects/components/useDownloadObject.ts +24 -0
- package/src/features/store/objects/index.ts +10 -0
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +84 -0
- package/src/features/store/objects/layout/documentLayout.tsx +69 -0
- package/src/features/store/objects/layout/index.ts +2 -0
- package/src/features/store/objects/layout/knowledge.md +238 -0
- package/src/features/store/objects/layout/renderers.tsx +139 -0
- package/src/features/store/objects/search/DocumentSearchContext.ts +181 -0
- package/src/features/store/objects/search/DocumentSearchProvider.tsx +54 -0
- package/src/features/store/objects/search/index.ts +2 -0
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +196 -0
- package/src/features/store/objects/selection/ObjectsActionSpec.ts +31 -0
- package/src/features/store/objects/selection/SelectionActions.tsx +160 -0
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +114 -0
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +76 -0
- package/src/features/store/objects/selection/actions/ConfirmAction.tsx +46 -0
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +77 -0
- package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +117 -0
- package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +77 -0
- package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +122 -0
- package/src/features/store/objects/selection/actions/index.ts +7 -0
- package/src/features/store/objects/selection/index.ts +4 -0
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +970 -0
- package/src/features/store/objects/upload/index.ts +3 -0
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +250 -0
- package/src/features/store/objects/upload/useUploadHandler.ts +325 -0
- package/src/features/store/types/ContentObjectTypeView.tsx +244 -0
- package/src/features/store/types/ContentObjectTypesSearch.tsx +111 -0
- package/src/features/store/types/ContentObjectTypesTable.tsx +38 -0
- package/src/features/store/types/ContentObjectTypesView.tsx +71 -0
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +70 -0
- package/src/features/store/types/ObjectSchemaEditor.tsx +127 -0
- package/src/features/store/types/SelectContentType.tsx +88 -0
- package/src/features/store/types/SelectContentTypeModal.tsx +142 -0
- package/src/features/store/types/TableLayoutEditor.tsx +104 -0
- package/src/features/store/types/index.ts +10 -0
- package/src/features/store/types/search/ObjectTypeSearchContext.tsx +119 -0
- package/src/features/store/types/search/ObjectTypeSearchProvider.tsx +24 -0
- package/src/features/store/types/search/index.ts +2 -0
- package/src/features/user/UserAvatar.tsx +34 -0
- package/src/features/user/UserInfo.tsx +215 -0
- package/src/features/user/index.ts +2 -0
- package/src/features/utils/index.ts +3 -0
- package/src/features/utils/mimeType.ts +9 -0
- package/src/features/utils/rendition.ts +75 -0
- package/src/features/utils/text.ts +10 -0
- package/src/layout/FullHeightLayout.tsx +1 -1
- package/src/layout/Sidebar.tsx +12 -2
- package/src/widgets/Progress.tsx +10 -0
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +1 -1
- package/src/widgets/form/Form.tsx +2 -2
- package/src/widgets/form/schema.ts +14 -7
- package/src/widgets/index.ts +5 -1
- package/src/widgets/popover/Popover.tsx +171 -0
- package/src/widgets/popover/context.ts +15 -0
- package/src/widgets/popover/index.ts +2 -0
- package/src/widgets/popover/slots.ts +24 -0
- package/src/widgets/properties/PropertiesView.tsx +26 -0
- package/src/widgets/properties/index.ts +1 -0
- package/src/widgets/schema-editor/JSONSchemaEditorModal.tsx +1 -2
- package/src/widgets/schema-editor/editor/Editable.tsx +12 -13
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +1 -1
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +4 -4
- package/src/widgets/upload/DropZone.tsx +257 -0
- package/src/widgets/upload/UploadResultCategory.tsx +81 -0
- package/src/widgets/upload/UploadSummary.tsx +116 -0
- package/src/widgets/upload/index.ts +3 -0
- package/lib/esm/code/index.js +0 -3
- package/lib/esm/code/index.js.map +0 -1
- package/lib/esm/core/components/Input.js +0 -16
- package/lib/esm/core/components/Input.js.map +0 -1
- package/lib/esm/form/index.js +0 -3
- package/lib/esm/form/index.js.map +0 -1
- package/lib/types/code/index.d.ts +0 -0
- package/lib/types/core/components/Input.d.ts +0 -8
- package/lib/types/form/index.d.ts +0 -0
- package/lib/vertesia-ui-code.js +0 -2
- package/lib/vertesia-ui-code.js.map +0 -1
- package/lib/vertesia-ui-form.js +0 -2
- package/lib/vertesia-ui-form.js.map +0 -1
- package/src/code/index.ts +0 -1
- package/src/core/components/Input.tsx +0 -43
- package/src/form/index.ts +0 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { ContentObjectItem } from "@vertesia/common";
|
|
2
|
+
import { useToast } from "@vertesia/ui/core";
|
|
3
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
4
|
+
import { Md5 } from "ts-md5";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Types of actions that can be taken with a file
|
|
8
|
+
*/
|
|
9
|
+
export enum FileUploadAction {
|
|
10
|
+
CREATE = "create", // New document, not in system
|
|
11
|
+
SKIP = "skip", // Document exists, identical, no action needed
|
|
12
|
+
UPDATE = "update", // Document exists but needs updating
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Interface for file metadata with hash information
|
|
17
|
+
*/
|
|
18
|
+
export interface FileWithMetadata {
|
|
19
|
+
file: File;
|
|
20
|
+
hash?: string;
|
|
21
|
+
name: string;
|
|
22
|
+
size: number;
|
|
23
|
+
location?: string;
|
|
24
|
+
// Optional existing object ID if found
|
|
25
|
+
existingId?: string;
|
|
26
|
+
// Action to take with this file
|
|
27
|
+
action?: FileUploadAction;
|
|
28
|
+
// Any additional metadata needed
|
|
29
|
+
metadata?: Record<string, any>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Calculates the MD5 hash of a file
|
|
34
|
+
* @param file The file to hash
|
|
35
|
+
* @returns Promise with the MD5 hash of the file
|
|
36
|
+
*/
|
|
37
|
+
async function calculateFileHash(file: File): Promise<string | undefined> {
|
|
38
|
+
try {
|
|
39
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
40
|
+
const md5 = new Md5();
|
|
41
|
+
md5.appendByteArray(new Uint8Array(arrayBuffer));
|
|
42
|
+
const hash = md5.end();
|
|
43
|
+
return hash?.toString();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error("Error calculating file hash:", error);
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Prepares files by calculating their hashes and metadata
|
|
52
|
+
* @param files Array of files to process
|
|
53
|
+
* @param selectedFolder Optional folder location for the files
|
|
54
|
+
* @returns Promise with array of files with their metadata
|
|
55
|
+
*/
|
|
56
|
+
async function prepareFilesWithMetadata(files: File[], selectedFolder?: string | null): Promise<FileWithMetadata[]> {
|
|
57
|
+
const filesWithMetadata: FileWithMetadata[] = [];
|
|
58
|
+
|
|
59
|
+
// Process files in batches to avoid overwhelming the browser
|
|
60
|
+
const batchSize = 5;
|
|
61
|
+
for (let i = 0; i < files.length; i += batchSize) {
|
|
62
|
+
const batch = files.slice(i, i + batchSize);
|
|
63
|
+
|
|
64
|
+
// Process this batch in parallel
|
|
65
|
+
const metadataResults = await Promise.all(
|
|
66
|
+
batch.map(async (file) => {
|
|
67
|
+
// Determine the location for this file
|
|
68
|
+
let location = selectedFolder || undefined;
|
|
69
|
+
|
|
70
|
+
// If file has relative path, use it to determine location
|
|
71
|
+
const hasRelativePath = !!(file as any).webkitRelativePath;
|
|
72
|
+
if (hasRelativePath) {
|
|
73
|
+
const relativePath = (file as any).webkitRelativePath;
|
|
74
|
+
const pathParts = relativePath.split("/");
|
|
75
|
+
|
|
76
|
+
if (pathParts.length > 1) {
|
|
77
|
+
// Extract folder path (everything except the filename)
|
|
78
|
+
const folderPath = pathParts.slice(0, -1).join("/");
|
|
79
|
+
|
|
80
|
+
// Combine with selected folder if any
|
|
81
|
+
location = selectedFolder ? `${selectedFolder}/${folderPath}` : folderPath;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Calculate hash for content comparison
|
|
86
|
+
const hash = await calculateFileHash(file);
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
file,
|
|
90
|
+
hash,
|
|
91
|
+
name: file.name,
|
|
92
|
+
size: file.size,
|
|
93
|
+
location,
|
|
94
|
+
};
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
filesWithMetadata.push(...metadataResults);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return filesWithMetadata;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Hook to check if documents need to be created, updated, or skipped
|
|
106
|
+
* @param collectionId Optional collection ID to check within
|
|
107
|
+
* @returns Object with functions to process documents
|
|
108
|
+
*/
|
|
109
|
+
export function useSmartFileUploadProcessing() {
|
|
110
|
+
const { client } = useUserSession();
|
|
111
|
+
const toast = useToast();
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Check files to determine if they need to be created, updated, or skipped
|
|
115
|
+
* @param files Array of files to check
|
|
116
|
+
* @param selectedFolder Optional folder location
|
|
117
|
+
* @param collectionId limit the check to a collection
|
|
118
|
+
* @returns Promise with information about actions to take for each file
|
|
119
|
+
*/
|
|
120
|
+
const prepareFilesForUpload = async (
|
|
121
|
+
files: File[],
|
|
122
|
+
selectedFolder?: string | null,
|
|
123
|
+
limitToCollectionId?: string,
|
|
124
|
+
): Promise<FileWithMetadata[]> => {
|
|
125
|
+
try {
|
|
126
|
+
// First, prepare all the files with their metadata
|
|
127
|
+
console.log(`Preparing metadata for ${files.length} files...`);
|
|
128
|
+
const filesWithMetadata = await prepareFilesWithMetadata(files, selectedFolder);
|
|
129
|
+
|
|
130
|
+
const identifyExistingHash = async () => {
|
|
131
|
+
const query = {
|
|
132
|
+
"content.etag": { $in: filesWithMetadata.map((file) => file.hash) },
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
let res: ContentObjectItem[];
|
|
136
|
+
|
|
137
|
+
if (limitToCollectionId) {
|
|
138
|
+
res = await client.store.collections.searchMembers(limitToCollectionId, {
|
|
139
|
+
query: {
|
|
140
|
+
match: query,
|
|
141
|
+
},
|
|
142
|
+
select: undefined,
|
|
143
|
+
});
|
|
144
|
+
} else {
|
|
145
|
+
res = await client.store.objects.search({
|
|
146
|
+
query: { match: query },
|
|
147
|
+
select: undefined,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
for (const doc of res) {
|
|
152
|
+
const file = filesWithMetadata.find((f) => f.hash === doc.content.etag);
|
|
153
|
+
if (file) {
|
|
154
|
+
file.existingId = doc.id;
|
|
155
|
+
file.action = FileUploadAction.SKIP;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Find what file are present based on location and name
|
|
162
|
+
*/
|
|
163
|
+
const identifyExistingIds = async () => {
|
|
164
|
+
const unskippedFiles = filesWithMetadata.filter((file) => file.action !== FileUploadAction.SKIP);
|
|
165
|
+
const allLocations = unskippedFiles.map((file) => file.location);
|
|
166
|
+
const uniqueLocations = Array.from(new Set(allLocations));
|
|
167
|
+
|
|
168
|
+
const queries = [];
|
|
169
|
+
for (const location of uniqueLocations) {
|
|
170
|
+
const namesInLocation = unskippedFiles
|
|
171
|
+
.filter((file) => file.location === location)
|
|
172
|
+
.map((file) => file.name);
|
|
173
|
+
const query = {
|
|
174
|
+
location: location ?? "",
|
|
175
|
+
"content.name": { $in: namesInLocation },
|
|
176
|
+
};
|
|
177
|
+
if (limitToCollectionId) {
|
|
178
|
+
const res = client.store.collections.searchMembers(limitToCollectionId, {
|
|
179
|
+
query: {
|
|
180
|
+
match: query,
|
|
181
|
+
},
|
|
182
|
+
select: undefined,
|
|
183
|
+
});
|
|
184
|
+
queries.push(res);
|
|
185
|
+
} else {
|
|
186
|
+
const res = client.store.objects.find({
|
|
187
|
+
query: {
|
|
188
|
+
match: query,
|
|
189
|
+
},
|
|
190
|
+
select: undefined,
|
|
191
|
+
});
|
|
192
|
+
queries.push(res);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const results = (await Promise.all(queries)).flat();
|
|
197
|
+
console.log(`Found ${results.length} document to update`, results);
|
|
198
|
+
|
|
199
|
+
//update fileWithMetadata
|
|
200
|
+
for (const doc of results) {
|
|
201
|
+
const file = filesWithMetadata.find(
|
|
202
|
+
//name must be the same, and location must the same if present and if not, must be empty string
|
|
203
|
+
(f) =>
|
|
204
|
+
f.name === doc.content.name &&
|
|
205
|
+
(f.location ? f.location === doc.location : doc.location === ""),
|
|
206
|
+
);
|
|
207
|
+
if (file) {
|
|
208
|
+
file.existingId = doc.id;
|
|
209
|
+
file.action = FileUploadAction.UPDATE;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
console.log(
|
|
213
|
+
`Reconciled ${filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length}`,
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
await identifyExistingHash();
|
|
218
|
+
await identifyExistingIds();
|
|
219
|
+
|
|
220
|
+
//set create flag on remaining files
|
|
221
|
+
filesWithMetadata.forEach((f) => {
|
|
222
|
+
if (!f.action) {
|
|
223
|
+
f.action = FileUploadAction.CREATE;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Log the results
|
|
228
|
+
console.log("Document processing check results:", {
|
|
229
|
+
totalFiles: files.length,
|
|
230
|
+
toCreate: filesWithMetadata.filter((f) => f.action === FileUploadAction.CREATE).length,
|
|
231
|
+
toUpdate: filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length,
|
|
232
|
+
toSkip: filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP).length,
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
return filesWithMetadata;
|
|
236
|
+
} catch (error: any) {
|
|
237
|
+
toast({
|
|
238
|
+
title: "Error in file upload processing check",
|
|
239
|
+
status: "error",
|
|
240
|
+
description: error.message,
|
|
241
|
+
});
|
|
242
|
+
console.log("Error in file upload processing check", error);
|
|
243
|
+
throw new Error("Error in file upload processing check: " + error.message);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
return {
|
|
248
|
+
checkDocumentProcessing: prepareFilesForUpload,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { useToast } from "@vertesia/ui/core";
|
|
2
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
3
|
+
import { useDocumentSearch } from "../search/DocumentSearchContext";
|
|
4
|
+
import { FileUploadAction, useSmartFileUploadProcessing } from "./useSmartFileUploadProcessing";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Hook configuration for useUploadHandler
|
|
9
|
+
*/
|
|
10
|
+
export interface UploadHandlerOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Callback to be called after upload is done with the created object IDs
|
|
13
|
+
*/
|
|
14
|
+
onUploadDone: (objectIds: string[]) => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Result of the upload process
|
|
19
|
+
*/
|
|
20
|
+
export interface DocumentUploadResult {
|
|
21
|
+
/** Whether the upload was successful overall */
|
|
22
|
+
success: boolean;
|
|
23
|
+
/** IDs of all processed objects (both newly uploaded and existing) */
|
|
24
|
+
objectIds: string[];
|
|
25
|
+
/** Newly uploaded files information */
|
|
26
|
+
uploadedFiles: UploadedFileInfo[];
|
|
27
|
+
/** Files that were skipped (already existed) */
|
|
28
|
+
skippedFiles: UploadedFileInfo[];
|
|
29
|
+
/** Files that failed to upload */
|
|
30
|
+
failedFiles: UploadedFileInfo[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Information about a successfully uploaded file
|
|
35
|
+
*/
|
|
36
|
+
interface UploadedFileInfo {
|
|
37
|
+
/** The ID of the uploaded object */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** The name of the file */
|
|
40
|
+
name: string;
|
|
41
|
+
/** The name of the file */
|
|
42
|
+
location?: string;
|
|
43
|
+
/** The status of the upload */
|
|
44
|
+
status: "created" | "updated" | "skipped" | "failed";
|
|
45
|
+
/** The type of the object */
|
|
46
|
+
type: string | null;
|
|
47
|
+
/** Has there been any Error */
|
|
48
|
+
error?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Hook for handling file uploads to the store
|
|
53
|
+
*
|
|
54
|
+
* @param options Configuration options for the upload handler
|
|
55
|
+
* @returns Upload handler function that takes files and type, and returns upload results
|
|
56
|
+
*/
|
|
57
|
+
export function useDocumentUploadHandler(options: UploadHandlerOptions | ((objectIds: string[]) => Promise<void>)) {
|
|
58
|
+
// Handle both object and legacy function format for backward compatibility
|
|
59
|
+
const onUploadDone = typeof options === "function" ? options : options.onUploadDone;
|
|
60
|
+
const { client, project: projectRef, store } = useUserSession();
|
|
61
|
+
const search = useDocumentSearch();
|
|
62
|
+
const toast = useToast();
|
|
63
|
+
const { checkDocumentProcessing } = useSmartFileUploadProcessing();
|
|
64
|
+
|
|
65
|
+
return async (files: File[], type: string | null, collectionId?: string): Promise<DocumentUploadResult> => {
|
|
66
|
+
// Initialize result object
|
|
67
|
+
const result: DocumentUploadResult = {
|
|
68
|
+
success: false,
|
|
69
|
+
objectIds: [],
|
|
70
|
+
uploadedFiles: [],
|
|
71
|
+
skippedFiles: [],
|
|
72
|
+
failedFiles: [],
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
if (!projectRef) {
|
|
76
|
+
toast({
|
|
77
|
+
status: "error",
|
|
78
|
+
title: "No project selected",
|
|
79
|
+
duration: 3000,
|
|
80
|
+
});
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (!files || files.length === 0) {
|
|
85
|
+
toast({
|
|
86
|
+
status: "warning",
|
|
87
|
+
title: "No files selected",
|
|
88
|
+
duration: 3000,
|
|
89
|
+
});
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const filesToUpload = Array.from(files).filter((file) => file.size > 0);
|
|
94
|
+
|
|
95
|
+
if (filesToUpload.length === 0) {
|
|
96
|
+
toast({
|
|
97
|
+
status: "error",
|
|
98
|
+
title: "No valid files selected",
|
|
99
|
+
description: "Please select files with valid content.",
|
|
100
|
+
duration: 5000,
|
|
101
|
+
});
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const skippedFilesInfo: UploadedFileInfo[] = [];
|
|
106
|
+
const uploadedFilesInfo: UploadedFileInfo[] = [];
|
|
107
|
+
const failedFilesInfo: UploadedFileInfo[] = [];
|
|
108
|
+
|
|
109
|
+
console.log(`Processing ${filesToUpload.length} files with smart file processing...`);
|
|
110
|
+
|
|
111
|
+
// Determine if what need to be updated
|
|
112
|
+
const filesWithMetadata = await checkDocumentProcessing(filesToUpload, null, collectionId);
|
|
113
|
+
|
|
114
|
+
// Create statistics for user feedback
|
|
115
|
+
const toCreate = filesWithMetadata.filter((f) => f.action === FileUploadAction.CREATE).length;
|
|
116
|
+
const toUpdate = filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length;
|
|
117
|
+
const toSkip = filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP).length;
|
|
118
|
+
|
|
119
|
+
// Show user feedback about processed files
|
|
120
|
+
toast({
|
|
121
|
+
title: "Files analyzed",
|
|
122
|
+
description: `${filesToUpload.length} file(s): ${toCreate} new, ${toUpdate} to update, ${toSkip} to skip`,
|
|
123
|
+
status: "info",
|
|
124
|
+
duration: 4000,
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Process SKIP files - add them to skipped list and result IDs
|
|
128
|
+
for (const fileInfo of filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP && f.existingId)) {
|
|
129
|
+
skippedFilesInfo.push({
|
|
130
|
+
id: fileInfo.existingId,
|
|
131
|
+
name: fileInfo.name,
|
|
132
|
+
type,
|
|
133
|
+
status: "skipped",
|
|
134
|
+
location: fileInfo.location,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Collect files for processing (both CREATE and UPDATE)
|
|
139
|
+
const filesToProcess = filesWithMetadata.filter(
|
|
140
|
+
(f) => (f.action === FileUploadAction.CREATE || f.action === FileUploadAction.UPDATE) && f.file,
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (filesToProcess.length > 0) {
|
|
144
|
+
console.log(
|
|
145
|
+
`Processing ${filesToProcess.length} files (${filesToProcess.filter((f) => f.action === FileUploadAction.CREATE).length
|
|
146
|
+
} create, ${filesToProcess.filter((f) => f.action === FileUploadAction.UPDATE).length} update)...`,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
// Create batches of 50 files
|
|
150
|
+
const batchSize = 50;
|
|
151
|
+
const processBatches = [];
|
|
152
|
+
|
|
153
|
+
for (let i = 0; i < filesToProcess.length; i += batchSize) {
|
|
154
|
+
processBatches.push(filesToProcess.slice(i, i + batchSize));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Process each batch
|
|
158
|
+
for (let batchIndex = 0; batchIndex < processBatches.length; batchIndex++) {
|
|
159
|
+
const batch = processBatches[batchIndex];
|
|
160
|
+
const processedCount = batchIndex * batchSize;
|
|
161
|
+
|
|
162
|
+
console.log(`Processing batch ${batchIndex + 1}/${processBatches.length} (${batch.length} files)`);
|
|
163
|
+
|
|
164
|
+
// Show progress for larger file sets
|
|
165
|
+
if (filesToProcess.length > batchSize) {
|
|
166
|
+
toast({
|
|
167
|
+
title: "Processing files",
|
|
168
|
+
description: `Processed ${processedCount}/${filesToProcess.length} files...`,
|
|
169
|
+
status: "info",
|
|
170
|
+
duration: 2000,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Process this batch in parallel
|
|
175
|
+
const processResults = await Promise.all(
|
|
176
|
+
batch.map(async (fileInfo) => {
|
|
177
|
+
try {
|
|
178
|
+
if (fileInfo.action === FileUploadAction.UPDATE && fileInfo.existingId) {
|
|
179
|
+
// UPDATE - Update the existing object
|
|
180
|
+
const updateResult = await client.store.objects.update(
|
|
181
|
+
fileInfo.existingId,
|
|
182
|
+
{
|
|
183
|
+
type: type || undefined,
|
|
184
|
+
content: fileInfo.file,
|
|
185
|
+
location: fileInfo.location,
|
|
186
|
+
name: fileInfo.name,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
createRevision: true,
|
|
190
|
+
revisionLabel: "upload on " + new Date().toISOString(),
|
|
191
|
+
},
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
// Use a separate data structure for updated files
|
|
195
|
+
uploadedFilesInfo.push({
|
|
196
|
+
id: fileInfo.existingId,
|
|
197
|
+
name: fileInfo.name,
|
|
198
|
+
type,
|
|
199
|
+
status: "updated",
|
|
200
|
+
location: fileInfo.location,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
// Add to result IDs
|
|
204
|
+
result.objectIds.push(fileInfo.existingId);
|
|
205
|
+
|
|
206
|
+
return {
|
|
207
|
+
success: true,
|
|
208
|
+
id: updateResult.id,
|
|
209
|
+
name: fileInfo.name,
|
|
210
|
+
action: "update",
|
|
211
|
+
};
|
|
212
|
+
} else {
|
|
213
|
+
// CREATE - Create a new object
|
|
214
|
+
// If collectionId is provided, pass it as an option
|
|
215
|
+
const options = collectionId ? { collection_id: collectionId } : undefined;
|
|
216
|
+
const createResult = await store.objects.create(
|
|
217
|
+
{
|
|
218
|
+
type: type || undefined,
|
|
219
|
+
content: fileInfo.file,
|
|
220
|
+
location:
|
|
221
|
+
fileInfo.location || fileInfo.file.webkitRelativePath || fileInfo.name,
|
|
222
|
+
},
|
|
223
|
+
options,
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
// Track successful upload
|
|
227
|
+
uploadedFilesInfo.push({
|
|
228
|
+
id: createResult.id,
|
|
229
|
+
name: fileInfo.name,
|
|
230
|
+
type,
|
|
231
|
+
status: "created",
|
|
232
|
+
location: fileInfo.location,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
} catch (error: any) {
|
|
236
|
+
console.error(`Failed to process file ${fileInfo.name}:`, error);
|
|
237
|
+
|
|
238
|
+
// Track failed upload
|
|
239
|
+
failedFilesInfo.push({
|
|
240
|
+
name: fileInfo.name,
|
|
241
|
+
error: error.message || "Unknown error",
|
|
242
|
+
status: "failed",
|
|
243
|
+
location: fileInfo.location,
|
|
244
|
+
type,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
toast({
|
|
248
|
+
status: "error",
|
|
249
|
+
title: `Processing failed for ${fileInfo.name}`,
|
|
250
|
+
description: error.message,
|
|
251
|
+
duration: 4000,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}),
|
|
255
|
+
);
|
|
256
|
+
|
|
257
|
+
// Log batch results
|
|
258
|
+
const creates = uploadedFilesInfo.filter((f) => f.status === "created");
|
|
259
|
+
const updates = uploadedFilesInfo.filter((f) => f.status === "updated");
|
|
260
|
+
const failures = uploadedFilesInfo.filter((f) => f.status === "failed");
|
|
261
|
+
|
|
262
|
+
console.log(`Batch ${batchIndex + 1} results:`, {
|
|
263
|
+
creates,
|
|
264
|
+
updates,
|
|
265
|
+
failures,
|
|
266
|
+
total: processResults.length,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const uploadedCount = uploadedFilesInfo.filter((f) => f.status === "created").length;
|
|
272
|
+
const updatedCount = uploadedFilesInfo.filter((f) => f.status === "updated").length;
|
|
273
|
+
const failedCount = uploadedFilesInfo.filter((f) => f.status === "failed").length;
|
|
274
|
+
const skippedCount = uploadedFilesInfo.filter((f) => f.status === "skipped").length;
|
|
275
|
+
|
|
276
|
+
// Call the original callback with all object IDs and additional metadata
|
|
277
|
+
if (onUploadDone) {
|
|
278
|
+
// Log the actual upload count for debugging
|
|
279
|
+
console.log("Upload complete:", {
|
|
280
|
+
totalObjectIds: result.objectIds.length,
|
|
281
|
+
uploadedFiles: uploadedCount,
|
|
282
|
+
updatedFiles: updatedCount,
|
|
283
|
+
skippedFiles: skippedCount,
|
|
284
|
+
failedFiles: failedCount,
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
// Call the callback with all object IDs
|
|
288
|
+
await onUploadDone(result.objectIds);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Create a success message that includes information about all file operations
|
|
292
|
+
let statusMessage = "";
|
|
293
|
+
|
|
294
|
+
if (uploadedCount > 0) {
|
|
295
|
+
statusMessage += `${uploadedCount} file${uploadedCount !== 1 ? "s" : ""} uploaded`;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (updatedCount > 0) {
|
|
299
|
+
statusMessage += statusMessage ? ", " : "";
|
|
300
|
+
statusMessage += `${updatedCount} file${updatedCount !== 1 ? "s" : ""} updated`;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (skippedCount > 0) {
|
|
304
|
+
statusMessage += statusMessage ? ", " : "";
|
|
305
|
+
statusMessage += `${skippedCount} file${skippedCount !== 1 ? "s" : ""} skipped (already existed)`;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
if (failedCount > 0) {
|
|
309
|
+
statusMessage += statusMessage ? ", " : "";
|
|
310
|
+
statusMessage += `${failedCount} file${failedCount !== 1 ? "s" : ""} failed`;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if (statusMessage) {
|
|
314
|
+
toast({
|
|
315
|
+
status: failedCount > 0 ? "warning" : "success",
|
|
316
|
+
title: statusMessage,
|
|
317
|
+
duration: 4000,
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// Refresh search results
|
|
322
|
+
search.search();
|
|
323
|
+
return result;
|
|
324
|
+
};
|
|
325
|
+
}
|