@vertesia/ui 0.59.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/FormItem.js +9 -0
- package/lib/esm/core/components/FormItem.js.map +1 -0
- package/lib/esm/core/components/InputList.js +4 -3
- package/lib/esm/core/components/InputList.js.map +1 -1
- package/lib/esm/core/components/index.js +3 -3
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/button.js +37 -7
- package/lib/esm/core/components/shadcn/button.js.map +1 -1
- package/lib/esm/core/components/shadcn/dialog.js +3 -3
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js +38 -0
- package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -0
- package/lib/esm/core/components/shadcn/filters/comboBox.js +24 -26
- package/lib/esm/core/components/shadcn/filters/comboBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/dateFilter.js +12 -12
- package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +49 -36
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filters.js +31 -23
- package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/selectFilter.js +33 -24
- package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/textFilter.js +2 -2
- package/lib/esm/core/components/shadcn/filters/textFilter.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
- package/lib/esm/core/components/shadcn/input.js +4 -4
- package/lib/esm/core/components/shadcn/input.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +72 -6
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/styles.js +1 -1
- package/lib/esm/core/components/styles.js.map +1 -1
- package/lib/esm/core/components/table/index.js +3 -0
- package/lib/esm/core/components/table/index.js.map +1 -1
- package/lib/esm/core/index.js +2 -1
- package/lib/esm/core/index.js.map +1 -1
- package/lib/esm/core/utils/cn.js +6 -0
- package/lib/esm/core/utils/cn.js.map +1 -0
- package/lib/esm/core/utils/index.js +2 -0
- package/lib/esm/core/utils/index.js.map +1 -0
- package/lib/esm/features/agent/PayloadBuilder.js +174 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js +207 -0
- package/lib/esm/features/agent/chat/AnimatedThinkingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/JumpingDots.js +6 -0
- package/lib/esm/features/agent/chat/JumpingDots.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +409 -0
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +129 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +66 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js +29 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +97 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +46 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +352 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js +20 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessagesContainer.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +62 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js +23 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlideInPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +51 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +82 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js +13 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/StackedMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +105 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +154 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js +266 -0
- package/lib/esm/features/agent/chat/SlidingThinkingIndicator.js.map +1 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js +60 -0
- package/lib/esm/features/agent/chat/WaitingMessages.js.map +1 -0
- package/lib/esm/features/agent/chat/index.js +5 -0
- package/lib/esm/features/agent/chat/index.js.map +1 -0
- package/lib/esm/features/agent/index.js +3 -0
- package/lib/esm/features/agent/index.js.map +1 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js +11 -0
- package/lib/esm/features/errors/PanelErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/RowErrorBoundary.js +9 -0
- package/lib/esm/features/errors/RowErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js +15 -0
- package/lib/esm/features/errors/VertesiaErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js +11 -0
- package/lib/esm/features/errors/WidgetErrorBoundary.js.map +1 -0
- package/lib/esm/features/errors/index.js +5 -0
- package/lib/esm/features/errors/index.js.map +1 -0
- package/lib/esm/features/facets/EnvironmentFacet.js +39 -0
- package/lib/esm/features/facets/EnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/FacetsNav.js +8 -0
- package/lib/esm/features/facets/FacetsNav.js.map +1 -0
- package/lib/esm/features/facets/InteractionFacet.js +39 -0
- package/lib/esm/features/facets/InteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/StringFacet.js +12 -0
- package/lib/esm/features/facets/StringFacet.js.map +1 -0
- package/lib/esm/features/facets/StringListFacet.js +11 -0
- package/lib/esm/features/facets/StringListFacet.js.map +1 -0
- package/lib/esm/features/facets/TypeFacet.js +42 -0
- package/lib/esm/features/facets/TypeFacet.js.map +1 -0
- package/lib/esm/features/facets/TypeOptions.js +19 -0
- package/lib/esm/features/facets/TypeOptions.js.map +1 -0
- package/lib/esm/features/facets/UserFacet.js +33 -0
- package/lib/esm/features/facets/UserFacet.js.map +1 -0
- package/lib/esm/features/facets/VFacetsNav.js +114 -0
- package/lib/esm/features/facets/VFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/VStringFacet.js +17 -0
- package/lib/esm/features/facets/VStringFacet.js.map +1 -0
- package/lib/esm/features/facets/VTypeFacet.js +56 -0
- package/lib/esm/features/facets/VTypeFacet.js.map +1 -0
- package/lib/esm/features/facets/VUserFacet.js +31 -0
- package/lib/esm/features/facets/VUserFacet.js.map +1 -0
- package/lib/esm/features/facets/index.js +12 -0
- package/lib/esm/features/facets/index.js.map +1 -0
- package/lib/esm/features/facets/utils.js +7 -0
- package/lib/esm/features/facets/utils.js.map +1 -0
- package/lib/esm/features/index.js +9 -1
- package/lib/esm/features/index.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +11 -0
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -0
- package/lib/esm/features/layout/NotFoundView.js +5 -0
- package/lib/esm/features/layout/NotFoundView.js.map +1 -0
- package/lib/esm/features/layout/index.js +3 -0
- package/lib/esm/features/layout/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js +13 -0
- package/lib/esm/features/magic-pdf/DownloadPopover.js.map +1 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js +44 -0
- package/lib/esm/features/magic-pdf/MagicPdfView.js.map +1 -0
- package/lib/esm/features/magic-pdf/PageSlider.js +57 -0
- package/lib/esm/features/magic-pdf/PageSlider.js.map +1 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js +133 -0
- package/lib/esm/features/magic-pdf/PdfPageProvider.js.map +1 -0
- package/lib/esm/features/magic-pdf/TextPageView.js +45 -0
- package/lib/esm/features/magic-pdf/TextPageView.js.map +1 -0
- package/lib/esm/features/magic-pdf/index.js +2 -0
- package/lib/esm/features/magic-pdf/index.js.map +1 -0
- package/lib/esm/features/magic-pdf/types.js +2 -0
- package/lib/esm/features/magic-pdf/types.js.map +1 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js +34 -0
- package/lib/esm/features/magic-pdf/useResizeOnDrag.js.map +1 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js +37 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionView.js +53 -0
- package/lib/esm/features/store/collections/CollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionsTable.js +60 -0
- package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -0
- package/lib/esm/features/store/collections/CollectionsView.js +94 -0
- package/lib/esm/features/store/collections/CollectionsView.js.map +1 -0
- package/lib/esm/features/store/collections/EditCollectionView.js +161 -0
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -0
- package/lib/esm/features/store/collections/index.js +6 -0
- package/lib/esm/features/store/collections/index.js.map +1 -0
- package/lib/esm/features/store/index.js +4 -0
- package/lib/esm/features/store/index.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js +150 -0
- package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js +123 -0
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js +81 -0
- package/lib/esm/features/store/objects/DocumentSelectionProvider.js.map +1 -0
- package/lib/esm/features/store/objects/DocumentTable.js +278 -0
- package/lib/esm/features/store/objects/DocumentTable.js.map +1 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js +31 -0
- package/lib/esm/features/store/objects/ExportPropertiesModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js +31 -0
- package/lib/esm/features/store/objects/components/ContentDispositionButton.js.map +1 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js +195 -0
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js +28 -0
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js +52 -0
- package/lib/esm/features/store/objects/components/DocumentInput.js.map +1 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +169 -0
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +45 -0
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js +39 -0
- package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js +7 -0
- package/lib/esm/features/store/objects/components/SelectDocumentModal.js.map +1 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js +85 -0
- package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -0
- package/lib/esm/features/store/objects/components/index.js +10 -0
- package/lib/esm/features/store/objects/components/index.js.map +1 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js +21 -0
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -0
- package/lib/esm/features/store/objects/index.js +11 -0
- package/lib/esm/features/store/objects/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +74 -0
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js +16 -0
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -0
- package/lib/esm/features/store/objects/layout/index.js +3 -0
- package/lib/esm/features/store/objects/layout/index.js.map +1 -0
- package/lib/esm/features/store/objects/layout/renderers.js +128 -0
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +150 -0
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +41 -0
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -0
- package/lib/esm/features/store/objects/search/index.js +3 -0
- package/lib/esm/features/store/objects/search/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +149 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js +2 -0
- package/lib/esm/features/store/objects/selection/ObjectsActionSpec.js.map +1 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js +75 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +64 -0
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js +53 -0
- package/lib/esm/features/store/objects/selection/actions/ChangeTypeAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js +30 -0
- package/lib/esm/features/store/objects/selection/actions/ConfirmAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +66 -0
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js +106 -0
- package/lib/esm/features/store/objects/selection/actions/ExportPropertiesAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js +64 -0
- package/lib/esm/features/store/objects/selection/actions/RemoveFromCollectionAction.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js +72 -0
- package/lib/esm/features/store/objects/selection/actions/StartWorkflowComponent.js.map +1 -0
- package/lib/esm/features/store/objects/selection/actions/index.js +8 -0
- package/lib/esm/features/store/objects/selection/actions/index.js.map +1 -0
- package/lib/esm/features/store/objects/selection/index.js +5 -0
- package/lib/esm/features/store/objects/selection/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +476 -0
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -0
- package/lib/esm/features/store/objects/upload/index.js +4 -0
- package/lib/esm/features/store/objects/upload/index.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js +201 -0
- package/lib/esm/features/store/objects/upload/useSmartFileUploadProcessing.js.map +1 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js +230 -0
- package/lib/esm/features/store/objects/upload/useUploadHandler.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypeView.js +158 -0
- package/lib/esm/features/store/types/ContentObjectTypeView.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js +82 -0
- package/lib/esm/features/store/types/ContentObjectTypesSearch.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js +11 -0
- package/lib/esm/features/store/types/ContentObjectTypesTable.js.map +1 -0
- package/lib/esm/features/store/types/ContentObjectTypesView.js +55 -0
- package/lib/esm/features/store/types/ContentObjectTypesView.js.map +1 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +26 -0
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +89 -0
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentType.js +43 -0
- package/lib/esm/features/store/types/SelectContentType.js.map +1 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js +28 -0
- package/lib/esm/features/store/types/SelectContentTypeModal.js.map +1 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js +78 -0
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -0
- package/lib/esm/features/store/types/index.js +11 -0
- package/lib/esm/features/store/types/index.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js +98 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchContext.js.map +1 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js +15 -0
- package/lib/esm/features/store/types/search/ObjectTypeSearchProvider.js.map +1 -0
- package/lib/esm/features/store/types/search/index.js +3 -0
- package/lib/esm/features/store/types/search/index.js.map +1 -0
- package/lib/esm/features/user/UserAvatar.js +18 -0
- package/lib/esm/features/user/UserAvatar.js.map +1 -0
- package/lib/esm/features/user/UserInfo.js +88 -0
- package/lib/esm/features/user/UserInfo.js.map +1 -0
- package/lib/esm/features/user/index.js +3 -0
- package/lib/esm/features/user/index.js.map +1 -0
- package/lib/esm/features/utils/index.js +4 -0
- package/lib/esm/features/utils/index.js.map +1 -0
- package/lib/esm/features/utils/mimeType.js +9 -0
- package/lib/esm/features/utils/mimeType.js.map +1 -0
- package/lib/esm/features/utils/rendition.js +47 -0
- package/lib/esm/features/utils/rendition.js.map +1 -0
- package/lib/esm/features/utils/text.js +10 -0
- package/lib/esm/features/utils/text.js.map +1 -0
- package/lib/esm/layout/FullHeightLayout.js +1 -1
- package/lib/esm/layout/FullHeightLayout.js.map +1 -1
- package/lib/esm/layout/Sidebar.js +12 -2
- package/lib/esm/layout/Sidebar.js.map +1 -1
- package/lib/esm/widgets/Progress.js +5 -0
- package/lib/esm/widgets/Progress.js.map +1 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +1 -1
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/esm/widgets/form/Form.js +2 -2
- package/lib/esm/widgets/form/Form.js.map +1 -1
- package/lib/esm/widgets/form/schema.js +11 -5
- package/lib/esm/widgets/form/schema.js.map +1 -1
- package/lib/esm/widgets/index.js +4 -0
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/popover/Popover.js +73 -0
- package/lib/esm/widgets/popover/Popover.js.map +1 -0
- package/lib/esm/widgets/popover/context.js +7 -0
- package/lib/esm/widgets/popover/context.js.map +1 -0
- package/lib/esm/widgets/popover/index.js +3 -0
- package/lib/esm/widgets/popover/index.js.map +1 -0
- package/lib/esm/widgets/popover/slots.js +22 -0
- package/lib/esm/widgets/popover/slots.js.map +1 -0
- package/lib/esm/widgets/properties/PropertiesView.js +6 -0
- package/lib/esm/widgets/properties/PropertiesView.js.map +1 -0
- package/lib/esm/widgets/properties/index.js +2 -0
- package/lib/esm/widgets/properties/index.js.map +1 -0
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js +1 -2
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/Editable.js +9 -10
- package/lib/esm/widgets/schema-editor/editor/Editable.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js +1 -1
- package/lib/esm/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js +2 -2
- package/lib/esm/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/lib/esm/widgets/upload/DropZone.js +162 -0
- package/lib/esm/widgets/upload/DropZone.js.map +1 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js +19 -0
- package/lib/esm/widgets/upload/UploadResultCategory.js.map +1 -0
- package/lib/esm/widgets/upload/UploadSummary.js +30 -0
- package/lib/esm/widgets/upload/UploadSummary.js.map +1 -0
- package/lib/esm/widgets/upload/index.js +4 -0
- package/lib/esm/widgets/upload/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/FormItem.d.ts +11 -0
- package/lib/types/core/components/index.d.ts +3 -3
- package/lib/types/core/components/shadcn/button.d.ts +13 -2
- package/lib/types/core/components/shadcn/command.d.ts +7 -7
- package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +8 -0
- package/lib/types/core/components/shadcn/filters/comboBox.d.ts +5 -5
- package/lib/types/core/components/shadcn/filters/dateFilter.d.ts +3 -4
- package/lib/types/core/components/shadcn/filters/types.d.ts +7 -1
- package/lib/types/core/components/shadcn/input.d.ts +4 -4
- package/lib/types/core/components/shadcn/selectBox.d.ts +13 -4
- package/lib/types/core/components/table/index.d.ts +1 -0
- package/lib/types/core/index.d.ts +2 -1
- package/lib/types/core/utils/cn.d.ts +2 -0
- package/lib/types/core/utils/index.d.ts +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts +53 -0
- package/lib/types/features/agent/chat/AnimatedThinkingDots.d.ts +37 -0
- package/lib/types/features/agent/chat/JumpingDots.d.ts +6 -0
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts +24 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +21 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts +18 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts +15 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +12 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/MessagesContainer.d.ts +9 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts +8 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlideInPanel.d.ts +10 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingMessages.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.d.ts +9 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/StackedMessages.d.ts +7 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/WorkstreamTabs.d.ts +21 -0
- package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +23 -0
- package/lib/types/features/agent/chat/SlidingThinkingIndicator.d.ts +17 -0
- package/lib/types/features/agent/chat/WaitingMessages.d.ts +1 -0
- package/lib/types/features/agent/chat/index.d.ts +4 -0
- package/lib/types/features/agent/index.d.ts +2 -0
- package/lib/types/features/errors/PanelErrorBoundary.d.ts +4 -0
- package/lib/types/features/errors/RowErrorBoundary.d.ts +7 -0
- package/lib/types/features/errors/VertesiaErrorBoundary.d.ts +11 -0
- package/lib/types/features/errors/WidgetErrorBoundary.d.ts +4 -0
- package/lib/types/features/errors/index.d.ts +4 -0
- package/lib/types/features/facets/EnvironmentFacet.d.ts +9 -0
- package/lib/types/features/facets/FacetsNav.d.ts +6 -0
- package/lib/types/features/facets/InteractionFacet.d.ts +9 -0
- package/lib/types/features/facets/StringFacet.d.ts +10 -0
- package/lib/types/features/facets/StringListFacet.d.ts +10 -0
- package/lib/types/features/facets/TypeFacet.d.ts +15 -0
- package/lib/types/features/facets/TypeOptions.d.ts +3 -0
- package/lib/types/features/facets/UserFacet.d.ts +11 -0
- package/lib/types/features/facets/VFacetsNav.d.ts +7 -0
- package/lib/types/features/facets/VStringFacet.d.ts +15 -0
- package/lib/types/features/facets/VTypeFacet.d.ts +8 -0
- package/lib/types/features/facets/VUserFacet.d.ts +9 -0
- package/lib/types/features/facets/index.d.ts +11 -0
- package/lib/types/features/facets/utils.d.ts +3 -0
- package/lib/types/features/index.d.ts +9 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts +12 -0
- package/lib/types/features/layout/NotFoundView.d.ts +4 -0
- package/lib/types/features/layout/index.d.ts +2 -0
- package/lib/types/features/magic-pdf/DownloadPopover.d.ts +6 -0
- package/lib/types/features/magic-pdf/MagicPdfView.d.ts +6 -0
- package/lib/types/features/magic-pdf/PageSlider.d.ts +7 -0
- package/lib/types/features/magic-pdf/PdfPageProvider.d.ts +28 -0
- package/lib/types/features/magic-pdf/TextPageView.d.ts +7 -0
- package/lib/types/features/magic-pdf/index.d.ts +1 -0
- package/lib/types/features/magic-pdf/types.d.ts +1 -0
- package/lib/types/features/magic-pdf/useResizeOnDrag.d.ts +8 -0
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts +6 -0
- package/lib/types/features/store/collections/CollectionView.d.ts +5 -0
- package/lib/types/features/store/collections/CollectionsTable.d.ts +5 -0
- package/lib/types/features/store/collections/CollectionsView.d.ts +10 -0
- package/lib/types/features/store/collections/EditCollectionView.d.ts +7 -0
- package/lib/types/features/store/collections/index.d.ts +5 -0
- package/lib/types/features/store/index.d.ts +3 -0
- package/lib/types/features/store/objects/DocumentPreviewPanel.d.ts +7 -0
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts +19 -0
- package/lib/types/features/store/objects/DocumentSelectionProvider.d.ts +32 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts +20 -0
- package/lib/types/features/store/objects/ExportPropertiesModal.d.ts +11 -0
- package/lib/types/features/store/objects/components/ContentDispositionButton.d.ts +8 -0
- package/lib/types/features/store/objects/components/ContentOverview.d.ts +7 -0
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +10 -0
- package/lib/types/features/store/objects/components/DocumentInput.d.ts +7 -0
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts +7 -0
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts +8 -0
- package/lib/types/features/store/objects/components/SelectDocument.d.ts +8 -0
- package/lib/types/features/store/objects/components/SelectDocumentModal.d.ts +8 -0
- package/lib/types/features/store/objects/components/VectorSearchWidget.d.ts +10 -0
- package/lib/types/features/store/objects/components/index.d.ts +9 -0
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +3 -0
- package/lib/types/features/store/objects/index.d.ts +10 -0
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +16 -0
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +17 -0
- package/lib/types/features/store/objects/layout/index.d.ts +2 -0
- package/lib/types/features/store/objects/layout/renderers.d.ts +2 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +48 -0
- package/lib/types/features/store/objects/search/DocumentSearchProvider.d.ts +15 -0
- package/lib/types/features/store/objects/search/index.d.ts +2 -0
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts +25 -0
- package/lib/types/features/store/objects/selection/ObjectsActionSpec.d.ts +27 -0
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts +4 -0
- package/lib/types/features/store/objects/selection/actions/AddToCollectionAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/ChangeTypeAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/ConfirmAction.d.ts +15 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +2 -0
- package/lib/types/features/store/objects/selection/actions/ExportPropertiesAction.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/RemoveFromCollectionAction.d.ts +2 -0
- package/lib/types/features/store/objects/selection/actions/StartWorkflowComponent.d.ts +3 -0
- package/lib/types/features/store/objects/selection/actions/index.d.ts +7 -0
- package/lib/types/features/store/objects/selection/index.d.ts +4 -0
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts +37 -0
- package/lib/types/features/store/objects/upload/index.d.ts +3 -0
- package/lib/types/features/store/objects/upload/useSmartFileUploadProcessing.d.ts +29 -0
- package/lib/types/features/store/objects/upload/useUploadHandler.d.ts +49 -0
- package/lib/types/features/store/types/ContentObjectTypeView.d.ts +5 -0
- package/lib/types/features/store/types/ContentObjectTypesSearch.d.ts +5 -0
- package/lib/types/features/store/types/ContentObjectTypesTable.d.ts +7 -0
- package/lib/types/features/store/types/ContentObjectTypesView.d.ts +8 -0
- package/lib/types/features/store/types/CreateOrUpdateTypeModal.d.ts +14 -0
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts +7 -0
- package/lib/types/features/store/types/SelectContentType.d.ts +10 -0
- package/lib/types/features/store/types/SelectContentTypeModal.d.ts +32 -0
- package/lib/types/features/store/types/TableLayoutEditor.d.ts +8 -0
- package/lib/types/features/store/types/index.d.ts +10 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchContext.d.ts +35 -0
- package/lib/types/features/store/types/search/ObjectTypeSearchProvider.d.ts +10 -0
- package/lib/types/features/store/types/search/index.d.ts +2 -0
- package/lib/types/features/user/UserAvatar.d.ts +8 -0
- package/lib/types/features/user/UserInfo.d.ts +36 -0
- package/lib/types/features/user/index.d.ts +2 -0
- package/lib/types/features/utils/index.d.ts +3 -0
- package/lib/types/features/utils/mimeType.d.ts +4 -0
- package/lib/types/features/utils/rendition.d.ts +3 -0
- package/lib/types/features/utils/text.d.ts +2 -0
- package/lib/types/layout/Sidebar.d.ts +2 -1
- package/lib/types/widgets/Progress.d.ts +5 -0
- package/lib/types/widgets/form/schema.d.ts +4 -3
- package/lib/types/widgets/index.d.ts +4 -0
- package/lib/types/widgets/popover/Popover.d.ts +37 -0
- package/lib/types/widgets/popover/context.d.ts +7 -0
- package/lib/types/widgets/popover/index.d.ts +2 -0
- package/lib/types/widgets/popover/slots.d.ts +4 -0
- package/lib/types/widgets/properties/PropertiesView.d.ts +10 -0
- package/lib/types/widgets/properties/index.d.ts +1 -0
- package/lib/types/widgets/upload/DropZone.d.ts +40 -0
- package/lib/types/widgets/upload/UploadResultCategory.d.ts +25 -0
- package/lib/types/widgets/upload/UploadSummary.d.ts +37 -0
- package/lib/types/widgets/upload/index.d.ts +3 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-layout.js +1 -1
- package/lib/vertesia-ui-layout.js.map +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +13 -5
- package/src/core/components/FormItem.tsx +35 -0
- package/src/core/components/InputList.tsx +4 -3
- package/src/core/components/index.ts +3 -3
- package/src/core/components/shadcn/button.tsx +68 -8
- package/src/core/components/shadcn/dialog.tsx +3 -3
- package/src/core/components/shadcn/filters/DynamicLabel.tsx +45 -0
- package/src/core/components/shadcn/filters/comboBox.tsx +56 -52
- package/src/core/components/shadcn/filters/dateFilter.tsx +24 -25
- package/src/core/components/shadcn/filters/filterBar.tsx +53 -47
- package/src/core/components/shadcn/filters/filters.tsx +43 -30
- package/src/core/components/shadcn/filters/selectFilter.tsx +53 -34
- package/src/core/components/shadcn/filters/textFilter.tsx +6 -3
- package/src/core/components/shadcn/filters/types.ts +8 -1
- package/src/core/components/shadcn/input.tsx +5 -5
- package/src/core/components/shadcn/selectBox.tsx +138 -33
- package/src/core/components/styles.ts +1 -1
- package/src/core/components/table/index.tsx +8 -0
- package/src/core/index.ts +2 -1
- package/src/core/utils/cn.ts +6 -0
- package/src/core/utils/index.ts +1 -0
- package/src/features/agent/PayloadBuilder.tsx +208 -0
- package/src/features/agent/chat/AnimatedThinkingDots.tsx +350 -0
- package/src/features/agent/chat/JumpingDots.tsx +16 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +708 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +246 -0
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +231 -0
- package/src/features/agent/chat/ModernAgentOutput/InlineSlideInPanel.tsx +66 -0
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +282 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +125 -0
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +562 -0
- package/src/features/agent/chat/ModernAgentOutput/MessagesContainer.tsx +51 -0
- package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +123 -0
- package/src/features/agent/chat/ModernAgentOutput/README-image-support.md +43 -0
- package/src/features/agent/chat/ModernAgentOutput/SlideInPanel.tsx +72 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +96 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +185 -0
- package/src/features/agent/chat/ModernAgentOutput/StackedMessages.tsx +33 -0
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +167 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +195 -0
- package/src/features/agent/chat/ModernAgentOutput/with-types.d.ts +15 -0
- package/src/features/agent/chat/SlidingThinkingIndicator.tsx +459 -0
- package/src/features/agent/chat/WaitingMessages.ts +66 -0
- package/src/features/agent/chat/index.ts +4 -0
- package/src/features/agent/index.ts +2 -0
- package/src/features/errors/PanelErrorBoundary.tsx +30 -0
- package/src/features/errors/RowErrorBoundary.tsx +28 -0
- package/src/features/errors/VertesiaErrorBoundary.tsx +28 -0
- package/src/features/errors/WidgetErrorBoundary.tsx +27 -0
- package/src/features/errors/index.ts +4 -0
- package/src/features/facets/EnvironmentFacet.tsx +53 -0
- package/src/features/facets/FacetsNav.tsx +19 -0
- package/src/features/facets/InteractionFacet.tsx +53 -0
- package/src/features/facets/StringFacet.tsx +23 -0
- package/src/features/facets/StringListFacet.tsx +22 -0
- package/src/features/facets/TypeFacet.tsx +59 -0
- package/src/features/facets/TypeOptions.tsx +22 -0
- package/src/features/facets/UserFacet.tsx +61 -0
- package/src/features/facets/VFacetsNav.tsx +139 -0
- package/src/features/facets/VStringFacet.tsx +34 -0
- package/src/features/facets/VTypeFacet.tsx +72 -0
- package/src/features/facets/VUserFacet.tsx +47 -0
- package/src/features/facets/index.ts +11 -0
- package/src/features/facets/utils.tsx +9 -0
- package/src/features/index.ts +9 -1
- package/src/features/layout/GenericPageNavHeader.tsx +48 -0
- package/src/features/layout/NotFoundView.tsx +11 -0
- package/src/features/layout/index.ts +2 -0
- package/src/features/magic-pdf/DownloadPopover.tsx +32 -0
- package/src/features/magic-pdf/MagicPdfView.tsx +102 -0
- package/src/features/magic-pdf/PageSlider.tsx +112 -0
- package/src/features/magic-pdf/PdfPageProvider.tsx +229 -0
- package/src/features/magic-pdf/TextPageView.tsx +65 -0
- package/src/features/magic-pdf/index.ts +1 -0
- package/src/features/magic-pdf/types.ts +1 -0
- package/src/features/magic-pdf/useResizeOnDrag.ts +42 -0
- package/src/features/store/collections/BrowseCollectionView.tsx +45 -0
- package/src/features/store/collections/CollectionView.tsx +94 -0
- package/src/features/store/collections/CollectionsTable.tsx +115 -0
- package/src/features/store/collections/CollectionsView.tsx +166 -0
- package/src/features/store/collections/EditCollectionView.tsx +253 -0
- package/src/features/store/collections/index.ts +5 -0
- package/src/features/store/index.ts +3 -0
- package/src/features/store/objects/DocumentPreviewPanel.tsx +417 -0
- package/src/features/store/objects/DocumentSearchResults.tsx +209 -0
- package/src/features/store/objects/DocumentSelectionProvider.tsx +99 -0
- package/src/features/store/objects/DocumentTable.tsx +409 -0
- package/src/features/store/objects/ExportPropertiesModal.tsx +89 -0
- package/src/features/store/objects/components/ContentDispositionButton.tsx +45 -0
- package/src/features/store/objects/components/ContentOverview.tsx +466 -0
- package/src/features/store/objects/components/DocumentIcon.tsx +87 -0
- package/src/features/store/objects/components/DocumentInput.tsx +90 -0
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +253 -0
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +136 -0
- package/src/features/store/objects/components/SelectDocument.tsx +69 -0
- package/src/features/store/objects/components/SelectDocumentModal.tsx +20 -0
- package/src/features/store/objects/components/VectorSearchWidget.tsx +115 -0
- package/src/features/store/objects/components/index.ts +9 -0
- package/src/features/store/objects/components/useDownloadObject.ts +24 -0
- package/src/features/store/objects/index.ts +10 -0
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +84 -0
- package/src/features/store/objects/layout/documentLayout.tsx +69 -0
- package/src/features/store/objects/layout/index.ts +2 -0
- package/src/features/store/objects/layout/knowledge.md +238 -0
- package/src/features/store/objects/layout/renderers.tsx +139 -0
- package/src/features/store/objects/search/DocumentSearchContext.ts +181 -0
- package/src/features/store/objects/search/DocumentSearchProvider.tsx +54 -0
- package/src/features/store/objects/search/index.ts +2 -0
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +196 -0
- package/src/features/store/objects/selection/ObjectsActionSpec.ts +31 -0
- package/src/features/store/objects/selection/SelectionActions.tsx +160 -0
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +114 -0
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +76 -0
- package/src/features/store/objects/selection/actions/ConfirmAction.tsx +46 -0
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +77 -0
- package/src/features/store/objects/selection/actions/ExportPropertiesAction.tsx +117 -0
- package/src/features/store/objects/selection/actions/RemoveFromCollectionAction.tsx +77 -0
- package/src/features/store/objects/selection/actions/StartWorkflowComponent.tsx +122 -0
- package/src/features/store/objects/selection/actions/index.ts +7 -0
- package/src/features/store/objects/selection/index.ts +4 -0
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +970 -0
- package/src/features/store/objects/upload/index.ts +3 -0
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +250 -0
- package/src/features/store/objects/upload/useUploadHandler.ts +325 -0
- package/src/features/store/types/ContentObjectTypeView.tsx +244 -0
- package/src/features/store/types/ContentObjectTypesSearch.tsx +111 -0
- package/src/features/store/types/ContentObjectTypesTable.tsx +38 -0
- package/src/features/store/types/ContentObjectTypesView.tsx +71 -0
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +70 -0
- package/src/features/store/types/ObjectSchemaEditor.tsx +127 -0
- package/src/features/store/types/SelectContentType.tsx +88 -0
- package/src/features/store/types/SelectContentTypeModal.tsx +142 -0
- package/src/features/store/types/TableLayoutEditor.tsx +104 -0
- package/src/features/store/types/index.ts +10 -0
- package/src/features/store/types/search/ObjectTypeSearchContext.tsx +119 -0
- package/src/features/store/types/search/ObjectTypeSearchProvider.tsx +24 -0
- package/src/features/store/types/search/index.ts +2 -0
- package/src/features/user/UserAvatar.tsx +34 -0
- package/src/features/user/UserInfo.tsx +215 -0
- package/src/features/user/index.ts +2 -0
- package/src/features/utils/index.ts +3 -0
- package/src/features/utils/mimeType.ts +9 -0
- package/src/features/utils/rendition.ts +75 -0
- package/src/features/utils/text.ts +10 -0
- package/src/layout/FullHeightLayout.tsx +1 -1
- package/src/layout/Sidebar.tsx +12 -2
- package/src/widgets/Progress.tsx +10 -0
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +1 -1
- package/src/widgets/form/Form.tsx +2 -2
- package/src/widgets/form/schema.ts +14 -7
- package/src/widgets/index.ts +5 -1
- package/src/widgets/popover/Popover.tsx +171 -0
- package/src/widgets/popover/context.ts +15 -0
- package/src/widgets/popover/index.ts +2 -0
- package/src/widgets/popover/slots.ts +24 -0
- package/src/widgets/properties/PropertiesView.tsx +26 -0
- package/src/widgets/properties/index.ts +1 -0
- package/src/widgets/schema-editor/JSONSchemaEditorModal.tsx +1 -2
- package/src/widgets/schema-editor/editor/Editable.tsx +12 -13
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +1 -1
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +4 -4
- package/src/widgets/upload/DropZone.tsx +257 -0
- package/src/widgets/upload/UploadResultCategory.tsx +81 -0
- package/src/widgets/upload/UploadSummary.tsx +116 -0
- package/src/widgets/upload/index.ts +3 -0
- package/lib/esm/code/index.js +0 -3
- package/lib/esm/code/index.js.map +0 -1
- package/lib/esm/core/components/Input.js +0 -16
- package/lib/esm/core/components/Input.js.map +0 -1
- package/lib/esm/form/index.js +0 -3
- package/lib/esm/form/index.js.map +0 -1
- package/lib/types/code/index.d.ts +0 -0
- package/lib/types/core/components/Input.d.ts +0 -8
- package/lib/types/form/index.d.ts +0 -0
- package/lib/vertesia-ui-code.js +0 -2
- package/lib/vertesia-ui-code.js.map +0 -1
- package/lib/vertesia-ui-form.js +0 -2
- package/lib/vertesia-ui-form.js.map +0 -1
- package/src/code/index.ts +0 -1
- package/src/core/components/Input.tsx +0 -43
- package/src/form/index.ts +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
2
|
+
import { ApiKey, ApiKeyTypes, PrincipalType, User } from "@vertesia/common";
|
|
3
|
+
import { Avatar, Table, Popover, PopoverContent, PopoverTrigger } from "@vertesia/ui/core";
|
|
4
|
+
import { useFetch } from "@vertesia/ui/core";
|
|
5
|
+
import { ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//TODO use a real cache
|
|
8
|
+
const USER_CACHE: Record<string, Promise<User>> = {};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Fetch the user information given a user reference.
|
|
12
|
+
* The reference has the format: `type:id`. A special reference `system` is used to refer to the system user.
|
|
13
|
+
* @param userRef
|
|
14
|
+
*/
|
|
15
|
+
export function useFetchUserInfo(userId: string) {
|
|
16
|
+
const { client } = useUserSession();
|
|
17
|
+
|
|
18
|
+
return useFetch(() => {
|
|
19
|
+
let user: Promise<User> | undefined = USER_CACHE[userId];
|
|
20
|
+
if (!user) {
|
|
21
|
+
user = client.users.retrieve(userId).then(user => {
|
|
22
|
+
return user;
|
|
23
|
+
});
|
|
24
|
+
USER_CACHE[userId] = user;
|
|
25
|
+
}
|
|
26
|
+
return user;
|
|
27
|
+
}, [userId]);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function AvatarPlaceholder() {
|
|
31
|
+
return <div className='size-8' />
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface InfoProps {
|
|
35
|
+
showTitle?: boolean;
|
|
36
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function SystemAvatar({ showTitle = false, size = "md" }: InfoProps) {
|
|
40
|
+
return (
|
|
41
|
+
<UserPopoverPanel title="System User" description="The system user is used to initialize built-in objects.">
|
|
42
|
+
<Avatar src="/icon.svg" size={size} />
|
|
43
|
+
{showTitle && <div className="text-sm font-semibold pl-2">System User</div>}
|
|
44
|
+
</UserPopoverPanel>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
interface ServiceInfoProps extends InfoProps {
|
|
48
|
+
accountId: string;
|
|
49
|
+
}
|
|
50
|
+
function ServiceAccountAvatar({ accountId, showTitle = false, size = "md" }: ServiceInfoProps) {
|
|
51
|
+
const description = (
|
|
52
|
+
<>
|
|
53
|
+
<div>This user is used by robots like workflow workers.</div>
|
|
54
|
+
<div className="text-gray-800 dark:text-gray-500 text-sm"><span className="font-semibold">ID:</span> {accountId}</div>
|
|
55
|
+
</>
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<UserPopoverPanel title="Service Account" description={description}>
|
|
60
|
+
<div className="flex flex-row items-center gap-2">
|
|
61
|
+
<Avatar src="/cloud.svg" name="SA" color="bg-amber-500" className="px-[5px] text-white" size={size} />
|
|
62
|
+
{showTitle && <div className="text-sm font-semibold pl-2 truncate">Service Account : {accountId}</div>}
|
|
63
|
+
</div>
|
|
64
|
+
</UserPopoverPanel>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface ErrorInfoProps extends InfoProps {
|
|
69
|
+
title?: string;
|
|
70
|
+
error: Error | string;
|
|
71
|
+
}
|
|
72
|
+
function ErrorAvatar({ title = "Error", error, showTitle = false, size = "md" }: ErrorInfoProps) {
|
|
73
|
+
return (
|
|
74
|
+
<UnknownAvatar title={title} message={typeof error === 'string' ? error : error.message} color="bg-red-500" showTitle={showTitle} size={size} />
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface UserInfoProps extends InfoProps {
|
|
79
|
+
/**
|
|
80
|
+
* The user reference is a string that contains the type and id of the user.
|
|
81
|
+
*
|
|
82
|
+
* The format is: `type:id`, where "type" is the {@link PrincipalType} and the "id" is the
|
|
83
|
+
* object ID in the database.
|
|
84
|
+
*
|
|
85
|
+
* @example user:123
|
|
86
|
+
* @example service_account:123
|
|
87
|
+
* @example apikey:123
|
|
88
|
+
*/
|
|
89
|
+
userRef: string | undefined;
|
|
90
|
+
}
|
|
91
|
+
export function UserInfo({ userRef, showTitle = false, size = "md" }: UserInfoProps) {
|
|
92
|
+
if (!userRef) {
|
|
93
|
+
return <UnknownAvatar title="Unknown User" message="User information is not available." showTitle={showTitle} size={size} />
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const [type, id] = userRef ? userRef.split(':') : ["unknown"];
|
|
97
|
+
switch (type) {
|
|
98
|
+
case PrincipalType.User:
|
|
99
|
+
return <UserAvatar userId={id} showTitle={showTitle} size={size} />
|
|
100
|
+
case "system":
|
|
101
|
+
return <SystemAvatar showTitle={showTitle} size={size} />
|
|
102
|
+
case PrincipalType.ServiceAccount:
|
|
103
|
+
return <ServiceAccountAvatar accountId={id} showTitle={showTitle} size={size} />
|
|
104
|
+
case PrincipalType.ApiKey:
|
|
105
|
+
return <ApiKeyAvatar keyId={id} size={size} showTitle={showTitle} />
|
|
106
|
+
default:
|
|
107
|
+
return <ErrorAvatar title="Unknown User" error={`Invalid user ref type: ${type}`} showTitle={showTitle} size={size} />
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
interface UnknownAvatarProps extends InfoProps {
|
|
112
|
+
title: string;
|
|
113
|
+
message: ReactNode;
|
|
114
|
+
color?: string;
|
|
115
|
+
}
|
|
116
|
+
function UnknownAvatar({ title, message, color, size = "md", showTitle = false }: UnknownAvatarProps) {
|
|
117
|
+
return (
|
|
118
|
+
<UserPopoverPanel title={title} description={message}>
|
|
119
|
+
<div className="flex flex-row items-center gap-2">
|
|
120
|
+
<Avatar color={color} size={size} />
|
|
121
|
+
{showTitle && <div className="text-sm font-semibold pl-1">{title}</div>}
|
|
122
|
+
</div>
|
|
123
|
+
</UserPopoverPanel>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
interface UserAvatarProps extends InfoProps {
|
|
128
|
+
userId: string;
|
|
129
|
+
}
|
|
130
|
+
function UserAvatar({ userId, showTitle = false, size = "md" }: UserAvatarProps) {
|
|
131
|
+
const { data: user, error } = useFetchUserInfo(userId);
|
|
132
|
+
|
|
133
|
+
if (error) {
|
|
134
|
+
return <ErrorAvatar title="Failed to fetch user" error={error} showTitle={showTitle} size={size} />
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!user) {
|
|
138
|
+
return <AvatarPlaceholder />
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return (
|
|
142
|
+
<UserPopoverPanel title={user.name || user.email || user.username || "unknown"} description={user.email}>
|
|
143
|
+
<div className="flex flex-row items-center gap-2">
|
|
144
|
+
<Avatar src={user.picture} name={user.name} color="bg-indigo-500" size={size} />
|
|
145
|
+
{showTitle && <div className="text-sm font-semibold pl-2">{user.name || user.email || user.username || "unknown"}</div>}
|
|
146
|
+
</div>
|
|
147
|
+
</UserPopoverPanel>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
interface ApiKeyAvatarProps extends InfoProps {
|
|
152
|
+
keyId: string;
|
|
153
|
+
}
|
|
154
|
+
export function ApiKeyAvatar({ keyId, showTitle = false, size = "md" }: ApiKeyAvatarProps) {
|
|
155
|
+
const { client } = useUserSession();
|
|
156
|
+
const { data, error } = useFetch<ApiKey>(() => client.apikeys.retrieve(keyId), []);
|
|
157
|
+
|
|
158
|
+
if (error) {
|
|
159
|
+
return <ErrorAvatar title="Failed to fetch the apikey" error={error} showTitle={showTitle} size={size} />
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (!data) {
|
|
163
|
+
return <AvatarPlaceholder />
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const isPublic = data.type === ApiKeyTypes.public;
|
|
167
|
+
const title = isPublic ? "Public Key" : "Private Key";
|
|
168
|
+
const avatar = <Avatar name={isPublic ? "PK" : "SK"} color="bg-pink-500" size={size} />;
|
|
169
|
+
const description = (
|
|
170
|
+
<Table className="dark:bg-gray-800 dark:text-gray-200">
|
|
171
|
+
<tr>
|
|
172
|
+
<td className="font-semibold">Key:</td>
|
|
173
|
+
<td>{data?.name}</td>
|
|
174
|
+
</tr>
|
|
175
|
+
<tr>
|
|
176
|
+
<td className="font-semibold">Account:</td>
|
|
177
|
+
<td>{data?.account}</td>
|
|
178
|
+
</tr>
|
|
179
|
+
<tr>
|
|
180
|
+
<td className="font-semibold">Project:</td>
|
|
181
|
+
<td>{data?.project}</td>
|
|
182
|
+
</tr>
|
|
183
|
+
</Table>
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<UserPopoverPanel title={title} description={description}>
|
|
188
|
+
<div className="flex flex-row items-center gap-2">
|
|
189
|
+
{avatar}
|
|
190
|
+
{showTitle && <div className="text-sm font-semibold pl-2">{data?.name || data?.account || data?.project || "unknown"}</div>}
|
|
191
|
+
</div>
|
|
192
|
+
</UserPopoverPanel >
|
|
193
|
+
)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface UserPopoverPanelProps {
|
|
197
|
+
title: string;
|
|
198
|
+
description: ReactNode;
|
|
199
|
+
children: React.ReactNode;
|
|
200
|
+
}
|
|
201
|
+
function UserPopoverPanel({ title, description, children }: UserPopoverPanelProps) {
|
|
202
|
+
return (
|
|
203
|
+
<Popover hover>
|
|
204
|
+
<PopoverTrigger className="cursor-pointer flex items-center inline-block">
|
|
205
|
+
<div>{children}</div>
|
|
206
|
+
</PopoverTrigger>
|
|
207
|
+
<PopoverContent align="center" sideOffset={8} side="right">
|
|
208
|
+
<div className="flex flex-col gap-1 rounded-md shadow-md p-2">
|
|
209
|
+
<div className='text-md font-semibold'>{title}</div>
|
|
210
|
+
<div>{description}</div>
|
|
211
|
+
</div>
|
|
212
|
+
</PopoverContent>
|
|
213
|
+
</Popover>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const CSV_PREFIX = 'text/csv'
|
|
2
|
+
const IMAGE_PREFIX = 'image/'
|
|
3
|
+
const PDF_PREFIX = 'application/pdf'
|
|
4
|
+
const VIDEO_PREFIX = 'video/'
|
|
5
|
+
|
|
6
|
+
export const isCsv = (type: string) => type === CSV_PREFIX || CSV_PREFIX.includes(type)
|
|
7
|
+
export const isImage = (type: string) => type.startsWith(IMAGE_PREFIX) || IMAGE_PREFIX.includes(type)
|
|
8
|
+
export const isPdf = (type: string) => type === PDF_PREFIX || PDF_PREFIX.includes(type)
|
|
9
|
+
export const isVideo = (type: string) => type.startsWith(VIDEO_PREFIX) || VIDEO_PREFIX.includes(type)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { isImage, isPdf, isVideo } from "./mimeType.js";
|
|
2
|
+
import { VertesiaClient } from "@vertesia/client";
|
|
3
|
+
import { ContentObjectItem, ImageRenditionFormat } from "@vertesia/common";
|
|
4
|
+
|
|
5
|
+
//TODO we must use a setting in Env.
|
|
6
|
+
const env = import.meta.env;
|
|
7
|
+
|
|
8
|
+
const RENDITION_OPTIONS = {
|
|
9
|
+
max_hw: env?.VITE_RENDITION_HW || 256,
|
|
10
|
+
format: ImageRenditionFormat.jpeg,
|
|
11
|
+
generate_if_missing: true,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const RENDITION_ID = "vertesia.content_store.renditionId";
|
|
15
|
+
|
|
16
|
+
export async function retrieveRendition(
|
|
17
|
+
client: VertesiaClient,
|
|
18
|
+
doc: ContentObjectItem,
|
|
19
|
+
setRenditionUrl: (url: string) => void,
|
|
20
|
+
setRenditionAlt: (alt: string) => void,
|
|
21
|
+
) {
|
|
22
|
+
if (
|
|
23
|
+
!doc?.content?.type ||
|
|
24
|
+
!(
|
|
25
|
+
isImage(doc.content.type) ||
|
|
26
|
+
isVideo(doc.content.type) ||
|
|
27
|
+
isPdf(doc.content.type)
|
|
28
|
+
)
|
|
29
|
+
) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const currentTime = new Date().getTime() / 1000;
|
|
34
|
+
|
|
35
|
+
const savedId = localStorage.getItem(
|
|
36
|
+
`${RENDITION_ID}_${doc.id}_${RENDITION_OPTIONS.max_hw}`,
|
|
37
|
+
);
|
|
38
|
+
const elapsedTime = localStorage.getItem(
|
|
39
|
+
`${RENDITION_ID}_${doc.id}_${RENDITION_OPTIONS.max_hw}_time`,
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
if (
|
|
43
|
+
savedId?.length &&
|
|
44
|
+
elapsedTime &&
|
|
45
|
+
Math.abs(currentTime - parseInt(elapsedTime)) <= 900
|
|
46
|
+
) {
|
|
47
|
+
setRenditionUrl(savedId);
|
|
48
|
+
setRenditionAlt(`${doc.name} Rendition`);
|
|
49
|
+
return savedId;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
client.objects.getRendition(doc.id, RENDITION_OPTIONS).then((response) => {
|
|
53
|
+
if (response.status === "generating") {
|
|
54
|
+
setTimeout(retrieveRendition, 60000);
|
|
55
|
+
} else if (response.status === "failed") {
|
|
56
|
+
return;
|
|
57
|
+
} else {
|
|
58
|
+
if (!response?.renditions?.length) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const rendition = response.renditions[0];
|
|
62
|
+
|
|
63
|
+
localStorage.setItem(
|
|
64
|
+
`${RENDITION_ID}_${doc.id}_${RENDITION_OPTIONS.max_hw}`,
|
|
65
|
+
rendition,
|
|
66
|
+
);
|
|
67
|
+
localStorage.setItem(
|
|
68
|
+
`${RENDITION_ID}_${doc.id}_${RENDITION_OPTIONS.max_hw}_time`,
|
|
69
|
+
(new Date().getTime() / 1000).toString(),
|
|
70
|
+
);
|
|
71
|
+
setRenditionUrl(rendition);
|
|
72
|
+
setRenditionAlt(`${doc.name} Rendition`);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function shortId(id: string, length: number = 7) {
|
|
2
|
+
if (!id) {
|
|
3
|
+
return "";
|
|
4
|
+
}
|
|
5
|
+
return "~" + id.slice(-length);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function shortenString(str: string, length: number) {
|
|
9
|
+
return str.length > length ? str.substring(0, length) + '...' : str;
|
|
10
|
+
}
|
package/src/layout/Sidebar.tsx
CHANGED
|
@@ -84,21 +84,31 @@ export interface SidebarItemProps {
|
|
|
84
84
|
tools?: React.ReactNode
|
|
85
85
|
className?: string;
|
|
86
86
|
id?: string; //HTML ID of the element
|
|
87
|
+
external?: boolean; //If true, the link will open in a new tab
|
|
87
88
|
}
|
|
88
|
-
export function SidebarItem({ className, tools, children, icon: Icon, href, current, onClick }: SidebarItemProps) {
|
|
89
|
+
export function SidebarItem({ external, className, tools, children, icon: Icon, href, current, onClick }: SidebarItemProps) {
|
|
89
90
|
const { toggleMobile } = useSidebarToggle();
|
|
90
91
|
const _closeSideBar = () => {
|
|
91
92
|
setTimeout(() => {
|
|
92
93
|
toggleMobile(false)
|
|
93
94
|
}, 100);
|
|
94
95
|
}
|
|
96
|
+
const onClickWrapper = (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
|
|
97
|
+
if (external) {
|
|
98
|
+
window.open(href, '_blank');
|
|
99
|
+
event.preventDefault(); // Prevent default link behavior
|
|
100
|
+
event.stopPropagation(); // Stop the event from propagating
|
|
101
|
+
} else if (onClick) {
|
|
102
|
+
onClick(event);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
95
105
|
return (
|
|
96
106
|
<li>
|
|
97
107
|
<Nav onClick={_closeSideBar}>
|
|
98
108
|
<SidebarTooltip text={children as string}>
|
|
99
109
|
<a
|
|
100
110
|
href={href}
|
|
101
|
-
onClick={
|
|
111
|
+
onClick={onClickWrapper}
|
|
102
112
|
className={clsx(
|
|
103
113
|
current
|
|
104
114
|
? 'bg-sidebar-accent text-sidebar-accent-foreground'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ProgressProps {
|
|
2
|
+
percent: number; // progress percent value
|
|
3
|
+
}
|
|
4
|
+
export function Progress({ percent }: ProgressProps) {
|
|
5
|
+
return (
|
|
6
|
+
<div className="w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700">
|
|
7
|
+
<div className="bg-blue-600 h-2.5 rounded-full" style={{ width: `${percent}%` }}></div>
|
|
8
|
+
</div>
|
|
9
|
+
)
|
|
10
|
+
}
|
|
@@ -24,7 +24,7 @@ export class EditorApi {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const customTheme = EditorView.theme({
|
|
27
|
-
"&": { fontSize: "
|
|
27
|
+
"&": { fontSize: "14px", fontFamily: "monospace" },
|
|
28
28
|
".cm-content": { fontFamily: "inherit" },
|
|
29
29
|
".cm-scroller": { fontFamily: "inherit" },
|
|
30
30
|
".cm-gutters": { backgroundColor: "transparent", color: "#ddd" },
|
|
@@ -169,7 +169,7 @@ function ListField({ object }: ListFieldProps) {
|
|
|
169
169
|
})
|
|
170
170
|
}
|
|
171
171
|
<div>
|
|
172
|
-
<Button variant='
|
|
172
|
+
<Button variant='secondary' onClick={addItem}><Plus className="size-6" /> Add</Button>
|
|
173
173
|
</div>
|
|
174
174
|
</div>
|
|
175
175
|
)
|
|
@@ -188,7 +188,7 @@ function ListItem({ list, object, onDelete }: ListItemProps) {
|
|
|
188
188
|
renderItemProperty(object, list.schema.arraySchema.editor)
|
|
189
189
|
}
|
|
190
190
|
</div>
|
|
191
|
-
<Button variant='
|
|
191
|
+
<Button variant='secondary' onClick={onDelete}><Trash2 className='size-4' /></Button>
|
|
192
192
|
</div>
|
|
193
193
|
)
|
|
194
194
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JSONSchema, JSONSchemaType, JSONSchemaTypeName } from "@vertesia/common";
|
|
2
|
-
import Ajv, { ValidateFunction } from "ajv";
|
|
2
|
+
import Ajv, { ErrorObject, ValidateFunction } from "ajv";
|
|
3
3
|
|
|
4
4
|
function createSchemaFromType(type: JSONSchemaTypeName): JSONSchema {
|
|
5
5
|
if (type === 'object') {
|
|
6
6
|
return { type: 'object', properties: {} };
|
|
7
7
|
} else if (type === 'array') {
|
|
8
|
-
return { type: 'array', items: {
|
|
8
|
+
return { type: 'array', items: {} };
|
|
9
9
|
} else {
|
|
10
10
|
return { type };
|
|
11
11
|
}
|
|
@@ -14,13 +14,20 @@ function createSchemaFromType(type: JSONSchemaTypeName): JSONSchema {
|
|
|
14
14
|
export class Schema {
|
|
15
15
|
schema: JSONSchema;
|
|
16
16
|
properties: Record<string, PropertySchema> = {};
|
|
17
|
-
|
|
17
|
+
_validator?: ValidateFunction;
|
|
18
18
|
constructor(schema?: JSONSchema) {
|
|
19
19
|
this.schema = schema || { type: 'object', properties: {} };
|
|
20
|
-
this.validator = new Ajv({ strict: false }).compile(this.schema);
|
|
21
20
|
this.load();
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
get validator() {
|
|
24
|
+
if (!this._validator) {
|
|
25
|
+
const ajv = new Ajv({ allErrors: true, strict: false });
|
|
26
|
+
this._validator = ajv.compile(this.schema);
|
|
27
|
+
}
|
|
28
|
+
return this._validator;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
private load() {
|
|
25
32
|
if (this.schema.properties) {
|
|
26
33
|
const properties = this.schema.properties;
|
|
@@ -57,11 +64,11 @@ export class Schema {
|
|
|
57
64
|
return this.schema.type as JSONSchemaTypeName;
|
|
58
65
|
}
|
|
59
66
|
|
|
60
|
-
validate(value: any) {
|
|
67
|
+
validate(value: any): ErrorObject<string, Record<string, any>, unknown>[] | null {
|
|
61
68
|
if (!this.validator(value)) {
|
|
62
69
|
return this.validator.errors || [];
|
|
63
70
|
} else {
|
|
64
|
-
return
|
|
71
|
+
return null;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
74
|
|
|
@@ -194,7 +201,7 @@ function getArrayElementType(schema: JSONSchema) {
|
|
|
194
201
|
throw new Error('Expecting an array schema');
|
|
195
202
|
}
|
|
196
203
|
if (!schema.items) {
|
|
197
|
-
schema.items = {
|
|
204
|
+
schema.items = {};
|
|
198
205
|
} else if (Array.isArray(schema.items)) {
|
|
199
206
|
throw new Error('Tuple arrays are not supported');
|
|
200
207
|
}
|
package/src/widgets/index.ts
CHANGED
|
@@ -2,4 +2,8 @@ export * from "./xml-viewer/index.js";
|
|
|
2
2
|
export * from "./json-view/index.js";
|
|
3
3
|
export * from "./schema-editor/index.js";
|
|
4
4
|
export * from "./form/index.js";
|
|
5
|
-
export * from "./codemirror/index.js";
|
|
5
|
+
export * from "./codemirror/index.js";
|
|
6
|
+
export * from "./properties/index.js";
|
|
7
|
+
export * from "./popover/index.js";
|
|
8
|
+
export * from "./upload/index.js";
|
|
9
|
+
export * from "./Progress.js"
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { flip, offset, shift } from "@floating-ui/dom";
|
|
2
|
+
import {
|
|
3
|
+
FloatingFocusManager,
|
|
4
|
+
FloatingPortal,
|
|
5
|
+
Middleware,
|
|
6
|
+
Placement,
|
|
7
|
+
UseClickProps,
|
|
8
|
+
UseDismissProps,
|
|
9
|
+
UseHoverProps,
|
|
10
|
+
UseTransitionStylesProps,
|
|
11
|
+
autoUpdate,
|
|
12
|
+
safePolygon,
|
|
13
|
+
useClick,
|
|
14
|
+
useDismiss,
|
|
15
|
+
useFloating,
|
|
16
|
+
useHover,
|
|
17
|
+
useInteractions,
|
|
18
|
+
useTransitionStyles
|
|
19
|
+
} from "@floating-ui/react";
|
|
20
|
+
import clsx from "clsx";
|
|
21
|
+
import { ReactElement, ReactNode, useState } from "react";
|
|
22
|
+
import { PopoverContext } from "./context";
|
|
23
|
+
import { defineSlot, processSlots } from "./slots";
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function computeElementProps<T extends { enabled?: boolean }>(value: undefined | boolean | T) {
|
|
28
|
+
if (!value) return { enabled: false } as T;
|
|
29
|
+
return (typeof value === 'boolean' ? { enabled: value } : value) as T
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function getHoverProps(props: PopoverTriggerProps | undefined) {
|
|
33
|
+
return props?.hover === true ? {
|
|
34
|
+
enabled: true,
|
|
35
|
+
handleClose: safePolygon({ blockPointerEvents: true }),
|
|
36
|
+
restMs: 0,
|
|
37
|
+
} : props?.hover
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getClickProps(props: PopoverTriggerProps | undefined) {
|
|
41
|
+
return props && !props.hover && !props.click ? {
|
|
42
|
+
enabled: true,
|
|
43
|
+
} : props?.click
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface BasePopoverProps {
|
|
47
|
+
strategy?: "fixed" | "absolute"
|
|
48
|
+
placement?: Placement,
|
|
49
|
+
middleware?: Middleware[],
|
|
50
|
+
zIndex?: number,
|
|
51
|
+
dismiss?: boolean | UseDismissProps,
|
|
52
|
+
offset?: number
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface PopoverProps extends BasePopoverProps {
|
|
56
|
+
children: ReactNode | Iterable<ReactNode>
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The component is instantiated when all interactions are known
|
|
60
|
+
* @param param0
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export function Popover(props: PopoverProps) {
|
|
64
|
+
|
|
65
|
+
const slots: { trigger?: ReactElement, content?: ReactElement } = {};
|
|
66
|
+
processSlots(props.children, slots);
|
|
67
|
+
|
|
68
|
+
if (!slots.content) {
|
|
69
|
+
throw new Error('Popover must provide a content slot')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const triggerProps = slots.trigger?.props as PopoverTriggerProps;
|
|
73
|
+
const contentProps = slots.content.props as PopoverContentProps;
|
|
74
|
+
|
|
75
|
+
// wait for the trigger to be defined
|
|
76
|
+
return <ResolvedPopover {...props}
|
|
77
|
+
trigger={triggerProps}
|
|
78
|
+
content={contentProps}
|
|
79
|
+
/>
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
interface ResolvedPopoverProps extends BasePopoverProps {
|
|
84
|
+
trigger?: PopoverTriggerProps
|
|
85
|
+
content: PopoverContentProps
|
|
86
|
+
}
|
|
87
|
+
function ResolvedPopover({ middleware, offset: defaultOffset, trigger, dismiss = true, content, placement, strategy, zIndex = 40 }: ResolvedPopoverProps) {
|
|
88
|
+
const [isOpen, setIsOpen] = useState(false)
|
|
89
|
+
const floating = useFloating({
|
|
90
|
+
open: isOpen,
|
|
91
|
+
placement,
|
|
92
|
+
strategy,
|
|
93
|
+
onOpenChange: setIsOpen,
|
|
94
|
+
middleware: middleware || [offset(defaultOffset || 4), shift(), flip()],
|
|
95
|
+
whileElementsMounted: autoUpdate // stick to the anchor when resizing / scrolling
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
const {
|
|
100
|
+
floatingStyles,
|
|
101
|
+
refs: { setReference, setFloating },
|
|
102
|
+
context,
|
|
103
|
+
} = floating;
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
const dismissInteraction = useDismiss(context, computeElementProps(dismiss))
|
|
107
|
+
const clickInteraction = useClick(context, computeElementProps(getClickProps(trigger)))
|
|
108
|
+
const hoverInteraction = useHover(context, computeElementProps(getHoverProps(trigger)))
|
|
109
|
+
|
|
110
|
+
const {
|
|
111
|
+
getReferenceProps,
|
|
112
|
+
getFloatingProps,
|
|
113
|
+
} = useInteractions([dismissInteraction, clickInteraction, hoverInteraction]);
|
|
114
|
+
|
|
115
|
+
const { isMounted, styles: transitionStyles } = useTransitionStyles(context, content.transition);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<PopoverContext.Provider value={{
|
|
119
|
+
...floating,
|
|
120
|
+
close: () => setIsOpen(false)
|
|
121
|
+
}}>
|
|
122
|
+
{trigger &&
|
|
123
|
+
<div className={clsx(trigger.className, "inline-block")} ref={setReference} {...getReferenceProps()}>
|
|
124
|
+
{trigger.children}
|
|
125
|
+
</div>
|
|
126
|
+
}
|
|
127
|
+
<FloatingPortal>
|
|
128
|
+
{
|
|
129
|
+
isMounted && (
|
|
130
|
+
<div ref={setFloating}
|
|
131
|
+
style={{ ...floatingStyles, zIndex: zIndex }}
|
|
132
|
+
{...getFloatingProps()}
|
|
133
|
+
>
|
|
134
|
+
<FloatingFocusManager context={context}>
|
|
135
|
+
<div className={clsx(content.className, "bg-popover rounded-md text-popover-foreground max-w-md")} style={transitionStyles}>
|
|
136
|
+
{content.children}
|
|
137
|
+
</div>
|
|
138
|
+
</FloatingFocusManager>
|
|
139
|
+
</div>
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
</FloatingPortal>
|
|
143
|
+
</PopoverContext.Provider>
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
interface PopoverTriggerProps {
|
|
150
|
+
children: ReactNode | ReactNode[]
|
|
151
|
+
className?: string
|
|
152
|
+
click?: boolean | UseClickProps
|
|
153
|
+
hover?: boolean | UseHoverProps
|
|
154
|
+
}
|
|
155
|
+
function PopoverTrigger(_props: PopoverTriggerProps) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
defineSlot('trigger', PopoverTrigger);
|
|
159
|
+
|
|
160
|
+
interface PopoverContentProps {
|
|
161
|
+
className?: string
|
|
162
|
+
transition?: UseTransitionStylesProps
|
|
163
|
+
children: ReactNode | ReactNode[]
|
|
164
|
+
}
|
|
165
|
+
function PopoverContent(_props: PopoverContentProps) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
defineSlot('content', PopoverContent);
|
|
169
|
+
|
|
170
|
+
Popover.Trigger = PopoverTrigger;
|
|
171
|
+
Popover.Content = PopoverContent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UseFloatingReturn } from "@floating-ui/react";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
|
|
4
|
+
interface PopoverApi extends UseFloatingReturn {
|
|
5
|
+
close: () => void
|
|
6
|
+
}
|
|
7
|
+
const PopoverContext = createContext<PopoverApi>(undefined as any);
|
|
8
|
+
|
|
9
|
+
export function usePopoverContext() {
|
|
10
|
+
return useContext(PopoverContext);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
PopoverContext
|
|
15
|
+
}
|