@vertesia/ui 0.60.0 → 0.62.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/calendar.js +7 -39
- package/lib/esm/core/components/shadcn/calendar.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 +27 -26
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +19 -14
- 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/calendar.d.ts +3 -3
- 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 +14 -6
- 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/calendar.tsx +9 -65
- 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 +57 -52
- package/src/core/components/shadcn/filters/dateFilter.tsx +46 -29
- 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,466 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import Markdown from "react-markdown";
|
|
3
|
+
import remarkGfm from "remark-gfm";
|
|
4
|
+
|
|
5
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
6
|
+
import { Button, Link, Spinner, useToast } from "@vertesia/ui/core";
|
|
7
|
+
import { JSONDisplay } from "@vertesia/ui/widgets";
|
|
8
|
+
import { ContentObject, ImageRenditionFormat } from "@vertesia/common";
|
|
9
|
+
import { Copy, Download, SquarePen } from "lucide-react";
|
|
10
|
+
import { PropertiesEditorModal } from "./PropertiesEditorModal";
|
|
11
|
+
|
|
12
|
+
interface ContentOverviewProps {
|
|
13
|
+
object: ContentObject;
|
|
14
|
+
loadText?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export function ContentOverview({
|
|
17
|
+
object,
|
|
18
|
+
loadText,
|
|
19
|
+
}: ContentOverviewProps) {
|
|
20
|
+
const { client, store } = useUserSession();
|
|
21
|
+
const [isLoadingText, setIsLoadingText] = useState(false);
|
|
22
|
+
const [text, setText] = useState<string | undefined>(object.text);
|
|
23
|
+
const [imageUrl, setImageUrl] = useState<string>();
|
|
24
|
+
const [isPropertiesModalOpen, setPropertiesModalOpen] = useState(false);
|
|
25
|
+
const toast = useToast();
|
|
26
|
+
const [viewCode, setViewCode] = useState(false);
|
|
27
|
+
const VIEW_JSON = "JSON";
|
|
28
|
+
const VIEW_TEXT = "Preview";
|
|
29
|
+
|
|
30
|
+
const handleOpenPropertiesModal = () => {
|
|
31
|
+
setPropertiesModalOpen(true);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleClosePropertiesModal = () => {
|
|
35
|
+
setPropertiesModalOpen(false);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (loadText && !text) {
|
|
40
|
+
setIsLoadingText(true);
|
|
41
|
+
store.objects
|
|
42
|
+
.getObjectText(object.id)
|
|
43
|
+
.then((res) => {
|
|
44
|
+
setText(res.text);
|
|
45
|
+
})
|
|
46
|
+
.catch((err) => {
|
|
47
|
+
console.error("Failed to load text", err);
|
|
48
|
+
})
|
|
49
|
+
.finally(() => {
|
|
50
|
+
setIsLoadingText(false);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}, [loadText]);
|
|
54
|
+
|
|
55
|
+
const handleCopyContent = async (
|
|
56
|
+
content: string,
|
|
57
|
+
type: "text" | "properties",
|
|
58
|
+
) => {
|
|
59
|
+
try {
|
|
60
|
+
await navigator.clipboard.writeText(content);
|
|
61
|
+
toast({
|
|
62
|
+
status: "success",
|
|
63
|
+
title: `${type === "text" ? "Content" : "Properties"} copied`,
|
|
64
|
+
description: `Successfully copied ${type} to clipboard`,
|
|
65
|
+
duration: 2000,
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
console.error(`Failed to copy ${type}:`, err);
|
|
69
|
+
toast({
|
|
70
|
+
status: "error",
|
|
71
|
+
title: "Copy failed",
|
|
72
|
+
description: `Failed to copy ${type} to clipboard`,
|
|
73
|
+
duration: 5000,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const handleExportDocument = async (format: "docx" | "pdf") => {
|
|
79
|
+
try {
|
|
80
|
+
// Request document rendition from the server
|
|
81
|
+
const response = await client.objects.getRendition(object.id, {
|
|
82
|
+
format: format as any, // We're extending the format type
|
|
83
|
+
max_hw: 1024, // Not used for document exports but required by API
|
|
84
|
+
generate_if_missing: true,
|
|
85
|
+
sign_url: true,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (response.status === "generating") {
|
|
89
|
+
toast({
|
|
90
|
+
status: "info",
|
|
91
|
+
title: "Generating document",
|
|
92
|
+
description: `Please wait while we prepare your ${format.toUpperCase()} file...`,
|
|
93
|
+
duration: 5000,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Poll for completion
|
|
97
|
+
setTimeout(() => handleExportDocument(format), 3000);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (response.status === "failed") {
|
|
102
|
+
throw new Error("Document generation failed");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Download the generated file or open in new window
|
|
106
|
+
if (response.renditions && response.renditions.length > 0) {
|
|
107
|
+
const downloadUrl = response.renditions[0];
|
|
108
|
+
|
|
109
|
+
if (format === 'pdf') {
|
|
110
|
+
// Open PDF in new window
|
|
111
|
+
window.open(downloadUrl, '_blank');
|
|
112
|
+
toast({
|
|
113
|
+
status: "success",
|
|
114
|
+
title: "PDF opened",
|
|
115
|
+
description: "PDF document opened in a new window",
|
|
116
|
+
duration: 2000,
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
// Download DOCX file
|
|
120
|
+
const link = document.createElement("a");
|
|
121
|
+
link.href = downloadUrl;
|
|
122
|
+
link.download = `${object.name || "document"}.${format}`;
|
|
123
|
+
document.body.appendChild(link);
|
|
124
|
+
link.click();
|
|
125
|
+
document.body.removeChild(link);
|
|
126
|
+
|
|
127
|
+
toast({
|
|
128
|
+
status: "success",
|
|
129
|
+
title: "Document exported",
|
|
130
|
+
description: `Successfully exported to ${format.toUpperCase()} format`,
|
|
131
|
+
duration: 2000,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
} catch (err) {
|
|
136
|
+
console.error(`Failed to export document as ${format}:`, err);
|
|
137
|
+
toast({
|
|
138
|
+
status: "error",
|
|
139
|
+
title: "Export failed",
|
|
140
|
+
description: `Failed to export document to ${format.toUpperCase()} format`,
|
|
141
|
+
duration: 5000,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const handleExportDocx = () => handleExportDocument("docx");
|
|
147
|
+
//const handleExportPdf = () => handleExportDocument("pdf");
|
|
148
|
+
|
|
149
|
+
const content = object.content;
|
|
150
|
+
const isImage =
|
|
151
|
+
content &&
|
|
152
|
+
content.source &&
|
|
153
|
+
content.type &&
|
|
154
|
+
content.type.startsWith("image/");
|
|
155
|
+
const isMarkdownOrText =
|
|
156
|
+
content &&
|
|
157
|
+
content.type &&
|
|
158
|
+
(content.type === "text/markdown" || content.type === "text/plain");
|
|
159
|
+
// Check for markdown indicators, ignoring any HTML comments
|
|
160
|
+
const seemsMarkdown =
|
|
161
|
+
text &&
|
|
162
|
+
// Look for markdown indicators
|
|
163
|
+
(text.includes("\n#") ||
|
|
164
|
+
text.includes("\n*") ||
|
|
165
|
+
text.includes("\n+") ||
|
|
166
|
+
text.includes("!["));
|
|
167
|
+
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (isImage) {
|
|
170
|
+
client.objects
|
|
171
|
+
.getRendition(object.id, {
|
|
172
|
+
max_hw: 1024,
|
|
173
|
+
format: ImageRenditionFormat.jpeg,
|
|
174
|
+
generate_if_missing: false,
|
|
175
|
+
sign_url: true,
|
|
176
|
+
})
|
|
177
|
+
.then((r) => {
|
|
178
|
+
if (r.status === "found") {
|
|
179
|
+
return r.renditions?.length ? r.renditions[0] : null;
|
|
180
|
+
} else {
|
|
181
|
+
return object;
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
.catch(() => {
|
|
185
|
+
return object;
|
|
186
|
+
})
|
|
187
|
+
.then(() => {
|
|
188
|
+
client.files
|
|
189
|
+
.getDownloadUrl(object.content.source!)
|
|
190
|
+
.then((r) => {
|
|
191
|
+
setImageUrl(r.url);
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}, []);
|
|
196
|
+
|
|
197
|
+
return (
|
|
198
|
+
<div className="w-full">
|
|
199
|
+
<div className="flex flex-col lg:flex-row lg:gap-8">
|
|
200
|
+
<div className="w-full lg:w-1/2">
|
|
201
|
+
<div className="h-[41px] text-lg font-semibold mb-4 border-b flex justify-between items-center">
|
|
202
|
+
<div className="flex items-center gap-1">
|
|
203
|
+
Properties
|
|
204
|
+
<Button
|
|
205
|
+
variant="outline"
|
|
206
|
+
size="sm"
|
|
207
|
+
alt={`${viewCode ? "Preview" : "View in JSON format"}`}
|
|
208
|
+
onClick={() => setViewCode(!viewCode)}
|
|
209
|
+
>
|
|
210
|
+
{viewCode ? VIEW_TEXT : VIEW_JSON}
|
|
211
|
+
</Button>
|
|
212
|
+
</div>
|
|
213
|
+
<div className="flex items-center gap-2">
|
|
214
|
+
{object.properties && (
|
|
215
|
+
<Button
|
|
216
|
+
variant="ghost"
|
|
217
|
+
size="sm"
|
|
218
|
+
title="Copy properties"
|
|
219
|
+
onClick={() =>
|
|
220
|
+
handleCopyContent(
|
|
221
|
+
JSON.stringify(
|
|
222
|
+
object.properties,
|
|
223
|
+
null,
|
|
224
|
+
2,
|
|
225
|
+
),
|
|
226
|
+
"properties",
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
>
|
|
230
|
+
<Copy className="size-4" />
|
|
231
|
+
</Button>
|
|
232
|
+
)}
|
|
233
|
+
<Button
|
|
234
|
+
variant="ghost"
|
|
235
|
+
size="sm"
|
|
236
|
+
onClick={handleOpenPropertiesModal}
|
|
237
|
+
title="Edit properties"
|
|
238
|
+
className="flex items-center gap-2"
|
|
239
|
+
>
|
|
240
|
+
<SquarePen className="size-4" />
|
|
241
|
+
</Button>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
{object.properties ? (
|
|
245
|
+
<JSONDisplay
|
|
246
|
+
value={object.properties}
|
|
247
|
+
viewCode={viewCode}
|
|
248
|
+
/>
|
|
249
|
+
) : (
|
|
250
|
+
<div>No properties defined</div>
|
|
251
|
+
)}
|
|
252
|
+
{isImage && (
|
|
253
|
+
<div className="my-4">
|
|
254
|
+
<div className="h-[41px] text-lg font-semibold mb-4 border-b flex justify-between items-center">
|
|
255
|
+
<span className="py-1">Image</span>
|
|
256
|
+
</div>
|
|
257
|
+
{imageUrl ? (
|
|
258
|
+
<img
|
|
259
|
+
src={imageUrl}
|
|
260
|
+
alt={object.name}
|
|
261
|
+
className="w-full object-contain"
|
|
262
|
+
/>
|
|
263
|
+
) : (
|
|
264
|
+
<Spinner size="md" />
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
)}
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<div className="w-full lg:w-1/2 mt-4 lg:mt-0">
|
|
271
|
+
<div className="h-[41px] text-lg font-semibold mb-4 border-b flex justify-between items-center">
|
|
272
|
+
<span className="py-1">Text</span>
|
|
273
|
+
<div className="flex items-center gap-2">
|
|
274
|
+
{text && (
|
|
275
|
+
<Button
|
|
276
|
+
variant="ghost"
|
|
277
|
+
size="sm"
|
|
278
|
+
title="Copy text"
|
|
279
|
+
onClick={() =>
|
|
280
|
+
handleCopyContent(text, "text")
|
|
281
|
+
}
|
|
282
|
+
className="flex items-center gap-2"
|
|
283
|
+
>
|
|
284
|
+
<Copy className="h-4 w-4" />
|
|
285
|
+
</Button>
|
|
286
|
+
)}
|
|
287
|
+
{(isMarkdownOrText || seemsMarkdown) && text && (
|
|
288
|
+
<>
|
|
289
|
+
<Button
|
|
290
|
+
variant="ghost"
|
|
291
|
+
size="sm"
|
|
292
|
+
onClick={handleExportDocx}
|
|
293
|
+
className="flex items-center gap-2"
|
|
294
|
+
>
|
|
295
|
+
<Download className="h-4 w-4" />
|
|
296
|
+
DOCX
|
|
297
|
+
</Button>
|
|
298
|
+
</>
|
|
299
|
+
)}
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
{isLoadingText && <Spinner size="md" />}
|
|
303
|
+
{text ? (
|
|
304
|
+
<div className="border shadow-xs rounded-xs max-w-7xl">
|
|
305
|
+
{seemsMarkdown ? (
|
|
306
|
+
<div className="prose prose-sm max-w-none prose-p:bg-transparent prose-p:my-0 prose-pre:bg-gray-800 dark:prose-pre:bg-gray-900 prose-pre:my-2 prose-code:bg-gray-200/70 dark:prose-code:bg-gray-700/50 prose-headings:bg-transparent prose-li:bg-transparent dark:prose-invert dark:text-gray-100">
|
|
307
|
+
<Markdown
|
|
308
|
+
remarkPlugins={[remarkGfm]}
|
|
309
|
+
components={{
|
|
310
|
+
a: ({
|
|
311
|
+
node,
|
|
312
|
+
...props
|
|
313
|
+
}: {
|
|
314
|
+
node?: any;
|
|
315
|
+
href?: string;
|
|
316
|
+
children?: React.ReactNode;
|
|
317
|
+
}) => {
|
|
318
|
+
const href = props.href || "";
|
|
319
|
+
if (
|
|
320
|
+
href.startsWith(
|
|
321
|
+
"/store/objects/",
|
|
322
|
+
)
|
|
323
|
+
) {
|
|
324
|
+
return (
|
|
325
|
+
<Link
|
|
326
|
+
href={href}
|
|
327
|
+
className="text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300"
|
|
328
|
+
>
|
|
329
|
+
{props.children}
|
|
330
|
+
</Link>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
return (
|
|
334
|
+
<a
|
|
335
|
+
{...props}
|
|
336
|
+
target="_blank"
|
|
337
|
+
rel="noopener noreferrer"
|
|
338
|
+
/>
|
|
339
|
+
);
|
|
340
|
+
},
|
|
341
|
+
p: ({
|
|
342
|
+
node,
|
|
343
|
+
...props
|
|
344
|
+
}: {
|
|
345
|
+
node?: any;
|
|
346
|
+
children?: React.ReactNode;
|
|
347
|
+
}) => (
|
|
348
|
+
<p
|
|
349
|
+
{...props}
|
|
350
|
+
className="my-0 text-gray-800 dark:text-gray-100"
|
|
351
|
+
/>
|
|
352
|
+
),
|
|
353
|
+
pre: ({
|
|
354
|
+
node,
|
|
355
|
+
...props
|
|
356
|
+
}: {
|
|
357
|
+
node?: any;
|
|
358
|
+
children?: React.ReactNode;
|
|
359
|
+
}) => (
|
|
360
|
+
<pre
|
|
361
|
+
{...props}
|
|
362
|
+
className="my-2 bg-gray-800 dark:bg-gray-900 p-2 rounded text-gray-100"
|
|
363
|
+
/>
|
|
364
|
+
),
|
|
365
|
+
code: ({
|
|
366
|
+
node,
|
|
367
|
+
className,
|
|
368
|
+
children,
|
|
369
|
+
...props
|
|
370
|
+
}: {
|
|
371
|
+
node?: any;
|
|
372
|
+
className?: string;
|
|
373
|
+
children?: React.ReactNode;
|
|
374
|
+
}) => {
|
|
375
|
+
const match =
|
|
376
|
+
/language-(\w+)/.exec(
|
|
377
|
+
className || "",
|
|
378
|
+
);
|
|
379
|
+
const isInline = !match;
|
|
380
|
+
return (
|
|
381
|
+
<code
|
|
382
|
+
{...props}
|
|
383
|
+
className={
|
|
384
|
+
isInline
|
|
385
|
+
? "px-1.5 py-0.5 rounded text-muted bg-gray-200/70 dark:bg-gray-700/50"
|
|
386
|
+
: "text-gray-100"
|
|
387
|
+
}
|
|
388
|
+
>
|
|
389
|
+
{children}
|
|
390
|
+
</code>
|
|
391
|
+
);
|
|
392
|
+
},
|
|
393
|
+
h1: ({
|
|
394
|
+
node,
|
|
395
|
+
...props
|
|
396
|
+
}: {
|
|
397
|
+
node?: any;
|
|
398
|
+
children?: React.ReactNode;
|
|
399
|
+
}) => (
|
|
400
|
+
<h1
|
|
401
|
+
{...props}
|
|
402
|
+
className="text-gray-900 dark:text-gray-50 font-bold text-2xl my-2"
|
|
403
|
+
/>
|
|
404
|
+
),
|
|
405
|
+
h2: ({
|
|
406
|
+
node,
|
|
407
|
+
...props
|
|
408
|
+
}: {
|
|
409
|
+
node?: any;
|
|
410
|
+
children?: React.ReactNode;
|
|
411
|
+
}) => (
|
|
412
|
+
<h2
|
|
413
|
+
{...props}
|
|
414
|
+
className="text-gray-900 dark:text-gray-50 font-bold text-xl my-2"
|
|
415
|
+
/>
|
|
416
|
+
),
|
|
417
|
+
h3: ({
|
|
418
|
+
node,
|
|
419
|
+
...props
|
|
420
|
+
}: {
|
|
421
|
+
node?: any;
|
|
422
|
+
children?: React.ReactNode;
|
|
423
|
+
}) => (
|
|
424
|
+
<h3
|
|
425
|
+
{...props}
|
|
426
|
+
className="text-gray-900 dark:text-gray-50 font-bold text-lg my-2"
|
|
427
|
+
/>
|
|
428
|
+
),
|
|
429
|
+
li: ({
|
|
430
|
+
node,
|
|
431
|
+
...props
|
|
432
|
+
}: {
|
|
433
|
+
node?: any;
|
|
434
|
+
children?: React.ReactNode;
|
|
435
|
+
}) => (
|
|
436
|
+
<li
|
|
437
|
+
{...props}
|
|
438
|
+
className="text-gray-800 dark:text-gray-100"
|
|
439
|
+
/>
|
|
440
|
+
),
|
|
441
|
+
}}
|
|
442
|
+
>
|
|
443
|
+
{text}
|
|
444
|
+
</Markdown>
|
|
445
|
+
</div>
|
|
446
|
+
) : (
|
|
447
|
+
<pre className="text-wrap bg-muted text-muted p-2">
|
|
448
|
+
{text}
|
|
449
|
+
</pre>
|
|
450
|
+
)}
|
|
451
|
+
</div>
|
|
452
|
+
) : (
|
|
453
|
+
<div>No content</div>
|
|
454
|
+
)}
|
|
455
|
+
</div>
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
{/* Properties Editor Modal */}
|
|
459
|
+
<PropertiesEditorModal
|
|
460
|
+
isOpen={isPropertiesModalOpen}
|
|
461
|
+
onClose={handleClosePropertiesModal}
|
|
462
|
+
object={object}
|
|
463
|
+
/>
|
|
464
|
+
</div>
|
|
465
|
+
);
|
|
466
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { ChangeEvent, useEffect, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { retrieveRendition } from '../../../utils'
|
|
4
|
+
|
|
5
|
+
import { ContentObjectItem } from '@vertesia/common'
|
|
6
|
+
import { Card, CardContent, Separator, VTooltip } from "@vertesia/ui/core"
|
|
7
|
+
import { useNavigate } from "@vertesia/ui/router"
|
|
8
|
+
import { useUserSession } from "@vertesia/ui/session"
|
|
9
|
+
import { DocumentSelection } from '../DocumentSelectionProvider'
|
|
10
|
+
|
|
11
|
+
interface DocumentIconProps {
|
|
12
|
+
document: ContentObjectItem
|
|
13
|
+
onSelectionChange: ((object: ContentObjectItem, ev: ChangeEvent<HTMLInputElement>) => void);
|
|
14
|
+
selection: DocumentSelection;
|
|
15
|
+
|
|
16
|
+
}
|
|
17
|
+
export function DocumentIcon({ selection, document, onSelectionChange }: Readonly<DocumentIconProps>) {
|
|
18
|
+
const { client } = useUserSession()
|
|
19
|
+
const navigate = useNavigate()
|
|
20
|
+
|
|
21
|
+
const [renditionUrl, setRenditionUrl] = useState<string | undefined>(undefined)
|
|
22
|
+
const [renditionAlt, setRenditionAlt] = useState<string | undefined>(undefined)
|
|
23
|
+
|
|
24
|
+
const handleNavigateToDocument = () => {
|
|
25
|
+
navigate(`/objects/${document.id}`)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const handleSelect = (ev: React.ChangeEvent<HTMLInputElement>) => {
|
|
29
|
+
ev.stopPropagation()
|
|
30
|
+
onSelectionChange(document, ev)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!document?.content) {
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
retrieveRendition(client, document, setRenditionUrl, setRenditionAlt)
|
|
39
|
+
}, [document])
|
|
40
|
+
|
|
41
|
+
console.log("renditionUrl", document)
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Card className="relative flex flex-col border h-fit" onClick={handleNavigateToDocument}>
|
|
45
|
+
{
|
|
46
|
+
selection && (
|
|
47
|
+
<div
|
|
48
|
+
className="absolute top-2 left-2 z-10 flex flex-col items-center gap-1"
|
|
49
|
+
>
|
|
50
|
+
<input checked={selection.isSelected(document.id)}
|
|
51
|
+
type="checkbox"
|
|
52
|
+
onChange={handleSelect}
|
|
53
|
+
onClick={(e) => e.stopPropagation()}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
{
|
|
60
|
+
renditionUrl ? (
|
|
61
|
+
<img src={renditionUrl} alt={renditionAlt} className="w-auto h-48 object-cover rounded-t-xl" />
|
|
62
|
+
) : (
|
|
63
|
+
<div className="h-48 bg-gray-700 rounded-t-xl"></div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
<Separator className='bg-gray-200 h-[2px]' />
|
|
67
|
+
<CardContent className="p-2 flex flex-col gap-1">
|
|
68
|
+
<div className="flex flex-col">
|
|
69
|
+
<VTooltip
|
|
70
|
+
placement='top'
|
|
71
|
+
description={document.properties?.title ?? document.name}>
|
|
72
|
+
<h3 className="text-start font-medium leading-none truncate">{document.properties?.title ?? document.name}</h3>
|
|
73
|
+
</VTooltip>
|
|
74
|
+
{
|
|
75
|
+
document?.type?.name ? (
|
|
76
|
+
<VTooltip
|
|
77
|
+
placement='bottom' size='xs'
|
|
78
|
+
description={document?.type?.name}>
|
|
79
|
+
<p className="text-start text-xs text-muted truncate">{document?.type?.name}</p>
|
|
80
|
+
</VTooltip>
|
|
81
|
+
) : <p className="text-xs text-muted">{"\u2002"}</p>
|
|
82
|
+
}
|
|
83
|
+
</div>
|
|
84
|
+
</CardContent>
|
|
85
|
+
</Card>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { ChangeEvent, useEffect, useState } from 'react';
|
|
3
|
+
|
|
4
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
5
|
+
import { ContentObjectItem } from '@vertesia/common';
|
|
6
|
+
import { ChevronsUpDown, X } from 'lucide-react';
|
|
7
|
+
import { Button, Styles } from '@vertesia/ui/core';
|
|
8
|
+
import { useFlag } from '@vertesia/ui/core';
|
|
9
|
+
import { Node } from '@vertesia/ui/widgets';
|
|
10
|
+
|
|
11
|
+
import { SelectDocumentModal } from './SelectDocumentModal';
|
|
12
|
+
|
|
13
|
+
const STORE_REGEX = /store:([a-f0-9]+)/;
|
|
14
|
+
|
|
15
|
+
interface DocumentInputProps {
|
|
16
|
+
object: Node;
|
|
17
|
+
type: string; // the editor/input type
|
|
18
|
+
}
|
|
19
|
+
export function DocumentInput({ object }: DocumentInputProps) {
|
|
20
|
+
const { client } = useUserSession();
|
|
21
|
+
|
|
22
|
+
const { off, on, isOn } = useFlag();
|
|
23
|
+
const [actualValue, setValue] = useState(object.value != null ? String(object.value) : '');
|
|
24
|
+
const [doc, setDoc] = useState<ContentObjectItem | undefined>(undefined)
|
|
25
|
+
|
|
26
|
+
const _onChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
27
|
+
const value = event.target.value;
|
|
28
|
+
setValue(value);
|
|
29
|
+
object.value = value;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const clearValue = () => {
|
|
33
|
+
setValue('');
|
|
34
|
+
object.value = '';
|
|
35
|
+
setDoc(undefined);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const onSelect = (value?: ContentObjectItem) => {
|
|
39
|
+
if (value) {
|
|
40
|
+
const uri = "store:" + value.id;
|
|
41
|
+
setValue(uri);
|
|
42
|
+
setDoc(value || undefined);
|
|
43
|
+
object.value = uri;
|
|
44
|
+
}
|
|
45
|
+
off();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!actualValue || doc) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const match = actualValue.match(STORE_REGEX);
|
|
54
|
+
if (!match) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
client.objects.get(match[1]).then((doc) => {
|
|
59
|
+
setDoc(doc);
|
|
60
|
+
}).catch(() => {
|
|
61
|
+
clearValue();
|
|
62
|
+
});
|
|
63
|
+
}, [actualValue]);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div>
|
|
67
|
+
<div className="relative">
|
|
68
|
+
<input value={actualValue} onChange={_onChange} className={clsx(Styles.INPUT, "pr-10 w-full")} />
|
|
69
|
+
{doc &&
|
|
70
|
+
<div className="absolute inset-y-0 right-10 flex items-center justify-center ">
|
|
71
|
+
<Button onClick={clearValue} variant='unstyled' className='hover:text-red-500 hover:bg-gray-100 dark:hover:bg-gray-600'>
|
|
72
|
+
<X className="size-5" />
|
|
73
|
+
</Button>
|
|
74
|
+
</div>
|
|
75
|
+
}
|
|
76
|
+
<div className="absolute inset-y-0 right-0 flex items-center justify-center">
|
|
77
|
+
<Button onClick={on} variant='unstyled' className='hover:bg-gray-100 dark:hover:bg-gray-600'>
|
|
78
|
+
<ChevronsUpDown className="size-5" />
|
|
79
|
+
</Button>
|
|
80
|
+
</div>
|
|
81
|
+
<SelectDocumentModal value={actualValue} isOpen={isOn} onClose={onSelect} />
|
|
82
|
+
</div>
|
|
83
|
+
{doc &&
|
|
84
|
+
<div className="p-1 semibold text-sm text-gray-600 dark:text-slate-300">
|
|
85
|
+
{doc.properties?.title || doc.name}
|
|
86
|
+
</div>
|
|
87
|
+
}
|
|
88
|
+
</div>
|
|
89
|
+
)
|
|
90
|
+
}
|