@vertesia/ui 0.59.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,45 @@
|
|
|
1
|
+
import { useUserSession, TypeRegistry } from "@vertesia/ui/session";
|
|
2
|
+
import { Collection } from "@vertesia/common";
|
|
3
|
+
import { DocumentSearchResultsWithDropZone, DocumentSearchResults } from "../objects/DocumentSearchResults";
|
|
4
|
+
import { useToast } from "@vertesia/ui/core";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
interface BrowseCollectionViewProps {
|
|
8
|
+
collection: Collection;
|
|
9
|
+
}
|
|
10
|
+
export function BrowseCollectionView({ collection }: BrowseCollectionViewProps) {
|
|
11
|
+
const toast = useToast();
|
|
12
|
+
const { client, typeRegistry } = useUserSession();
|
|
13
|
+
const onUploadDone = async (objectIds: string[]) => {
|
|
14
|
+
if (objectIds.length > 0) {
|
|
15
|
+
await client.store.collections.addMembers(collection.id, objectIds).catch(err => {
|
|
16
|
+
toast({
|
|
17
|
+
title: 'Failed to add objects to collection',
|
|
18
|
+
description: err.message,
|
|
19
|
+
status: 'error'
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const tableLayout = getTableLayout(collection, typeRegistry);
|
|
25
|
+
return collection.dynamic ? (
|
|
26
|
+
<DocumentSearchResults layout={tableLayout} />
|
|
27
|
+
) : (
|
|
28
|
+
<DocumentSearchResultsWithDropZone onUploadDone={onUploadDone} layout={tableLayout} />
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getTableLayout(collection: Collection, typeRegistry?: TypeRegistry | undefined) {
|
|
33
|
+
let table_layout = collection.table_layout;
|
|
34
|
+
if (table_layout && table_layout.length > 0) {
|
|
35
|
+
return table_layout;
|
|
36
|
+
}
|
|
37
|
+
if (collection.type && typeRegistry) {
|
|
38
|
+
table_layout = typeRegistry?.getTypeLayout(collection.type.id);
|
|
39
|
+
}
|
|
40
|
+
if (table_layout && table_layout.length > 0) {
|
|
41
|
+
return table_layout;
|
|
42
|
+
} else {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Collection, FacetSpec } from "@vertesia/common";
|
|
2
|
+
import { ErrorBox, Spinner, useFetch, VTabs, VTabsBar, VTabsPanel } from "@vertesia/ui/core";
|
|
3
|
+
import { FullHeightLayout } from "@vertesia/ui/layout";
|
|
4
|
+
import { NavLink } from "@vertesia/ui/router";
|
|
5
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
6
|
+
import { PanelErrorBoundary } from "../../errors";
|
|
7
|
+
import { GenericPageNavHeader } from "../../layout";
|
|
8
|
+
import { DocumentSearchProvider, DocumentSelectionProvider } from "../../store";
|
|
9
|
+
import { SelectionActions, UploadObjectsButton } from "../objects/selection/SelectionActions";
|
|
10
|
+
import { BrowseCollectionView } from "./BrowseCollectionView";
|
|
11
|
+
import { EditCollectionView } from "./EditCollectionView";
|
|
12
|
+
|
|
13
|
+
const facets: FacetSpec[] = [
|
|
14
|
+
{
|
|
15
|
+
name: 'status',
|
|
16
|
+
field: 'status'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: 'type',
|
|
20
|
+
field: 'type'
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
interface CollectionViewProps {
|
|
26
|
+
collectionId: string;
|
|
27
|
+
}
|
|
28
|
+
export function CollectionView({ collectionId }: CollectionViewProps) {
|
|
29
|
+
const { client } = useUserSession();
|
|
30
|
+
|
|
31
|
+
const { data: collection, error, refetch, isLoading } = useFetch(() => client.store.collections.retrieve(collectionId), [collectionId]);
|
|
32
|
+
|
|
33
|
+
if (error) {
|
|
34
|
+
return <ErrorBox title='Collection fetch failed'>{error.message}</ErrorBox>
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const actions = [
|
|
38
|
+
<SelectionActions key='selection' />,
|
|
39
|
+
<UploadObjectsButton key="upload" collectionId={collectionId ?? ''} />
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const title = (
|
|
43
|
+
<div className='flex gap-x-1 items-center'>
|
|
44
|
+
<div>{collection?.name || ''}</div>
|
|
45
|
+
</div>
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
const breadcrumbs = [
|
|
49
|
+
<NavLink href='/collections' key='collections'>Collections</NavLink>,
|
|
50
|
+
<span key='collection-detail'>Collection Detail</span>
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const tabs = [
|
|
54
|
+
{
|
|
55
|
+
name: 'browse',
|
|
56
|
+
label: 'Browse',
|
|
57
|
+
content: <BrowseCollectionView collection={collection as Collection} />
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'metadata',
|
|
61
|
+
label: 'Metadata',
|
|
62
|
+
content: <EditCollectionView collection={collection as Collection} refetch={refetch} />
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<FullHeightLayout>
|
|
68
|
+
<DocumentSearchProvider facets={facets} collectionId={collectionId}>
|
|
69
|
+
<DocumentSelectionProvider collectionId={collectionId}>
|
|
70
|
+
<GenericPageNavHeader title={title}
|
|
71
|
+
description={collection?.description || ''}
|
|
72
|
+
actions={actions}
|
|
73
|
+
breadcrumbs={breadcrumbs}
|
|
74
|
+
/>
|
|
75
|
+
<VTabs defaultValue="browse" tabs={tabs}>
|
|
76
|
+
<VTabsBar className="px-4" />
|
|
77
|
+
{
|
|
78
|
+
isLoading ?
|
|
79
|
+
<div className="w-full flex justify-center">
|
|
80
|
+
<Spinner />
|
|
81
|
+
</div> :
|
|
82
|
+
<div className="h-[calc(100vh-165px)] overflow-auto px-4 py-2">
|
|
83
|
+
<PanelErrorBoundary>
|
|
84
|
+
<VTabsPanel />
|
|
85
|
+
</PanelErrorBoundary>
|
|
86
|
+
</div>
|
|
87
|
+
}
|
|
88
|
+
</VTabs>
|
|
89
|
+
|
|
90
|
+
</DocumentSelectionProvider>
|
|
91
|
+
</DocumentSearchProvider>
|
|
92
|
+
</FullHeightLayout>
|
|
93
|
+
)
|
|
94
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { NavLink } from "@vertesia/ui/router";
|
|
2
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
3
|
+
import { FolderClosed, Search, Trash2 } from "lucide-react";
|
|
4
|
+
import { Button, ConfirmModal, ErrorBox, Table, TBody, TR, useToast, VTooltip } from "@vertesia/ui/core";
|
|
5
|
+
import { useFetch } from "@vertesia/ui/core";
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
8
|
+
import { useState, useEffect } from "react";
|
|
9
|
+
|
|
10
|
+
dayjs.extend(relativeTime);
|
|
11
|
+
|
|
12
|
+
interface CollectionsTableProps {
|
|
13
|
+
}
|
|
14
|
+
export function CollectionsTable({ }: CollectionsTableProps) {
|
|
15
|
+
const { client } = useUserSession();
|
|
16
|
+
const toast = useToast();
|
|
17
|
+
const [collectionToDelete, setCollectionToDelete] = useState<string | undefined>();
|
|
18
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
19
|
+
|
|
20
|
+
const { data: collections, error, refetch } = useFetch(() => client.store.collections.list(), []);
|
|
21
|
+
|
|
22
|
+
// Update loading state when data is fetched
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (collections || error) {
|
|
25
|
+
setIsLoading(false);
|
|
26
|
+
}
|
|
27
|
+
}, [collections, error]);
|
|
28
|
+
|
|
29
|
+
if (error) {
|
|
30
|
+
return <ErrorBox title='Collections fetch failed'>{error.message}</ErrorBox>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const deleteCollection = async () => {
|
|
34
|
+
if (!collectionToDelete) return;
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
await client.store.collections.delete(collectionToDelete);
|
|
38
|
+
toast({
|
|
39
|
+
title: 'Collection deleted',
|
|
40
|
+
status: 'success',
|
|
41
|
+
duration: 3000
|
|
42
|
+
});
|
|
43
|
+
refetch();
|
|
44
|
+
} catch (err: any) {
|
|
45
|
+
console.error('Failed to delete collection:', err);
|
|
46
|
+
toast({
|
|
47
|
+
title: 'Failed to delete collection',
|
|
48
|
+
description: err.message || 'An error occurred',
|
|
49
|
+
status: 'error',
|
|
50
|
+
duration: 5000
|
|
51
|
+
});
|
|
52
|
+
} finally {
|
|
53
|
+
setCollectionToDelete(undefined);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<>
|
|
59
|
+
{collections && <Table className="w-full">
|
|
60
|
+
<thead>
|
|
61
|
+
<tr>
|
|
62
|
+
<th>Name</th>
|
|
63
|
+
<th>Type</th>
|
|
64
|
+
<th>Created</th>
|
|
65
|
+
<th></th>
|
|
66
|
+
</tr>
|
|
67
|
+
</thead>
|
|
68
|
+
<TBody columns={4} isLoading={isLoading}>
|
|
69
|
+
{
|
|
70
|
+
collections.map((c) => {
|
|
71
|
+
return <TR key={c.id}>
|
|
72
|
+
<td>
|
|
73
|
+
<div className="flex items-center gap-2">
|
|
74
|
+
{collectionIcon(c.dynamic)}
|
|
75
|
+
<NavLink href={`/collections/${c.id}`}>{c.name}</NavLink>
|
|
76
|
+
</div>
|
|
77
|
+
</td>
|
|
78
|
+
<td>{c.type?.name || "-"}</td>
|
|
79
|
+
<td>{dayjs(c.created_at).fromNow()}</td>
|
|
80
|
+
<td className="text-right">
|
|
81
|
+
<Button
|
|
82
|
+
variant="destructive"
|
|
83
|
+
size="sm"
|
|
84
|
+
onClick={() => setCollectionToDelete(c.id)}
|
|
85
|
+
>
|
|
86
|
+
<Trash2 className="size-4" />
|
|
87
|
+
</Button>
|
|
88
|
+
</td>
|
|
89
|
+
</TR>
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
</TBody>
|
|
93
|
+
</Table>}
|
|
94
|
+
|
|
95
|
+
<ConfirmModal
|
|
96
|
+
isOpen={!!collectionToDelete}
|
|
97
|
+
title="Delete Collection"
|
|
98
|
+
content="Are you sure you want to delete this collection? This action cannot be undone."
|
|
99
|
+
onConfirm={deleteCollection}
|
|
100
|
+
onCancel={() => setCollectionToDelete(undefined)}
|
|
101
|
+
/>
|
|
102
|
+
</>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function collectionIcon(isDynamic: boolean) {
|
|
107
|
+
const tooltipText = isDynamic ? "Dynamic Collection" : "Static Collection";
|
|
108
|
+
const icon = isDynamic ? <Search className="size-5" /> : <FolderClosed className="size-5" />;
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<VTooltip description={tooltipText} className="mr-2">
|
|
112
|
+
{icon}
|
|
113
|
+
</VTooltip>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { CreateCollectionPayload } from "@vertesia/common";
|
|
2
|
+
import {
|
|
3
|
+
Button, FormItem, Input, Styles,
|
|
4
|
+
Switch, useFlag, useToast, VModal,
|
|
5
|
+
VModalBody,
|
|
6
|
+
VModalFooter,
|
|
7
|
+
VModalTitle
|
|
8
|
+
} from "@vertesia/ui/core";
|
|
9
|
+
import { FullHeightLayout } from "@vertesia/ui/layout";
|
|
10
|
+
import { useNavigate } from "@vertesia/ui/router";
|
|
11
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
12
|
+
import { useState } from "react";
|
|
13
|
+
import { GenericPageNavHeader } from "../../layout";
|
|
14
|
+
import { SelectContentType } from "../../store";
|
|
15
|
+
import { CollectionsTable } from "./CollectionsTable";
|
|
16
|
+
|
|
17
|
+
interface CollectionsViewProps { }
|
|
18
|
+
export function CollectionsView({ }: CollectionsViewProps) {
|
|
19
|
+
const actions = [<CreateCollectionButton key="create" />];
|
|
20
|
+
return (
|
|
21
|
+
<FullHeightLayout>
|
|
22
|
+
<GenericPageNavHeader
|
|
23
|
+
title="Collections"
|
|
24
|
+
breadcrumbs={[<span key="0">Collections</span>]}
|
|
25
|
+
description="Group objects together using a collection"
|
|
26
|
+
actions={actions}
|
|
27
|
+
/>
|
|
28
|
+
<FullHeightLayout.Body>
|
|
29
|
+
<CollectionsTable />
|
|
30
|
+
</FullHeightLayout.Body>
|
|
31
|
+
</FullHeightLayout>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function CreateCollectionButton() {
|
|
36
|
+
const { on, off, isOn } = useFlag();
|
|
37
|
+
return (
|
|
38
|
+
<div>
|
|
39
|
+
<VModal onClose={off} isOpen={isOn}>
|
|
40
|
+
<VModalTitle>Create a Collection</VModalTitle>
|
|
41
|
+
<CreateCollectionForm onClose={off} />
|
|
42
|
+
</VModal>
|
|
43
|
+
<Button onClick={on}>Create Collection</Button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface CreateCollectionFormProps {
|
|
49
|
+
onClose: () => void;
|
|
50
|
+
redirect?: boolean
|
|
51
|
+
onAddToCollection?: (collectionId: string) => void;
|
|
52
|
+
}
|
|
53
|
+
export function CreateCollectionForm({ onClose, redirect = true, onAddToCollection }: CreateCollectionFormProps) {
|
|
54
|
+
const navigate = useNavigate();
|
|
55
|
+
const toast = useToast();
|
|
56
|
+
const [isProcessing, setProcessing] = useState(false);
|
|
57
|
+
const { client } = useUserSession();
|
|
58
|
+
const [payload, setPayload] = useState<CreateCollectionPayload>({
|
|
59
|
+
dynamic: false,
|
|
60
|
+
name: "",
|
|
61
|
+
description: "",
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
function setPayloadProp(name: string, value: any) {
|
|
65
|
+
setPayload({
|
|
66
|
+
...payload,
|
|
67
|
+
[name]: value,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const onCreate = () => {
|
|
72
|
+
if (!payload?.name || !payload.name.trim()) {
|
|
73
|
+
toast({
|
|
74
|
+
title: "Name is required",
|
|
75
|
+
description: "Please provide a name for the collection",
|
|
76
|
+
status: "error",
|
|
77
|
+
duration: 5000,
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
payload.name = payload.name.trim();
|
|
82
|
+
if (payload.description) {
|
|
83
|
+
payload.description = payload.description.trim();
|
|
84
|
+
}
|
|
85
|
+
if (payload.dynamic == null) {
|
|
86
|
+
payload.dynamic = false;
|
|
87
|
+
}
|
|
88
|
+
setProcessing(true);
|
|
89
|
+
client.store.collections
|
|
90
|
+
.create(payload as CreateCollectionPayload)
|
|
91
|
+
.then((r) => {
|
|
92
|
+
onClose();
|
|
93
|
+
toast({
|
|
94
|
+
title: "Collection created",
|
|
95
|
+
description: `Collection "${r.name}" created successfully`,
|
|
96
|
+
status: "success",
|
|
97
|
+
duration: 3000,
|
|
98
|
+
});
|
|
99
|
+
if (redirect)
|
|
100
|
+
navigate(`/collections/${r.id}`);
|
|
101
|
+
if (onAddToCollection) {
|
|
102
|
+
onAddToCollection(r.id);
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.catch((err) => {
|
|
106
|
+
toast({
|
|
107
|
+
title: "Failed to create collection",
|
|
108
|
+
description: err.message,
|
|
109
|
+
status: "error",
|
|
110
|
+
duration: 5000,
|
|
111
|
+
});
|
|
112
|
+
})
|
|
113
|
+
.finally(() => setProcessing(false));
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<form>
|
|
118
|
+
<VModalBody>
|
|
119
|
+
<FormItem label="Name" required>
|
|
120
|
+
<Input type="text" value={payload.name || ""} onChange={(value) => setPayloadProp("name", value)} />
|
|
121
|
+
</FormItem>
|
|
122
|
+
<FormItem label="Description" className="mt-2">
|
|
123
|
+
<textarea
|
|
124
|
+
className={Styles.INPUT}
|
|
125
|
+
value={payload.description || ""}
|
|
126
|
+
onChange={(ev) => setPayloadProp("description", ev.target.value)}
|
|
127
|
+
/>
|
|
128
|
+
</FormItem>
|
|
129
|
+
<FormItem label="Dynamic Collection" className="mt-2" direction="row" description="Dynamic Collection is based on a query vs. users manully adding content.">
|
|
130
|
+
<Switch value={payload.dynamic || false} onChange={(value) => setPayloadProp("dynamic", value)} />
|
|
131
|
+
</FormItem>
|
|
132
|
+
<FormItem label="Type" className="mt-2" description="This is optional and drives what properties are used to describe a collection">
|
|
133
|
+
<SelectContentType
|
|
134
|
+
defaultValue={payload.type || null}
|
|
135
|
+
onChange={(v) => {
|
|
136
|
+
if (Array.isArray(v)) {
|
|
137
|
+
setPayloadProp("type", v.length > 0 ? v[0].id : null);
|
|
138
|
+
} else {
|
|
139
|
+
setPayloadProp("type", v?.id || null);
|
|
140
|
+
}
|
|
141
|
+
}}
|
|
142
|
+
isClearable
|
|
143
|
+
/>
|
|
144
|
+
</FormItem>
|
|
145
|
+
<FormItem label="Allowed Content Types" className="mt-4">
|
|
146
|
+
<SelectContentType
|
|
147
|
+
defaultValue={payload.allowed_types || null}
|
|
148
|
+
onChange={(v) => {
|
|
149
|
+
if (Array.isArray(v)) {
|
|
150
|
+
setPayloadProp("allowed_types", v.map(type => type.id));
|
|
151
|
+
} else {
|
|
152
|
+
setPayloadProp("allowed_types", v ? [v.id] : []);
|
|
153
|
+
}
|
|
154
|
+
}}
|
|
155
|
+
isClearable multiple
|
|
156
|
+
/>
|
|
157
|
+
</FormItem>
|
|
158
|
+
</VModalBody>
|
|
159
|
+
<VModalFooter>
|
|
160
|
+
<Button isDisabled={isProcessing} onClick={onCreate}>
|
|
161
|
+
Create Collection
|
|
162
|
+
</Button>
|
|
163
|
+
</VModalFooter>
|
|
164
|
+
</form >
|
|
165
|
+
);
|
|
166
|
+
}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { json } from "@codemirror/lang-json";
|
|
2
|
+
import { Collection, CreateCollectionPayload } from "@vertesia/common";
|
|
3
|
+
import { Button, ErrorBox, FormItem, Input, Styles, useFetch, useToast } from "@vertesia/ui/core";
|
|
4
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
5
|
+
import { CodeMirrorEditor, EditorApi, GeneratedForm, ManagedObject } from "@vertesia/ui/widgets";
|
|
6
|
+
import { basicSetup } from "codemirror";
|
|
7
|
+
import { useMemo, useRef, useState } from "react";
|
|
8
|
+
import { SelectContentType, stringifyTableLayout } from "../../store";
|
|
9
|
+
|
|
10
|
+
const extensions = [basicSetup, json()];
|
|
11
|
+
|
|
12
|
+
interface UpdateData {
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
query: string;
|
|
16
|
+
tags: string[];
|
|
17
|
+
type: string;
|
|
18
|
+
allowed_types: string[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface EditCollectionViewProps {
|
|
22
|
+
collection: Collection;
|
|
23
|
+
refetch: () => void;
|
|
24
|
+
}
|
|
25
|
+
export function EditCollectionView({ refetch, collection }: EditCollectionViewProps) {
|
|
26
|
+
const typeId = collection.type?.id;
|
|
27
|
+
const tableLayoutRef = useRef<EditorApi | undefined>(undefined);
|
|
28
|
+
const toast = useToast();
|
|
29
|
+
const { client } = useUserSession();
|
|
30
|
+
const [isUpdating, setUpdating] = useState(false);
|
|
31
|
+
const [metadata, setMetadata] = useState<UpdateData>({
|
|
32
|
+
name: collection.name,
|
|
33
|
+
description: collection.description || "",
|
|
34
|
+
query: collection.query ? JSON.stringify(collection.query, null, 2) : "",
|
|
35
|
+
tags: collection.tags || [],
|
|
36
|
+
type: collection.type?.id || "",
|
|
37
|
+
allowed_types: collection.allowed_types || [],
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const tableLayoutValue = useMemo(() => {
|
|
41
|
+
return stringifyTableLayout(collection.table_layout);
|
|
42
|
+
}, [collection.table_layout]);
|
|
43
|
+
|
|
44
|
+
const onSubmit = () => {
|
|
45
|
+
const query = metadata.query ? JSON.parse(metadata.query) : undefined;
|
|
46
|
+
const payload: Partial<CreateCollectionPayload> = {
|
|
47
|
+
name: metadata.name,
|
|
48
|
+
description: metadata.description,
|
|
49
|
+
query: query,
|
|
50
|
+
tags: metadata.tags,
|
|
51
|
+
type: metadata.type,
|
|
52
|
+
allowed_types: metadata.allowed_types,
|
|
53
|
+
};
|
|
54
|
+
let error: string | undefined;
|
|
55
|
+
if (!payload.name) {
|
|
56
|
+
error = "Name is required";
|
|
57
|
+
}
|
|
58
|
+
if (!payload.type) {
|
|
59
|
+
(payload as any).type = null;
|
|
60
|
+
}
|
|
61
|
+
if (error) {
|
|
62
|
+
toast({
|
|
63
|
+
title: "Validation failed",
|
|
64
|
+
description: error,
|
|
65
|
+
status: "error",
|
|
66
|
+
duration: 5000,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (tableLayoutRef.current) {
|
|
70
|
+
const layout = tableLayoutRef.current.getValue();
|
|
71
|
+
if (layout) {
|
|
72
|
+
try {
|
|
73
|
+
payload.table_layout = JSON.parse(layout);
|
|
74
|
+
} catch (err: any) {
|
|
75
|
+
toast({
|
|
76
|
+
title: "Invalid Table Layout",
|
|
77
|
+
description: err.message,
|
|
78
|
+
status: "error",
|
|
79
|
+
duration: 5000,
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
} else {
|
|
84
|
+
payload.table_layout = null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
setUpdating(true);
|
|
88
|
+
client.store.collections
|
|
89
|
+
.update(collection.id, payload)
|
|
90
|
+
.then(() => {
|
|
91
|
+
refetch();
|
|
92
|
+
toast({
|
|
93
|
+
title: "Collection updated",
|
|
94
|
+
description: "Collection has been updated successfully",
|
|
95
|
+
status: "success",
|
|
96
|
+
duration: 3000,
|
|
97
|
+
});
|
|
98
|
+
})
|
|
99
|
+
.catch((err) => {
|
|
100
|
+
toast({
|
|
101
|
+
title: "Failed to update collection",
|
|
102
|
+
description: err.message,
|
|
103
|
+
status: "error",
|
|
104
|
+
duration: 5000,
|
|
105
|
+
});
|
|
106
|
+
})
|
|
107
|
+
.finally(() => {
|
|
108
|
+
setUpdating(false);
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const setField = (name: string, value: any) => {
|
|
113
|
+
setMetadata({
|
|
114
|
+
...metadata,
|
|
115
|
+
[name]: value,
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<div className="flex flex-col gap-4 py-2">
|
|
121
|
+
<FormItem label="Name" required>
|
|
122
|
+
<Input value={metadata.name} onChange={(v) => setField("name", v)} />
|
|
123
|
+
</FormItem>
|
|
124
|
+
<FormItem label="Description">
|
|
125
|
+
<textarea
|
|
126
|
+
className={Styles.INPUT}
|
|
127
|
+
value={metadata.description}
|
|
128
|
+
onChange={(e) => setField("description", e.target.value)}
|
|
129
|
+
/>
|
|
130
|
+
</FormItem>
|
|
131
|
+
{collection.dynamic && (
|
|
132
|
+
<FormItem label="Query" description="Define the query to fetch dynamic content for this collection.">
|
|
133
|
+
<textarea
|
|
134
|
+
className={Styles.INPUT}
|
|
135
|
+
value={metadata.query}
|
|
136
|
+
onChange={(e) => setField("query", e.target.value)}
|
|
137
|
+
/>
|
|
138
|
+
</FormItem>
|
|
139
|
+
)}
|
|
140
|
+
<FormItem label="Table Layout" description="Define how the collection should be displayed in tables.">
|
|
141
|
+
<CodeMirrorEditor className="border-1 rounded-md border-border"
|
|
142
|
+
value={tableLayoutValue} extensions={extensions} editorRef={tableLayoutRef} />
|
|
143
|
+
</FormItem>
|
|
144
|
+
<FormItem label="Type">
|
|
145
|
+
<SelectContentType
|
|
146
|
+
defaultValue={metadata.type || null}
|
|
147
|
+
onChange={(v) => {
|
|
148
|
+
if (Array.isArray(v)) {
|
|
149
|
+
setField("type", v.length > 0 ? v[0].id : null);
|
|
150
|
+
} else {
|
|
151
|
+
setField("type", v?.id || null);
|
|
152
|
+
}
|
|
153
|
+
}}
|
|
154
|
+
isClearable
|
|
155
|
+
/>
|
|
156
|
+
</FormItem>
|
|
157
|
+
<FormItem label="Allowed Content Types">
|
|
158
|
+
<SelectContentType
|
|
159
|
+
defaultValue={metadata.allowed_types || null}
|
|
160
|
+
onChange={(v) => {
|
|
161
|
+
if (Array.isArray(v)) {
|
|
162
|
+
setField("allowed_types", v.map(type => type.id));
|
|
163
|
+
} else {
|
|
164
|
+
setField("allowed_types", v ? [v.id] : []);
|
|
165
|
+
}
|
|
166
|
+
}}
|
|
167
|
+
isClearable multiple
|
|
168
|
+
/>
|
|
169
|
+
</FormItem>
|
|
170
|
+
<Button size="lg" className="w-min my-4" isDisabled={isUpdating} onClick={onSubmit}>
|
|
171
|
+
Save Metadata
|
|
172
|
+
</Button>
|
|
173
|
+
|
|
174
|
+
{typeId && <PropertiesEditor typeId={typeId} collection={collection} />}
|
|
175
|
+
</div>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface PropertiesEditorProps {
|
|
180
|
+
typeId: string;
|
|
181
|
+
collection: Collection;
|
|
182
|
+
}
|
|
183
|
+
function PropertiesEditor({ typeId, collection }: PropertiesEditorProps) {
|
|
184
|
+
const { client } = useUserSession();
|
|
185
|
+
const { data: type, error } = useFetch(() => client.store.types.retrieve(typeId), [typeId]);
|
|
186
|
+
if (error) {
|
|
187
|
+
return <ErrorBox title="Failed to load type">{error.message}</ErrorBox>;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return (
|
|
191
|
+
<Section title="Properties">
|
|
192
|
+
{type && <PropertiesForm collection={collection} schema={type.object_schema} />}
|
|
193
|
+
</Section>
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface PropertiesFormProps {
|
|
198
|
+
schema: any;
|
|
199
|
+
collection: Collection;
|
|
200
|
+
}
|
|
201
|
+
function PropertiesForm({ schema = {}, collection }: PropertiesFormProps) {
|
|
202
|
+
const { client } = useUserSession();
|
|
203
|
+
const toast = useToast();
|
|
204
|
+
const object = useMemo(() => new ManagedObject(schema, collection.properties || {}), [schema, collection]);
|
|
205
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
206
|
+
|
|
207
|
+
const _onSave = (data: any) => {
|
|
208
|
+
const payload = { properties: data || {} };
|
|
209
|
+
setIsUpdating(true);
|
|
210
|
+
client.store.collections
|
|
211
|
+
.update(collection.id, payload)
|
|
212
|
+
.then(() => {
|
|
213
|
+
toast({
|
|
214
|
+
title: "Collection properties updated",
|
|
215
|
+
description: "Collection has been updated successfully",
|
|
216
|
+
status: "success",
|
|
217
|
+
duration: 3000,
|
|
218
|
+
});
|
|
219
|
+
})
|
|
220
|
+
.catch((err) => {
|
|
221
|
+
toast({
|
|
222
|
+
title: "Failed to update collection properties",
|
|
223
|
+
description: err.message,
|
|
224
|
+
status: "error",
|
|
225
|
+
duration: 5000,
|
|
226
|
+
});
|
|
227
|
+
})
|
|
228
|
+
.finally(() => {
|
|
229
|
+
setIsUpdating(false);
|
|
230
|
+
});
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
return (
|
|
234
|
+
<GeneratedForm object={object} onSubmit={_onSave}>
|
|
235
|
+
<Button size="lg" isLoading={isUpdating} className="my-4" variant="primary" type="submit">
|
|
236
|
+
Save Properties
|
|
237
|
+
</Button>
|
|
238
|
+
</GeneratedForm>
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface SectionProps {
|
|
243
|
+
children: React.ReactNode;
|
|
244
|
+
title: string;
|
|
245
|
+
}
|
|
246
|
+
function Section({ children, title }: SectionProps) {
|
|
247
|
+
return (
|
|
248
|
+
<div className="my-4">
|
|
249
|
+
<div className="text-lg text-gray-700 font-semibold border-b border-b-gray-300 py-2 mb-4">{title}</div>
|
|
250
|
+
{children}
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|