@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,201 @@
|
|
|
1
|
+
import { useToast } from "@vertesia/ui/core";
|
|
2
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
3
|
+
import { Md5 } from "ts-md5";
|
|
4
|
+
/**
|
|
5
|
+
* Types of actions that can be taken with a file
|
|
6
|
+
*/
|
|
7
|
+
export var FileUploadAction;
|
|
8
|
+
(function (FileUploadAction) {
|
|
9
|
+
FileUploadAction["CREATE"] = "create";
|
|
10
|
+
FileUploadAction["SKIP"] = "skip";
|
|
11
|
+
FileUploadAction["UPDATE"] = "update";
|
|
12
|
+
})(FileUploadAction || (FileUploadAction = {}));
|
|
13
|
+
/**
|
|
14
|
+
* Calculates the MD5 hash of a file
|
|
15
|
+
* @param file The file to hash
|
|
16
|
+
* @returns Promise with the MD5 hash of the file
|
|
17
|
+
*/
|
|
18
|
+
async function calculateFileHash(file) {
|
|
19
|
+
try {
|
|
20
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
21
|
+
const md5 = new Md5();
|
|
22
|
+
md5.appendByteArray(new Uint8Array(arrayBuffer));
|
|
23
|
+
const hash = md5.end();
|
|
24
|
+
return hash?.toString();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error("Error calculating file hash:", error);
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Prepares files by calculating their hashes and metadata
|
|
33
|
+
* @param files Array of files to process
|
|
34
|
+
* @param selectedFolder Optional folder location for the files
|
|
35
|
+
* @returns Promise with array of files with their metadata
|
|
36
|
+
*/
|
|
37
|
+
async function prepareFilesWithMetadata(files, selectedFolder) {
|
|
38
|
+
const filesWithMetadata = [];
|
|
39
|
+
// Process files in batches to avoid overwhelming the browser
|
|
40
|
+
const batchSize = 5;
|
|
41
|
+
for (let i = 0; i < files.length; i += batchSize) {
|
|
42
|
+
const batch = files.slice(i, i + batchSize);
|
|
43
|
+
// Process this batch in parallel
|
|
44
|
+
const metadataResults = await Promise.all(batch.map(async (file) => {
|
|
45
|
+
// Determine the location for this file
|
|
46
|
+
let location = selectedFolder || undefined;
|
|
47
|
+
// If file has relative path, use it to determine location
|
|
48
|
+
const hasRelativePath = !!file.webkitRelativePath;
|
|
49
|
+
if (hasRelativePath) {
|
|
50
|
+
const relativePath = file.webkitRelativePath;
|
|
51
|
+
const pathParts = relativePath.split("/");
|
|
52
|
+
if (pathParts.length > 1) {
|
|
53
|
+
// Extract folder path (everything except the filename)
|
|
54
|
+
const folderPath = pathParts.slice(0, -1).join("/");
|
|
55
|
+
// Combine with selected folder if any
|
|
56
|
+
location = selectedFolder ? `${selectedFolder}/${folderPath}` : folderPath;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Calculate hash for content comparison
|
|
60
|
+
const hash = await calculateFileHash(file);
|
|
61
|
+
return {
|
|
62
|
+
file,
|
|
63
|
+
hash,
|
|
64
|
+
name: file.name,
|
|
65
|
+
size: file.size,
|
|
66
|
+
location,
|
|
67
|
+
};
|
|
68
|
+
}));
|
|
69
|
+
filesWithMetadata.push(...metadataResults);
|
|
70
|
+
}
|
|
71
|
+
return filesWithMetadata;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Hook to check if documents need to be created, updated, or skipped
|
|
75
|
+
* @param collectionId Optional collection ID to check within
|
|
76
|
+
* @returns Object with functions to process documents
|
|
77
|
+
*/
|
|
78
|
+
export function useSmartFileUploadProcessing() {
|
|
79
|
+
const { client } = useUserSession();
|
|
80
|
+
const toast = useToast();
|
|
81
|
+
/**
|
|
82
|
+
* Check files to determine if they need to be created, updated, or skipped
|
|
83
|
+
* @param files Array of files to check
|
|
84
|
+
* @param selectedFolder Optional folder location
|
|
85
|
+
* @param collectionId limit the check to a collection
|
|
86
|
+
* @returns Promise with information about actions to take for each file
|
|
87
|
+
*/
|
|
88
|
+
const prepareFilesForUpload = async (files, selectedFolder, limitToCollectionId) => {
|
|
89
|
+
try {
|
|
90
|
+
// First, prepare all the files with their metadata
|
|
91
|
+
console.log(`Preparing metadata for ${files.length} files...`);
|
|
92
|
+
const filesWithMetadata = await prepareFilesWithMetadata(files, selectedFolder);
|
|
93
|
+
const identifyExistingHash = async () => {
|
|
94
|
+
const query = {
|
|
95
|
+
"content.etag": { $in: filesWithMetadata.map((file) => file.hash) },
|
|
96
|
+
};
|
|
97
|
+
let res;
|
|
98
|
+
if (limitToCollectionId) {
|
|
99
|
+
res = await client.store.collections.searchMembers(limitToCollectionId, {
|
|
100
|
+
query: {
|
|
101
|
+
match: query,
|
|
102
|
+
},
|
|
103
|
+
select: undefined,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
res = await client.store.objects.search({
|
|
108
|
+
query: { match: query },
|
|
109
|
+
select: undefined,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
for (const doc of res) {
|
|
113
|
+
const file = filesWithMetadata.find((f) => f.hash === doc.content.etag);
|
|
114
|
+
if (file) {
|
|
115
|
+
file.existingId = doc.id;
|
|
116
|
+
file.action = FileUploadAction.SKIP;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Find what file are present based on location and name
|
|
122
|
+
*/
|
|
123
|
+
const identifyExistingIds = async () => {
|
|
124
|
+
const unskippedFiles = filesWithMetadata.filter((file) => file.action !== FileUploadAction.SKIP);
|
|
125
|
+
const allLocations = unskippedFiles.map((file) => file.location);
|
|
126
|
+
const uniqueLocations = Array.from(new Set(allLocations));
|
|
127
|
+
const queries = [];
|
|
128
|
+
for (const location of uniqueLocations) {
|
|
129
|
+
const namesInLocation = unskippedFiles
|
|
130
|
+
.filter((file) => file.location === location)
|
|
131
|
+
.map((file) => file.name);
|
|
132
|
+
const query = {
|
|
133
|
+
location: location ?? "",
|
|
134
|
+
"content.name": { $in: namesInLocation },
|
|
135
|
+
};
|
|
136
|
+
if (limitToCollectionId) {
|
|
137
|
+
const res = client.store.collections.searchMembers(limitToCollectionId, {
|
|
138
|
+
query: {
|
|
139
|
+
match: query,
|
|
140
|
+
},
|
|
141
|
+
select: undefined,
|
|
142
|
+
});
|
|
143
|
+
queries.push(res);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
const res = client.store.objects.find({
|
|
147
|
+
query: {
|
|
148
|
+
match: query,
|
|
149
|
+
},
|
|
150
|
+
select: undefined,
|
|
151
|
+
});
|
|
152
|
+
queries.push(res);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const results = (await Promise.all(queries)).flat();
|
|
156
|
+
console.log(`Found ${results.length} document to update`, results);
|
|
157
|
+
//update fileWithMetadata
|
|
158
|
+
for (const doc of results) {
|
|
159
|
+
const file = filesWithMetadata.find(
|
|
160
|
+
//name must be the same, and location must the same if present and if not, must be empty string
|
|
161
|
+
(f) => f.name === doc.content.name &&
|
|
162
|
+
(f.location ? f.location === doc.location : doc.location === ""));
|
|
163
|
+
if (file) {
|
|
164
|
+
file.existingId = doc.id;
|
|
165
|
+
file.action = FileUploadAction.UPDATE;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
console.log(`Reconciled ${filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length}`);
|
|
169
|
+
};
|
|
170
|
+
await identifyExistingHash();
|
|
171
|
+
await identifyExistingIds();
|
|
172
|
+
//set create flag on remaining files
|
|
173
|
+
filesWithMetadata.forEach((f) => {
|
|
174
|
+
if (!f.action) {
|
|
175
|
+
f.action = FileUploadAction.CREATE;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
// Log the results
|
|
179
|
+
console.log("Document processing check results:", {
|
|
180
|
+
totalFiles: files.length,
|
|
181
|
+
toCreate: filesWithMetadata.filter((f) => f.action === FileUploadAction.CREATE).length,
|
|
182
|
+
toUpdate: filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length,
|
|
183
|
+
toSkip: filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP).length,
|
|
184
|
+
});
|
|
185
|
+
return filesWithMetadata;
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
toast({
|
|
189
|
+
title: "Error in file upload processing check",
|
|
190
|
+
status: "error",
|
|
191
|
+
description: error.message,
|
|
192
|
+
});
|
|
193
|
+
console.log("Error in file upload processing check", error);
|
|
194
|
+
throw new Error("Error in file upload processing check: " + error.message);
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
checkDocumentProcessing: prepareFilesForUpload,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=useSmartFileUploadProcessing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSmartFileUploadProcessing.js","sourceRoot":"","sources":["../../../../../../src/features/store/objects/upload/useSmartFileUploadProcessing.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,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AK,CAAC,MAAM;gBACxB,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,MAAM;gBACtF,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,MAAM,CAAC,CAAC,MAAM;gBACtF,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAAC,MAAM;aACrF,CAAC,CAAC;YAEH,OAAO,iBAAiB,CAAC;QAC7B,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YAClB,KAAK,CAAC;gBACF,KAAK,EAAE,uCAAuC;gBAC9C,MAAM,EAAE,OAAO;gBACf,WAAW,EAAE,KAAK,CAAC,OAAO;aAC7B,CAAC,CAAC;YACH,OAAO,CAAC,GAAG,CAAC,uCAAuC,EAAE,KAAK,CAAC,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,yCAAyC,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QAC/E,CAAC;IACL,CAAC,CAAC;IAEF,OAAO;QACH,uBAAuB,EAAE,qBAAqB;KACjD,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
* Hook for handling file uploads to the store
|
|
7
|
+
*
|
|
8
|
+
* @param options Configuration options for the upload handler
|
|
9
|
+
* @returns Upload handler function that takes files and type, and returns upload results
|
|
10
|
+
*/
|
|
11
|
+
export function useDocumentUploadHandler(options) {
|
|
12
|
+
// Handle both object and legacy function format for backward compatibility
|
|
13
|
+
const onUploadDone = typeof options === "function" ? options : options.onUploadDone;
|
|
14
|
+
const { client, project: projectRef, store } = useUserSession();
|
|
15
|
+
const search = useDocumentSearch();
|
|
16
|
+
const toast = useToast();
|
|
17
|
+
const { checkDocumentProcessing } = useSmartFileUploadProcessing();
|
|
18
|
+
return async (files, type, collectionId) => {
|
|
19
|
+
// Initialize result object
|
|
20
|
+
const result = {
|
|
21
|
+
success: false,
|
|
22
|
+
objectIds: [],
|
|
23
|
+
uploadedFiles: [],
|
|
24
|
+
skippedFiles: [],
|
|
25
|
+
failedFiles: [],
|
|
26
|
+
};
|
|
27
|
+
if (!projectRef) {
|
|
28
|
+
toast({
|
|
29
|
+
status: "error",
|
|
30
|
+
title: "No project selected",
|
|
31
|
+
duration: 3000,
|
|
32
|
+
});
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
if (!files || files.length === 0) {
|
|
36
|
+
toast({
|
|
37
|
+
status: "warning",
|
|
38
|
+
title: "No files selected",
|
|
39
|
+
duration: 3000,
|
|
40
|
+
});
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
const filesToUpload = Array.from(files).filter((file) => file.size > 0);
|
|
44
|
+
if (filesToUpload.length === 0) {
|
|
45
|
+
toast({
|
|
46
|
+
status: "error",
|
|
47
|
+
title: "No valid files selected",
|
|
48
|
+
description: "Please select files with valid content.",
|
|
49
|
+
duration: 5000,
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
const skippedFilesInfo = [];
|
|
54
|
+
const uploadedFilesInfo = [];
|
|
55
|
+
const failedFilesInfo = [];
|
|
56
|
+
console.log(`Processing ${filesToUpload.length} files with smart file processing...`);
|
|
57
|
+
// Determine if what need to be updated
|
|
58
|
+
const filesWithMetadata = await checkDocumentProcessing(filesToUpload, null, collectionId);
|
|
59
|
+
// Create statistics for user feedback
|
|
60
|
+
const toCreate = filesWithMetadata.filter((f) => f.action === FileUploadAction.CREATE).length;
|
|
61
|
+
const toUpdate = filesWithMetadata.filter((f) => f.action === FileUploadAction.UPDATE).length;
|
|
62
|
+
const toSkip = filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP).length;
|
|
63
|
+
// Show user feedback about processed files
|
|
64
|
+
toast({
|
|
65
|
+
title: "Files analyzed",
|
|
66
|
+
description: `${filesToUpload.length} file(s): ${toCreate} new, ${toUpdate} to update, ${toSkip} to skip`,
|
|
67
|
+
status: "info",
|
|
68
|
+
duration: 4000,
|
|
69
|
+
});
|
|
70
|
+
// Process SKIP files - add them to skipped list and result IDs
|
|
71
|
+
for (const fileInfo of filesWithMetadata.filter((f) => f.action === FileUploadAction.SKIP && f.existingId)) {
|
|
72
|
+
skippedFilesInfo.push({
|
|
73
|
+
id: fileInfo.existingId,
|
|
74
|
+
name: fileInfo.name,
|
|
75
|
+
type,
|
|
76
|
+
status: "skipped",
|
|
77
|
+
location: fileInfo.location,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// Collect files for processing (both CREATE and UPDATE)
|
|
81
|
+
const filesToProcess = filesWithMetadata.filter((f) => (f.action === FileUploadAction.CREATE || f.action === FileUploadAction.UPDATE) && f.file);
|
|
82
|
+
if (filesToProcess.length > 0) {
|
|
83
|
+
console.log(`Processing ${filesToProcess.length} files (${filesToProcess.filter((f) => f.action === FileUploadAction.CREATE).length} create, ${filesToProcess.filter((f) => f.action === FileUploadAction.UPDATE).length} update)...`);
|
|
84
|
+
// Create batches of 50 files
|
|
85
|
+
const batchSize = 50;
|
|
86
|
+
const processBatches = [];
|
|
87
|
+
for (let i = 0; i < filesToProcess.length; i += batchSize) {
|
|
88
|
+
processBatches.push(filesToProcess.slice(i, i + batchSize));
|
|
89
|
+
}
|
|
90
|
+
// Process each batch
|
|
91
|
+
for (let batchIndex = 0; batchIndex < processBatches.length; batchIndex++) {
|
|
92
|
+
const batch = processBatches[batchIndex];
|
|
93
|
+
const processedCount = batchIndex * batchSize;
|
|
94
|
+
console.log(`Processing batch ${batchIndex + 1}/${processBatches.length} (${batch.length} files)`);
|
|
95
|
+
// Show progress for larger file sets
|
|
96
|
+
if (filesToProcess.length > batchSize) {
|
|
97
|
+
toast({
|
|
98
|
+
title: "Processing files",
|
|
99
|
+
description: `Processed ${processedCount}/${filesToProcess.length} files...`,
|
|
100
|
+
status: "info",
|
|
101
|
+
duration: 2000,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
// Process this batch in parallel
|
|
105
|
+
const processResults = await Promise.all(batch.map(async (fileInfo) => {
|
|
106
|
+
try {
|
|
107
|
+
if (fileInfo.action === FileUploadAction.UPDATE && fileInfo.existingId) {
|
|
108
|
+
// UPDATE - Update the existing object
|
|
109
|
+
const updateResult = await client.store.objects.update(fileInfo.existingId, {
|
|
110
|
+
type: type || undefined,
|
|
111
|
+
content: fileInfo.file,
|
|
112
|
+
location: fileInfo.location,
|
|
113
|
+
name: fileInfo.name,
|
|
114
|
+
}, {
|
|
115
|
+
createRevision: true,
|
|
116
|
+
revisionLabel: "upload on " + new Date().toISOString(),
|
|
117
|
+
});
|
|
118
|
+
// Use a separate data structure for updated files
|
|
119
|
+
uploadedFilesInfo.push({
|
|
120
|
+
id: fileInfo.existingId,
|
|
121
|
+
name: fileInfo.name,
|
|
122
|
+
type,
|
|
123
|
+
status: "updated",
|
|
124
|
+
location: fileInfo.location,
|
|
125
|
+
});
|
|
126
|
+
// Add to result IDs
|
|
127
|
+
result.objectIds.push(fileInfo.existingId);
|
|
128
|
+
return {
|
|
129
|
+
success: true,
|
|
130
|
+
id: updateResult.id,
|
|
131
|
+
name: fileInfo.name,
|
|
132
|
+
action: "update",
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// CREATE - Create a new object
|
|
137
|
+
// If collectionId is provided, pass it as an option
|
|
138
|
+
const options = collectionId ? { collection_id: collectionId } : undefined;
|
|
139
|
+
const createResult = await store.objects.create({
|
|
140
|
+
type: type || undefined,
|
|
141
|
+
content: fileInfo.file,
|
|
142
|
+
location: fileInfo.location || fileInfo.file.webkitRelativePath || fileInfo.name,
|
|
143
|
+
}, options);
|
|
144
|
+
// Track successful upload
|
|
145
|
+
uploadedFilesInfo.push({
|
|
146
|
+
id: createResult.id,
|
|
147
|
+
name: fileInfo.name,
|
|
148
|
+
type,
|
|
149
|
+
status: "created",
|
|
150
|
+
location: fileInfo.location,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
console.error(`Failed to process file ${fileInfo.name}:`, error);
|
|
156
|
+
// Track failed upload
|
|
157
|
+
failedFilesInfo.push({
|
|
158
|
+
name: fileInfo.name,
|
|
159
|
+
error: error.message || "Unknown error",
|
|
160
|
+
status: "failed",
|
|
161
|
+
location: fileInfo.location,
|
|
162
|
+
type,
|
|
163
|
+
});
|
|
164
|
+
toast({
|
|
165
|
+
status: "error",
|
|
166
|
+
title: `Processing failed for ${fileInfo.name}`,
|
|
167
|
+
description: error.message,
|
|
168
|
+
duration: 4000,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
// Log batch results
|
|
173
|
+
const creates = uploadedFilesInfo.filter((f) => f.status === "created");
|
|
174
|
+
const updates = uploadedFilesInfo.filter((f) => f.status === "updated");
|
|
175
|
+
const failures = uploadedFilesInfo.filter((f) => f.status === "failed");
|
|
176
|
+
console.log(`Batch ${batchIndex + 1} results:`, {
|
|
177
|
+
creates,
|
|
178
|
+
updates,
|
|
179
|
+
failures,
|
|
180
|
+
total: processResults.length,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const uploadedCount = uploadedFilesInfo.filter((f) => f.status === "created").length;
|
|
185
|
+
const updatedCount = uploadedFilesInfo.filter((f) => f.status === "updated").length;
|
|
186
|
+
const failedCount = uploadedFilesInfo.filter((f) => f.status === "failed").length;
|
|
187
|
+
const skippedCount = uploadedFilesInfo.filter((f) => f.status === "skipped").length;
|
|
188
|
+
// Call the original callback with all object IDs and additional metadata
|
|
189
|
+
if (onUploadDone) {
|
|
190
|
+
// Log the actual upload count for debugging
|
|
191
|
+
console.log("Upload complete:", {
|
|
192
|
+
totalObjectIds: result.objectIds.length,
|
|
193
|
+
uploadedFiles: uploadedCount,
|
|
194
|
+
updatedFiles: updatedCount,
|
|
195
|
+
skippedFiles: skippedCount,
|
|
196
|
+
failedFiles: failedCount,
|
|
197
|
+
});
|
|
198
|
+
// Call the callback with all object IDs
|
|
199
|
+
await onUploadDone(result.objectIds);
|
|
200
|
+
}
|
|
201
|
+
// Create a success message that includes information about all file operations
|
|
202
|
+
let statusMessage = "";
|
|
203
|
+
if (uploadedCount > 0) {
|
|
204
|
+
statusMessage += `${uploadedCount} file${uploadedCount !== 1 ? "s" : ""} uploaded`;
|
|
205
|
+
}
|
|
206
|
+
if (updatedCount > 0) {
|
|
207
|
+
statusMessage += statusMessage ? ", " : "";
|
|
208
|
+
statusMessage += `${updatedCount} file${updatedCount !== 1 ? "s" : ""} updated`;
|
|
209
|
+
}
|
|
210
|
+
if (skippedCount > 0) {
|
|
211
|
+
statusMessage += statusMessage ? ", " : "";
|
|
212
|
+
statusMessage += `${skippedCount} file${skippedCount !== 1 ? "s" : ""} skipped (already existed)`;
|
|
213
|
+
}
|
|
214
|
+
if (failedCount > 0) {
|
|
215
|
+
statusMessage += statusMessage ? ", " : "";
|
|
216
|
+
statusMessage += `${failedCount} file${failedCount !== 1 ? "s" : ""} failed`;
|
|
217
|
+
}
|
|
218
|
+
if (statusMessage) {
|
|
219
|
+
toast({
|
|
220
|
+
status: failedCount > 0 ? "warning" : "success",
|
|
221
|
+
title: statusMessage,
|
|
222
|
+
duration: 4000,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
// Refresh search results
|
|
226
|
+
search.search();
|
|
227
|
+
return result;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
//# sourceMappingURL=useUploadHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUploadHandler.js","sourceRoot":"","sources":["../../../../../../src/features/store/objects/upload/useUploadHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AA+ChG;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAwE;IAC7G,2EAA2E;IAC3E,MAAM,YAAY,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;IACpF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,cAAc,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACnC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,EAAE,uBAAuB,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAEnE,OAAO,KAAK,EAAE,KAAa,EAAE,IAAmB,EAAE,YAAqB,EAAiC,EAAE;QACtG,2BAA2B;QAC3B,MAAM,MAAM,GAAyB;YACjC,OAAO,EAAE,KAAK;YACd,SAAS,EAAE,EAAE;YACb,aAAa,EAAE,EAAE;YACjB,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,EAAE;SAClB,CAAC;QAEF,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,KAAK,CAAC;gBACF,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,qBAAqB;gBAC5B,QAAQ,EAAE,IAAI;aACjB,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QA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O,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { Button, Center, ErrorBox, Popover, PopoverContent, PopoverTrigger, Spinner, Switch, Tabs, TabsBar, TabsPanel, useFetch, useToast } from '@vertesia/ui/core';
|
|
6
|
+
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
7
|
+
import { useLocation, useNavigate } from "@vertesia/ui/router";
|
|
8
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
9
|
+
import { PropertiesView } from '@vertesia/ui/widgets';
|
|
10
|
+
import { EllipsisVertical, SquarePen, Trash2 } from 'lucide-react';
|
|
11
|
+
import { GenericPageNavHeader } from "../../layout";
|
|
12
|
+
import { UserInfo } from '../../user/UserInfo';
|
|
13
|
+
import { CreateOrUpdateTypeModal } from './CreateOrUpdateTypeModal';
|
|
14
|
+
import { ObjectSchemaEditor } from './ObjectSchemaEditor';
|
|
15
|
+
import { TableLayoutEditor } from './TableLayoutEditor';
|
|
16
|
+
dayjs.extend(LocalizedFormat);
|
|
17
|
+
export function ContentObjectTypeView({ typeId }) {
|
|
18
|
+
const { store, user } = useUserSession();
|
|
19
|
+
const { hash } = useLocation();
|
|
20
|
+
const currentTab = hash ? hash.substring(1) : undefined;
|
|
21
|
+
let { data: objectType, isLoading, error, refetch } = useFetch(() => {
|
|
22
|
+
if (user) {
|
|
23
|
+
return store.types.retrieve(typeId);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return Promise.resolve(undefined);
|
|
27
|
+
}
|
|
28
|
+
}, [user]);
|
|
29
|
+
if (error) {
|
|
30
|
+
return _jsx(ErrorBox, { title: "Error", children: error.message });
|
|
31
|
+
}
|
|
32
|
+
if (isLoading) {
|
|
33
|
+
return _jsx(Center, { className: "py-10", children: _jsx(Spinner, { size: 'lg' }) });
|
|
34
|
+
}
|
|
35
|
+
if (!objectType) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const actions = [
|
|
39
|
+
_jsx(DeleteTypeButton, { objectType: objectType }, "delete")
|
|
40
|
+
];
|
|
41
|
+
const onSchemaUpdate = (value) => {
|
|
42
|
+
objectType.object_schema = value.schema;
|
|
43
|
+
};
|
|
44
|
+
const onLayoutUpdate = (value) => {
|
|
45
|
+
objectType.table_layout = value;
|
|
46
|
+
};
|
|
47
|
+
const tabs = [
|
|
48
|
+
{ name: 'metadata', label: "Metadata", href: "#metadata", content: _jsx(MetadataView, { objectType: objectType }) },
|
|
49
|
+
{ name: 'schema', label: "Object Schema", href: "#schema", content: _jsx(ObjectSchemaEditor, { objectType: objectType, onSchemaUpdate: onSchemaUpdate }) },
|
|
50
|
+
{ name: 'layout', label: "Table Layout", href: "#layout", content: _jsx(TableLayoutEditor, { objectType: objectType, onLayoutUpdate: onLayoutUpdate }) },
|
|
51
|
+
];
|
|
52
|
+
const breadcrumbs = [breadcrumb()];
|
|
53
|
+
const title = pageTitle(objectType, refetch);
|
|
54
|
+
const description = objectType.description;
|
|
55
|
+
return (_jsxs(FullHeightLayout, { children: [_jsx(GenericPageNavHeader, { title: title, description: description, actions: [actions], breadcrumbs: breadcrumbs }), _jsxs(Tabs, { tabs: tabs, current: currentTab, children: [_jsx(TabsBar, {}), _jsx(FullHeightLayout.Body, { children: _jsx("div", { className: "h-[calc(100vh-187px)] overflow-auto", children: _jsx(TabsPanel, {}) }) })] })] }));
|
|
56
|
+
}
|
|
57
|
+
function breadcrumb() {
|
|
58
|
+
return _jsx("span", { children: "Content Type" });
|
|
59
|
+
}
|
|
60
|
+
function pageTitle(objectType, refetch) {
|
|
61
|
+
return _jsx(PageTitle, { objectType: objectType, refetch: refetch });
|
|
62
|
+
}
|
|
63
|
+
function PageTitle({ objectType, refetch }) {
|
|
64
|
+
const toast = useToast();
|
|
65
|
+
const session = useUserSession();
|
|
66
|
+
const { store } = session;
|
|
67
|
+
const [showEditModal, setShowEditModal] = useState(false);
|
|
68
|
+
const onCloseEditModal = (payload) => {
|
|
69
|
+
if (!payload) {
|
|
70
|
+
setShowEditModal(false);
|
|
71
|
+
return Promise.resolve();
|
|
72
|
+
}
|
|
73
|
+
return store.types.update(objectType.id, payload).then(() => {
|
|
74
|
+
toast({
|
|
75
|
+
status: 'success',
|
|
76
|
+
title: 'Type updated',
|
|
77
|
+
duration: 2000
|
|
78
|
+
});
|
|
79
|
+
return refetch().finally(() => session.reloadTypes());
|
|
80
|
+
}).catch(err => {
|
|
81
|
+
toast({
|
|
82
|
+
status: 'error',
|
|
83
|
+
title: 'Error updating type',
|
|
84
|
+
description: err.message,
|
|
85
|
+
duration: 5000
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return _jsxs(_Fragment, { children: [_jsxs("div", { className: 'flex items-center gap-x-2', children: [objectType.name, " ", _jsx(Button, { variant: "ghost", size: "sm", title: "Edit", onClick: () => setShowEditModal(true), children: _jsx(SquarePen, { className: "size-4" }) })] }), _jsx(CreateOrUpdateTypeModal, { okLabel: "Save Changes", title: "Edit Type", isOpen: showEditModal, onClose: onCloseEditModal, initialPayload: objectType })] });
|
|
90
|
+
}
|
|
91
|
+
function MetadataView({ objectType }) {
|
|
92
|
+
return (_jsx(PropertiesView, { className: 'w-full', properties: [
|
|
93
|
+
{ name: "Id", value: objectType.id },
|
|
94
|
+
{ name: "Name", value: objectType.name },
|
|
95
|
+
{ name: "Is Chunkable", value: _jsx(ChunkableSwitch, { objectType: objectType }) },
|
|
96
|
+
{ name: "Strict Mode", value: _jsx(StrictModeSwitch, { objectType: objectType }) },
|
|
97
|
+
{ name: 'Created By', value: _jsx(UserInfo, { userRef: objectType.created_by }) },
|
|
98
|
+
{ name: 'Created At', value: dayjs(objectType.created_at).format('LLL') },
|
|
99
|
+
{ name: 'Updated By', value: _jsx(UserInfo, { userRef: objectType.updated_by }) },
|
|
100
|
+
{ name: 'Updated At', value: dayjs(objectType.updated_at).format('LLL') },
|
|
101
|
+
] }));
|
|
102
|
+
}
|
|
103
|
+
function TypeSwitch({ objectType, field, initialValue }) {
|
|
104
|
+
const [value, setValue] = useState(initialValue ?? false);
|
|
105
|
+
const toast = useToast();
|
|
106
|
+
const { store } = useUserSession();
|
|
107
|
+
const onChange = (value) => {
|
|
108
|
+
store.types.update(objectType.id, {
|
|
109
|
+
[field]: value
|
|
110
|
+
}).then(() => {
|
|
111
|
+
setValue(value);
|
|
112
|
+
toast({
|
|
113
|
+
status: 'success',
|
|
114
|
+
title: 'Successfully Updated.',
|
|
115
|
+
duration: 2000
|
|
116
|
+
});
|
|
117
|
+
}).catch((err) => {
|
|
118
|
+
toast({
|
|
119
|
+
status: 'error',
|
|
120
|
+
title: 'Failed to update.',
|
|
121
|
+
description: err.message,
|
|
122
|
+
duration: 5000
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
return (_jsx(Switch, { value: value, onChange: onChange }));
|
|
127
|
+
}
|
|
128
|
+
function ChunkableSwitch({ objectType }) {
|
|
129
|
+
return (_jsx(TypeSwitch, { objectType: objectType, field: "is_chunkable", initialValue: objectType.is_chunkable ?? false }));
|
|
130
|
+
}
|
|
131
|
+
function StrictModeSwitch({ objectType }) {
|
|
132
|
+
return (_jsx(TypeSwitch, { objectType: objectType, field: "strict_mode", initialValue: objectType.strict_mode ?? false }));
|
|
133
|
+
}
|
|
134
|
+
function DeleteTypeButton({ objectType }) {
|
|
135
|
+
const toast = useToast();
|
|
136
|
+
const navigate = useNavigate();
|
|
137
|
+
const { store } = useUserSession();
|
|
138
|
+
const onDelete = () => {
|
|
139
|
+
confirm('Are you sure you want to delete this rule?') &&
|
|
140
|
+
store.types.delete(objectType.id).then(() => {
|
|
141
|
+
toast({
|
|
142
|
+
status: 'success',
|
|
143
|
+
title: `Object type ${objectType.name} deleted`,
|
|
144
|
+
duration: 2000
|
|
145
|
+
});
|
|
146
|
+
navigate('/types');
|
|
147
|
+
}).catch(err => {
|
|
148
|
+
toast({
|
|
149
|
+
status: 'error',
|
|
150
|
+
title: 'Failed to delete rule',
|
|
151
|
+
description: err.message,
|
|
152
|
+
duration: 5000
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
};
|
|
156
|
+
return (_jsxs(Popover, { hover: true, children: [_jsx(PopoverTrigger, { children: _jsx("div", { className: 'cursor-pointer hover:bg-muted p-2 rounded-md', children: _jsx(Button, { variant: "ghost", size: 'sm', title: 'More actions', children: _jsx(EllipsisVertical, {}) }) }) }), _jsx(PopoverContent, { className: 'p-0 w-35', align: 'end', children: _jsx("div", { className: "py-2 px-1.5 flex justify-center w-full", children: _jsxs(Button, { variant: "ghost", onClick: onDelete, className: 'w-full', children: [_jsx(Trash2, { className: 'size-4' }), " Delete"] }) }) })] }));
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=ContentObjectTypeView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentObjectTypeView.js","sourceRoot":"","sources":["../../../../../src/features/store/types/ContentObjectTypeView.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAO,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1K,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC/D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