@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,244 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import LocalizedFormat from 'dayjs/plugin/localizedFormat';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { ColumnLayout, ContentObjectType } from '@vertesia/common';
|
|
6
|
+
import { Button, Center, ErrorBox, Popover, PopoverContent, PopoverTrigger, Spinner, Switch, Tab, Tabs, TabsBar, TabsPanel, useFetch, useToast } from '@vertesia/ui/core';
|
|
7
|
+
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
8
|
+
import { useLocation, useNavigate } from "@vertesia/ui/router";
|
|
9
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
10
|
+
import { PropertiesView } from '@vertesia/ui/widgets';
|
|
11
|
+
import { EllipsisVertical, SquarePen, Trash2 } from 'lucide-react';
|
|
12
|
+
import { GenericPageNavHeader } from "../../layout";
|
|
13
|
+
import { UserInfo } from '../../user/UserInfo';
|
|
14
|
+
|
|
15
|
+
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
16
|
+
import { ObjectSchemaEditor } from './ObjectSchemaEditor';
|
|
17
|
+
import { TableLayoutEditor } from './TableLayoutEditor';
|
|
18
|
+
|
|
19
|
+
dayjs.extend(LocalizedFormat)
|
|
20
|
+
|
|
21
|
+
interface ContentObjectTypeViewProps {
|
|
22
|
+
typeId: string;
|
|
23
|
+
}
|
|
24
|
+
export function ContentObjectTypeView({ typeId }: ContentObjectTypeViewProps) {
|
|
25
|
+
const { store, user } = useUserSession();
|
|
26
|
+
const { hash } = useLocation();
|
|
27
|
+
const currentTab = hash ? hash.substring(1) : undefined;
|
|
28
|
+
|
|
29
|
+
let { data: objectType, isLoading, error, refetch } = useFetch(() => {
|
|
30
|
+
if (user) {
|
|
31
|
+
return store.types.retrieve(typeId);
|
|
32
|
+
} else {
|
|
33
|
+
return Promise.resolve(undefined);
|
|
34
|
+
}
|
|
35
|
+
}, [user]);
|
|
36
|
+
|
|
37
|
+
if (error) {
|
|
38
|
+
return <ErrorBox title="Error">{error.message}</ErrorBox>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (isLoading) {
|
|
42
|
+
return <Center className="py-10"><Spinner size='lg' /></Center>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (!objectType) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const actions = [
|
|
50
|
+
<DeleteTypeButton key="delete" objectType={objectType} />
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
const onSchemaUpdate = (value: any) => {
|
|
54
|
+
objectType.object_schema = value.schema;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const onLayoutUpdate = (value: ColumnLayout[] | undefined) => {
|
|
58
|
+
objectType.table_layout = value;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const tabs: Tab[] = [
|
|
62
|
+
{ name: 'metadata', label: "Metadata", href: "#metadata", content: <MetadataView objectType={objectType} /> },
|
|
63
|
+
{ name: 'schema', label: "Object Schema", href: "#schema", content: <ObjectSchemaEditor objectType={objectType} onSchemaUpdate={onSchemaUpdate} /> },
|
|
64
|
+
{ name: 'layout', label: "Table Layout", href: "#layout", content: <TableLayoutEditor objectType={objectType} onLayoutUpdate={onLayoutUpdate} /> },
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
const breadcrumbs = [breadcrumb()];
|
|
68
|
+
const title = pageTitle(objectType, refetch);
|
|
69
|
+
const description = objectType.description;
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<FullHeightLayout>
|
|
73
|
+
<GenericPageNavHeader title={title} description={description} actions={[actions]} breadcrumbs={breadcrumbs} />
|
|
74
|
+
<Tabs tabs={tabs} current={currentTab}>
|
|
75
|
+
<TabsBar />
|
|
76
|
+
<FullHeightLayout.Body>
|
|
77
|
+
<div className="h-[calc(100vh-187px)] overflow-auto">
|
|
78
|
+
<TabsPanel />
|
|
79
|
+
</div>
|
|
80
|
+
</FullHeightLayout.Body>
|
|
81
|
+
</Tabs>
|
|
82
|
+
</FullHeightLayout>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function breadcrumb() {
|
|
87
|
+
return <span>Content Type</span>
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function pageTitle(objectType: ContentObjectType, refetch: () => Promise<unknown>) {
|
|
91
|
+
return <PageTitle objectType={objectType} refetch={refetch} />
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function PageTitle({ objectType, refetch }: { objectType: ContentObjectType, refetch: () => Promise<unknown> }) {
|
|
95
|
+
const toast = useToast();
|
|
96
|
+
const session = useUserSession();
|
|
97
|
+
const { store } = session;
|
|
98
|
+
const [showEditModal, setShowEditModal] = useState(false);
|
|
99
|
+
const onCloseEditModal = (payload?: CreateOrUpdateTypePayload) => {
|
|
100
|
+
if (!payload) {
|
|
101
|
+
setShowEditModal(false);
|
|
102
|
+
return Promise.resolve();
|
|
103
|
+
}
|
|
104
|
+
return store.types.update(objectType.id, payload).then(() => {
|
|
105
|
+
toast({
|
|
106
|
+
status: 'success',
|
|
107
|
+
title: 'Type updated',
|
|
108
|
+
duration: 2000
|
|
109
|
+
});
|
|
110
|
+
return refetch().finally(() => session.reloadTypes());
|
|
111
|
+
}).catch(err => {
|
|
112
|
+
toast({
|
|
113
|
+
status: 'error',
|
|
114
|
+
title: 'Error updating type',
|
|
115
|
+
description: err.message,
|
|
116
|
+
duration: 5000
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return <>
|
|
121
|
+
<div className='flex items-center gap-x-2'>{objectType.name} <Button variant="ghost" size="sm" title="Edit" onClick={() => setShowEditModal(true)}><SquarePen className="size-4" /></Button></div>
|
|
122
|
+
<CreateOrUpdateTypeModal okLabel="Save Changes" title="Edit Type" isOpen={showEditModal} onClose={onCloseEditModal} initialPayload={objectType} />
|
|
123
|
+
</>
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
interface MetadataViewProps {
|
|
127
|
+
objectType: ContentObjectType;
|
|
128
|
+
}
|
|
129
|
+
function MetadataView({ objectType }: MetadataViewProps) {
|
|
130
|
+
return (
|
|
131
|
+
<PropertiesView className='w-full' properties={[
|
|
132
|
+
{ name: "Id", value: objectType.id },
|
|
133
|
+
{ name: "Name", value: objectType.name },
|
|
134
|
+
{ name: "Is Chunkable", value: <ChunkableSwitch objectType={objectType} /> },
|
|
135
|
+
{ name: "Strict Mode", value: <StrictModeSwitch objectType={objectType} /> },
|
|
136
|
+
{ name: 'Created By', value: <UserInfo userRef={objectType.created_by} /> },
|
|
137
|
+
{ name: 'Created At', value: dayjs(objectType.created_at).format('LLL') },
|
|
138
|
+
{ name: 'Updated By', value: <UserInfo userRef={objectType.updated_by} /> },
|
|
139
|
+
{ name: 'Updated At', value: dayjs(objectType.updated_at).format('LLL') },
|
|
140
|
+
]}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
interface TypeSwitchProps {
|
|
147
|
+
objectType: ContentObjectType;
|
|
148
|
+
field: 'is_chunkable' | 'strict_mode';
|
|
149
|
+
initialValue?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function TypeSwitch({ objectType, field, initialValue }: TypeSwitchProps) {
|
|
153
|
+
const [value, setValue] = useState(initialValue ?? false);
|
|
154
|
+
const toast = useToast();
|
|
155
|
+
const { store } = useUserSession();
|
|
156
|
+
|
|
157
|
+
const onChange = (value: boolean) => {
|
|
158
|
+
store.types.update(objectType.id, {
|
|
159
|
+
[field]: value
|
|
160
|
+
}).then(() => {
|
|
161
|
+
setValue(value);
|
|
162
|
+
toast({
|
|
163
|
+
status: 'success',
|
|
164
|
+
title: 'Successfully Updated.',
|
|
165
|
+
duration: 2000
|
|
166
|
+
})
|
|
167
|
+
}).catch((err) => {
|
|
168
|
+
toast({
|
|
169
|
+
status: 'error',
|
|
170
|
+
title: 'Failed to update.',
|
|
171
|
+
description: err.message,
|
|
172
|
+
duration: 5000
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return (
|
|
178
|
+
<Switch value={value} onChange={onChange} />
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
interface ChunkableSwitchProps {
|
|
183
|
+
objectType: ContentObjectType;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function ChunkableSwitch({ objectType }: ChunkableSwitchProps) {
|
|
187
|
+
return (
|
|
188
|
+
<TypeSwitch objectType={objectType} field="is_chunkable" initialValue={objectType.is_chunkable ?? false} />
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
interface StrictModeSwitchProps {
|
|
193
|
+
objectType: ContentObjectType;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function StrictModeSwitch({ objectType }: StrictModeSwitchProps) {
|
|
197
|
+
return (
|
|
198
|
+
<TypeSwitch objectType={objectType} field="strict_mode" initialValue={objectType.strict_mode ?? false} />
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
interface DeleteTypeButtonProps {
|
|
202
|
+
objectType: ContentObjectType;
|
|
203
|
+
}
|
|
204
|
+
function DeleteTypeButton({ objectType }: DeleteTypeButtonProps) {
|
|
205
|
+
const toast = useToast();
|
|
206
|
+
const navigate = useNavigate();
|
|
207
|
+
const { store } = useUserSession();
|
|
208
|
+
const onDelete = () => {
|
|
209
|
+
confirm('Are you sure you want to delete this rule?') &&
|
|
210
|
+
store.types.delete(objectType.id).then(() => {
|
|
211
|
+
toast({
|
|
212
|
+
status: 'success',
|
|
213
|
+
title: `Object type ${objectType.name} deleted`,
|
|
214
|
+
duration: 2000
|
|
215
|
+
});
|
|
216
|
+
navigate('/types');
|
|
217
|
+
}).catch(err => {
|
|
218
|
+
toast(
|
|
219
|
+
{
|
|
220
|
+
status: 'error',
|
|
221
|
+
title: 'Failed to delete rule',
|
|
222
|
+
description: err.message,
|
|
223
|
+
duration: 5000
|
|
224
|
+
}
|
|
225
|
+
)
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
return (
|
|
229
|
+
<Popover hover>
|
|
230
|
+
<PopoverTrigger>
|
|
231
|
+
<div className='cursor-pointer hover:bg-muted p-2 rounded-md'>
|
|
232
|
+
<Button variant="ghost" size='sm' title='More actions'><EllipsisVertical /></Button>
|
|
233
|
+
</div>
|
|
234
|
+
</PopoverTrigger >
|
|
235
|
+
<PopoverContent className='p-0 w-35' align='end'>
|
|
236
|
+
<div className="py-2 px-1.5 flex justify-center w-full">
|
|
237
|
+
<Button variant="ghost" onClick={onDelete} className='w-full'>
|
|
238
|
+
<Trash2 className='size-4' /> Delete
|
|
239
|
+
</Button>
|
|
240
|
+
</div>
|
|
241
|
+
</PopoverContent>
|
|
242
|
+
</Popover >
|
|
243
|
+
)
|
|
244
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { ContentObjectTypesTable } from './ContentObjectTypesTable';
|
|
4
|
+
import { useWatchSearchResult } from './search/ObjectTypeSearchContext';
|
|
5
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
6
|
+
import { EmptyCollection, ErrorBox, Input, SelectBox, useToast } from '@vertesia/ui/core';
|
|
7
|
+
import { useDebounce, useIntersectionObserver } from '@vertesia/ui/core';
|
|
8
|
+
|
|
9
|
+
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
10
|
+
|
|
11
|
+
enum ChunkableOptions { true = "Yes", false = "No" };
|
|
12
|
+
|
|
13
|
+
interface ContentObjectTypesSearchProps {
|
|
14
|
+
isDirty?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export function ContentObjectTypesSearch({ isDirty = false }: ContentObjectTypesSearchProps) {
|
|
17
|
+
const session = useUserSession();
|
|
18
|
+
const { store } = session;
|
|
19
|
+
|
|
20
|
+
const toast = useToast();
|
|
21
|
+
|
|
22
|
+
const [isReady, setIsReady] = useState(false);
|
|
23
|
+
const { search, isLoading, error, objects } = useWatchSearchResult();
|
|
24
|
+
|
|
25
|
+
const [searchTerm, setSearchTerm] = useState<string>('');
|
|
26
|
+
const debounceValue = useDebounce(searchTerm, 500);
|
|
27
|
+
|
|
28
|
+
const loadMoreRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
useIntersectionObserver(loadMoreRef, () => {
|
|
30
|
+
isReady && search.loadMore();
|
|
31
|
+
}, { deps: [isReady] });
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
search.search().then(() => setIsReady(true));
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
search.query.name = searchTerm;
|
|
39
|
+
search.search().then(() => setIsReady(true));
|
|
40
|
+
}, [debounceValue]);
|
|
41
|
+
|
|
42
|
+
const [chunkable, setChunkable] = useState(undefined);
|
|
43
|
+
const onChunkableChange = (data: any) => {
|
|
44
|
+
setChunkable(data);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
search.query.chunkable = chunkable ? chunkable == 'Yes' : undefined
|
|
49
|
+
search.search().then(() => setIsReady(true));
|
|
50
|
+
}, [chunkable]);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (isDirty && isReady) {
|
|
54
|
+
search.search().then(() => setIsReady(true));
|
|
55
|
+
}
|
|
56
|
+
}, [isDirty]);
|
|
57
|
+
|
|
58
|
+
const [showCreateModal, setShowCreateModal] = useState(false);
|
|
59
|
+
const onOpenCreateModal = () => {
|
|
60
|
+
setShowCreateModal(true);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (error) {
|
|
64
|
+
return (
|
|
65
|
+
<ErrorBox title="Failed to fetch ObjectTypes">{error.message}</ErrorBox>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const onCloseCreateModal = async (payload?: CreateOrUpdateTypePayload) => {
|
|
70
|
+
if (!payload) {
|
|
71
|
+
setShowCreateModal(false);
|
|
72
|
+
return Promise.resolve();
|
|
73
|
+
}
|
|
74
|
+
return store.types.create(payload).then(async () => {
|
|
75
|
+
toast({
|
|
76
|
+
status: 'success',
|
|
77
|
+
title: 'Type created',
|
|
78
|
+
duration: 2000
|
|
79
|
+
});
|
|
80
|
+
session.reloadTypes();
|
|
81
|
+
search.search().then(() => setIsReady(true));
|
|
82
|
+
}).catch(err => {
|
|
83
|
+
toast({
|
|
84
|
+
status: 'error',
|
|
85
|
+
title: 'Error creating type',
|
|
86
|
+
description: err.message,
|
|
87
|
+
duration: 5000
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<div>
|
|
94
|
+
<div className="flex gap-4">
|
|
95
|
+
<Input placeholder="Filter by Name" value={searchTerm} onChange={setSearchTerm} />
|
|
96
|
+
<SelectBox className="w-60" isClearable options={Object.values(ChunkableOptions)} value={chunkable} onChange={onChunkableChange} placeholder={"Is Chunkable"} />
|
|
97
|
+
</div>
|
|
98
|
+
<div className="w-full">
|
|
99
|
+
{
|
|
100
|
+
(!isLoading && objects?.length === 0) ?
|
|
101
|
+
<EmptyCollection title="No Type" buttonLabel='Create Type' onClick={onOpenCreateModal}>
|
|
102
|
+
Get started by creating a new Type.
|
|
103
|
+
</EmptyCollection >
|
|
104
|
+
:
|
|
105
|
+
<ContentObjectTypesTable objects={objects} isLoading={isLoading} />
|
|
106
|
+
}
|
|
107
|
+
<CreateOrUpdateTypeModal okLabel="Create" title="Create Type" isOpen={showCreateModal} onClose={onCloseCreateModal} />
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ContentObjectTypeItem } from "@vertesia/common";
|
|
2
|
+
import { TBody, Table } from "@vertesia/ui/core";
|
|
3
|
+
import { useNavigate } from "@vertesia/ui/router";
|
|
4
|
+
import dayjs from "dayjs";
|
|
5
|
+
import relativeTime from "dayjs/plugin/relativeTime";
|
|
6
|
+
|
|
7
|
+
dayjs.extend(relativeTime);
|
|
8
|
+
|
|
9
|
+
interface ContentObjectTypesTableProps {
|
|
10
|
+
objects?: ContentObjectTypeItem[];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
}
|
|
13
|
+
export function ContentObjectTypesTable({ objects, isLoading }: ContentObjectTypesTableProps) {
|
|
14
|
+
const navigate = useNavigate();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div>
|
|
18
|
+
<Table className="w-full">
|
|
19
|
+
<thead>
|
|
20
|
+
<tr>
|
|
21
|
+
<th>Name</th>
|
|
22
|
+
<th>Is Chunkable?</th>
|
|
23
|
+
<th>Updated At</th>
|
|
24
|
+
</tr>
|
|
25
|
+
</thead>
|
|
26
|
+
<TBody isLoading={isLoading} columns={3}>
|
|
27
|
+
{objects?.map((obj: any) => (
|
|
28
|
+
<tr key={obj.id} onClick={() => navigate(`/types/${obj.id}`)} className='cursor-pointer hover:bg-muted'>
|
|
29
|
+
<td>{obj.name}</td>
|
|
30
|
+
<td>{obj.is_chunkable ? 'Yes' : 'No'}</td>
|
|
31
|
+
<td>{dayjs(obj.updated_at).fromNow()}</td>
|
|
32
|
+
</tr>
|
|
33
|
+
))}
|
|
34
|
+
</TBody>
|
|
35
|
+
</Table>
|
|
36
|
+
</div>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Button, useToast } from '@vertesia/ui/core';
|
|
4
|
+
import { FullHeightLayout } from '@vertesia/ui/layout';
|
|
5
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
6
|
+
import { GenericPageNavHeader } from "../../layout";
|
|
7
|
+
import { ContentObjectTypesSearch } from './ContentObjectTypesSearch';
|
|
8
|
+
import { ObjectTypeSearchProvider } from './search/ObjectTypeSearchProvider';
|
|
9
|
+
|
|
10
|
+
import { CreateOrUpdateTypeModal, CreateOrUpdateTypePayload } from './CreateOrUpdateTypeModal';
|
|
11
|
+
|
|
12
|
+
export enum ChunkableOptions {
|
|
13
|
+
true = "Yes",
|
|
14
|
+
false = "No"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface ContentObjectTypesViewProps { }
|
|
18
|
+
export function ContentObjectTypesView({ }: ContentObjectTypesViewProps) {
|
|
19
|
+
const toast = useToast();
|
|
20
|
+
const [showCreateModal, setShowCreateModal] = useState(false);
|
|
21
|
+
const session = useUserSession();
|
|
22
|
+
const { store } = session;
|
|
23
|
+
|
|
24
|
+
const actions = <Button key="create" variant="primary" onClick={() => setShowCreateModal(true)}>Create Type</Button>;
|
|
25
|
+
|
|
26
|
+
const [isDirty, setIsDirty] = useState(false);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (isDirty) {
|
|
29
|
+
setIsDirty(false);
|
|
30
|
+
}
|
|
31
|
+
}, [isDirty]);
|
|
32
|
+
|
|
33
|
+
const onCloseCreateModal = async (payload?: CreateOrUpdateTypePayload) => {
|
|
34
|
+
if (!payload) {
|
|
35
|
+
setShowCreateModal(false);
|
|
36
|
+
return Promise.resolve();
|
|
37
|
+
}
|
|
38
|
+
return store.types.create(payload).then(async () => {
|
|
39
|
+
toast({
|
|
40
|
+
status: 'success',
|
|
41
|
+
title: 'Type created',
|
|
42
|
+
duration: 2000
|
|
43
|
+
});
|
|
44
|
+
session.reloadTypes();
|
|
45
|
+
setIsDirty(true);
|
|
46
|
+
}).catch(err => {
|
|
47
|
+
toast({
|
|
48
|
+
status: 'error',
|
|
49
|
+
title: 'Error creating type',
|
|
50
|
+
description: err.message,
|
|
51
|
+
duration: 5000
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const breadcrumbs = [
|
|
57
|
+
<span key='0'>Content Type</span>
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<FullHeightLayout>
|
|
62
|
+
<GenericPageNavHeader actions={actions} breadcrumbs={breadcrumbs} title="Content Types" />
|
|
63
|
+
<CreateOrUpdateTypeModal okLabel="Create" title="Create Type" isOpen={showCreateModal} onClose={onCloseCreateModal} />
|
|
64
|
+
<ObjectTypeSearchProvider>
|
|
65
|
+
<FullHeightLayout.Body>
|
|
66
|
+
<ContentObjectTypesSearch isDirty={isDirty}></ContentObjectTypesSearch>
|
|
67
|
+
</FullHeightLayout.Body>
|
|
68
|
+
</ObjectTypeSearchProvider>
|
|
69
|
+
</FullHeightLayout>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Button, Input, Modal, ModalBody, ModalFooter, ModalTitle, Switch, useToast } from '@vertesia/ui/core';
|
|
4
|
+
|
|
5
|
+
export interface CreateOrUpdateTypePayload {
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
strict_mode?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface CreateOrUpdateTypeModalProps {
|
|
11
|
+
title: string;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onClose: (payload?: CreateOrUpdateTypePayload) => Promise<unknown>;
|
|
14
|
+
okLabel: string;
|
|
15
|
+
initialPayload?: CreateOrUpdateTypePayload;
|
|
16
|
+
}
|
|
17
|
+
export function CreateOrUpdateTypeModal({ title, isOpen, onClose, okLabel, initialPayload }: CreateOrUpdateTypeModalProps) {
|
|
18
|
+
const toast = useToast();
|
|
19
|
+
const [name, setName] = useState<string | undefined>(initialPayload?.name);
|
|
20
|
+
const [description, setDescription] = useState<string | undefined>(initialPayload?.description);
|
|
21
|
+
const [strictMode, setStrictMode] = useState<boolean>(initialPayload?.strict_mode ?? false);
|
|
22
|
+
|
|
23
|
+
const onSave = () => {
|
|
24
|
+
if (!name) {
|
|
25
|
+
toast({
|
|
26
|
+
status: 'error',
|
|
27
|
+
title: 'Name is required',
|
|
28
|
+
duration: 5000
|
|
29
|
+
})
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const payload = { name, description, strict_mode: strictMode };
|
|
33
|
+
onClose(payload).then(() => onClose());
|
|
34
|
+
|
|
35
|
+
setName(undefined);
|
|
36
|
+
setDescription(undefined);
|
|
37
|
+
setStrictMode(false);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Modal isOpen={isOpen} onClose={() => onClose()}>
|
|
42
|
+
<ModalTitle>{title}</ModalTitle>
|
|
43
|
+
<ModalBody className="pt-0">
|
|
44
|
+
<div className='h-full flex flex-col gap-4 content-between'>
|
|
45
|
+
<div>
|
|
46
|
+
<label className="block text-sm font-medium text-muted">Name</label>
|
|
47
|
+
<Input value={name} onChange={setName} />
|
|
48
|
+
</div>
|
|
49
|
+
<div>
|
|
50
|
+
<label className="block text-sm font-medium text-muted">Description</label>
|
|
51
|
+
<Input value={description} onChange={setDescription} />
|
|
52
|
+
</div>
|
|
53
|
+
<div className="flex items-center justify-between">
|
|
54
|
+
<label className="block text-sm font-medium text-muted-foreground">Strict Mode</label>
|
|
55
|
+
<Switch value={strictMode} onChange={setStrictMode} />
|
|
56
|
+
</div>
|
|
57
|
+
<div className="text-xs text-muted-foreground">
|
|
58
|
+
When enabled, objects will be validated against the schema at generation and save time.
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</ModalBody>
|
|
62
|
+
<ModalFooter>
|
|
63
|
+
<div className='flex justify-end gap-4'>
|
|
64
|
+
<Button variant="secondary" onClick={() => onClose()}>Cancel</Button>
|
|
65
|
+
<Button variant="primary" onClick={() => onSave()}>{okLabel}</Button>
|
|
66
|
+
</div>
|
|
67
|
+
</ModalFooter>
|
|
68
|
+
</Modal>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { basicSetup } from 'codemirror';
|
|
2
|
+
import { useMemo, useRef, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
5
|
+
import { json } from '@codemirror/lang-json';
|
|
6
|
+
import { CodeMirrorEditor, EditorApi } from '@vertesia/ui/widgets';
|
|
7
|
+
import { Button, useToast } from '@vertesia/ui/core';
|
|
8
|
+
import { SchemaEditor, useSchema } from '@vertesia/ui/widgets';
|
|
9
|
+
import { ContentObjectType } from '@vertesia/common';
|
|
10
|
+
|
|
11
|
+
const CODE_MIRROR_EXTENSIONS = [basicSetup, json()];
|
|
12
|
+
|
|
13
|
+
interface ObjectSchemaEditorProps {
|
|
14
|
+
objectType: ContentObjectType;
|
|
15
|
+
onSchemaUpdate: (jsonSchema: any) => void;
|
|
16
|
+
}
|
|
17
|
+
export function ObjectSchemaEditor({ objectType, onSchemaUpdate }: ObjectSchemaEditorProps) {
|
|
18
|
+
const { store } = useUserSession();
|
|
19
|
+
const toast = useToast();
|
|
20
|
+
|
|
21
|
+
const [isUpdating, setUpdating] = useState(false);
|
|
22
|
+
const schema = useSchema(objectType.object_schema);
|
|
23
|
+
const editorRef = useRef<EditorApi | undefined>(undefined);
|
|
24
|
+
const [displayJson, setDisplayJson] = useState(false);
|
|
25
|
+
|
|
26
|
+
const value = useMemo(() => {
|
|
27
|
+
return jsonToContent(schema.schema);
|
|
28
|
+
}, [schema]);
|
|
29
|
+
|
|
30
|
+
const onSave = () => {
|
|
31
|
+
if (displayJson) {
|
|
32
|
+
if (!updateSchemaFromJson()) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
setUpdating(true);
|
|
38
|
+
store.types.update(objectType.id, { object_schema: schema.schema }).then(() => {
|
|
39
|
+
onSchemaUpdate(schema);
|
|
40
|
+
toast({
|
|
41
|
+
status: 'success',
|
|
42
|
+
title: 'Schema updated',
|
|
43
|
+
description: 'The schema has been updated successfully',
|
|
44
|
+
duration: 2000
|
|
45
|
+
});
|
|
46
|
+
}).catch((err) => {
|
|
47
|
+
toast({
|
|
48
|
+
status: 'error',
|
|
49
|
+
title: 'Failed to update schema',
|
|
50
|
+
description: err.message,
|
|
51
|
+
duration: 5000
|
|
52
|
+
})
|
|
53
|
+
}).finally(() => {
|
|
54
|
+
setUpdating(false);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleOnSave = () => {
|
|
59
|
+
if (displayJson) {
|
|
60
|
+
if (!updateSchemaFromJson()) {
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
setDisplayJson(prev => !prev)
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const updateSchemaFromJson = () => {
|
|
69
|
+
if (editorRef.current) {
|
|
70
|
+
const value = editorRef.current.getValue();
|
|
71
|
+
try {
|
|
72
|
+
const newSchema = contentToJson(value);
|
|
73
|
+
schema.replaceSchema(newSchema);
|
|
74
|
+
} catch (err: any) {
|
|
75
|
+
toast({
|
|
76
|
+
status: 'error',
|
|
77
|
+
title: 'Invalid JSON Schema',
|
|
78
|
+
description: err.message,
|
|
79
|
+
duration: 5000
|
|
80
|
+
})
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div className="mx-2 my-2 rounded-md border border-solid shadow-md border-spacing-2">
|
|
89
|
+
<div className="flex items-center rounded-t-md border-b gap-x-2 py-2 px-4">
|
|
90
|
+
<div className="text-lg font-semibold">Schema Editor</div>
|
|
91
|
+
<div>
|
|
92
|
+
<Button variant="outline" size="sm" onClick={handleOnSave}>
|
|
93
|
+
{
|
|
94
|
+
displayJson ? "Edit Schema" : "Edit Json"
|
|
95
|
+
}
|
|
96
|
+
</Button>
|
|
97
|
+
</div>
|
|
98
|
+
<div className="ml-auto flex gap-x-2">
|
|
99
|
+
<Button isLoading={isUpdating} variant="outline" size="sm" onClick={onSave}>Save Changes</Button>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div className="px-4 py-2">
|
|
103
|
+
{
|
|
104
|
+
displayJson
|
|
105
|
+
? <CodeMirrorEditor value={value} extensions={CODE_MIRROR_EXTENSIONS} editorRef={editorRef} />
|
|
106
|
+
: <SchemaEditor schema={schema} />
|
|
107
|
+
}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function jsonToContent(json: any | undefined | null) {
|
|
114
|
+
if (!json) {
|
|
115
|
+
return ''
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return JSON.stringify(json, null, 2);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function contentToJson(content: string | undefined | null) {
|
|
122
|
+
if (!content?.trim()) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return JSON.parse(content.trim());
|
|
127
|
+
}
|