@vertesia/ui 1.5.0-dev.20260717.131047Z → 1.5.0-dev.20260725.083715Z
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/core/components/SidePanel.js +1 -1
- package/lib/core/components/SidePanel.js.map +1 -1
- package/lib/core/components/shadcn/button.d.ts +10 -3
- package/lib/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/core/components/shadcn/button.js +41 -9
- package/lib/core/components/shadcn/button.js.map +1 -1
- package/lib/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/core/components/shadcn/filters/filterBar.js +1 -1
- package/lib/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.d.ts +1 -1
- package/lib/core/components/shadcn/modal/dialog.d.ts.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.js +3 -1
- package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
- package/lib/core/components/shadcn/tabs.d.ts +12 -1
- package/lib/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/core/components/shadcn/tabs.js +12 -4
- package/lib/core/components/shadcn/tabs.js.map +1 -1
- package/lib/core/components/shadcn/theme/ThemeSwitcher.js +1 -1
- package/lib/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.js +2 -2
- package/lib/features/agent/chat/AgentChatPlaybackControls.js.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.js +2 -2
- package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.d.ts +5 -1
- package/lib/features/agent/chat/AgentRightPanel.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRightPanel.js +2 -2
- package/lib/features/agent/chat/AgentRightPanel.js.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts +5 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.js +53 -13
- package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
- package/lib/features/agent/chat/DocumentEditingActionCard.d.ts +6 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.d.ts.map +1 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.js +129 -0
- package/lib/features/agent/chat/DocumentEditingActionCard.js.map +1 -0
- package/lib/features/agent/chat/ImageLightbox.d.ts.map +1 -1
- package/lib/features/agent/chat/ImageLightbox.js +1 -1
- package/lib/features/agent/chat/ImageLightbox.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts +19 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +125 -27
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts +45 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js +40 -0
- package/lib/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +96 -51
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js +9 -5
- package/lib/features/agent/chat/ModernAgentOutput/AttachmentPreview.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts +25 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js +33 -0
- package/lib/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/Header.js +4 -2
- package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +23 -24
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts +14 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js +21 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts +30 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js +53 -0
- package/lib/features/agent/chat/ModernAgentOutput/ResourceChip.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js +21 -2
- package/lib/features/agent/chat/ModernAgentOutput/ToolCallGroup.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +15 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js +29 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceLinks.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts +33 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.d.ts.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js +129 -0
- package/lib/features/agent/chat/ModernAgentOutput/resourceSummary.js.map +1 -0
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts +7 -0
- package/lib/features/agent/chat/ModernAgentOutput/utils.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.js +11 -1
- package/lib/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentStream.js +24 -9
- package/lib/features/agent/chat/hooks/useAgentStream.js.map +1 -1
- package/lib/features/agent/chat/index.d.ts +2 -1
- package/lib/features/agent/chat/index.d.ts.map +1 -1
- package/lib/features/agent/chat/index.js +3 -0
- package/lib/features/agent/chat/index.js.map +1 -1
- package/lib/features/environment/SelectEnvironment.d.ts +28 -0
- package/lib/features/environment/SelectEnvironment.d.ts.map +1 -0
- package/lib/features/environment/SelectEnvironment.js +97 -0
- package/lib/features/environment/SelectEnvironment.js.map +1 -0
- package/lib/features/environment/index.d.ts +2 -0
- package/lib/features/environment/index.d.ts.map +1 -0
- package/lib/features/environment/index.js +2 -0
- package/lib/features/environment/index.js.map +1 -0
- package/lib/features/index.d.ts +2 -0
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +2 -0
- package/lib/features/index.js.map +1 -1
- package/lib/features/magic-pdf/AnnotatedImageSlider.js +12 -12
- package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.js +3 -17
- package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
- package/lib/features/magic-pdf/ExtractedContentView.js +2 -6
- package/lib/features/magic-pdf/ExtractedContentView.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +25 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +42 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts +27 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js +377 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -0
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts +0 -2
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfProvider.js +15 -42
- package/lib/features/magic-pdf/MagicPdfProvider.js.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.js +2 -19
- package/lib/features/magic-pdf/MagicPdfView.js.map +1 -1
- package/lib/features/magic-pdf/index.d.ts +1 -0
- package/lib/features/magic-pdf/index.d.ts.map +1 -1
- package/lib/features/magic-pdf/index.js +1 -0
- package/lib/features/magic-pdf/index.js.map +1 -1
- package/lib/features/magic-pdf/types.d.ts +1 -1
- package/lib/features/magic-pdf/types.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.js +2 -2
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
- package/lib/features/pdf-viewer/PdfPageSlider.js +2 -2
- package/lib/features/pdf-viewer/PdfPageSlider.js.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.js +3 -3
- package/lib/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.js +5 -5
- package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.js +4 -4
- package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.js +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.js.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts +2 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.js +159 -31
- package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts +16 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js +116 -0
- package/lib/features/store/objects/components/DocumentEditingConfigurationSelector.js.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts +7 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.js +13 -0
- package/lib/features/store/objects/components/DocumentEditingLockStatus.js.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.d.ts +48 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.d.ts.map +1 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.js +720 -0
- package/lib/features/store/objects/components/DocumentEditingPanel.js.map +1 -0
- package/lib/features/store/objects/components/DocumentIcon.js +1 -1
- package/lib/features/store/objects/components/TextEditorPanel.d.ts.map +1 -1
- package/lib/features/store/objects/components/TextEditorPanel.js +22 -9
- package/lib/features/store/objects/components/TextEditorPanel.js.map +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/features/store/objects/components/documentArtifactRefs.d.ts +26 -0
- package/lib/features/store/objects/components/documentArtifactRefs.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentArtifactRefs.js +52 -0
- package/lib/features/store/objects/components/documentArtifactRefs.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts +4 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.js +40 -0
- package/lib/features/store/objects/components/documentEditingAgentConfig.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingPrompts.d.ts +3 -0
- package/lib/features/store/objects/components/documentEditingPrompts.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingPrompts.js +13 -0
- package/lib/features/store/objects/components/documentEditingPrompts.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingRun.d.ts +27 -0
- package/lib/features/store/objects/components/documentEditingRun.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingRun.js +126 -0
- package/lib/features/store/objects/components/documentEditingRun.js.map +1 -0
- package/lib/features/store/objects/components/documentEditingTarget.d.ts +20 -0
- package/lib/features/store/objects/components/documentEditingTarget.d.ts.map +1 -0
- package/lib/features/store/objects/components/documentEditingTarget.js +40 -0
- package/lib/features/store/objects/components/documentEditingTarget.js.map +1 -0
- package/lib/features/store/objects/components/index.d.ts +1 -0
- package/lib/features/store/objects/components/index.d.ts.map +1 -1
- package/lib/features/store/objects/components/index.js +1 -0
- package/lib/features/store/objects/components/index.js.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts +6 -3
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.js +57 -37
- package/lib/features/store/objects/components/useContentPanelHooks.js.map +1 -1
- package/lib/features/store/objects/components/useDownloadFile.d.ts +2 -1
- package/lib/features/store/objects/components/useDownloadFile.d.ts.map +1 -1
- package/lib/features/store/objects/components/useDownloadFile.js +3 -0
- package/lib/features/store/objects/components/useDownloadFile.js.map +1 -1
- package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/features/store/objects/layout/renderers.js +2 -2
- package/lib/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +1 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +4 -4
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts +15 -0
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyEditor.js +455 -0
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts +11 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.js +91 -0
- package/lib/features/store/types/IntakePolicyForm.js.map +1 -0
- package/lib/features/store/types/SelectContentTypeModal.js +1 -1
- package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
- package/lib/features/store/types/index.d.ts +2 -0
- package/lib/features/store/types/index.d.ts.map +1 -1
- package/lib/features/store/types/index.js +2 -0
- package/lib/features/store/types/index.js.map +1 -1
- package/lib/features/store/types/intake-policy-editor.logic.d.ts +7 -0
- package/lib/features/store/types/intake-policy-editor.logic.d.ts.map +1 -0
- package/lib/features/store/types/intake-policy-editor.logic.js +60 -0
- package/lib/features/store/types/intake-policy-editor.logic.js.map +1 -0
- package/lib/features/store/types/typeCatalogCache.d.ts +5 -0
- package/lib/features/store/types/typeCatalogCache.d.ts.map +1 -0
- package/lib/features/store/types/typeCatalogCache.js +40 -0
- package/lib/features/store/types/typeCatalogCache.js.map +1 -0
- package/lib/features/user/UserInfo.js +7 -3
- package/lib/features/user/UserInfo.js.map +1 -1
- package/lib/features/views/ViewExperience.d.ts +20 -0
- package/lib/features/views/ViewExperience.d.ts.map +1 -0
- package/lib/features/views/ViewExperience.js +188 -0
- package/lib/features/views/ViewExperience.js.map +1 -0
- package/lib/features/views/ViewNavigation.d.ts +3 -0
- package/lib/features/views/ViewNavigation.d.ts.map +1 -0
- package/lib/features/views/ViewNavigation.js +36 -0
- package/lib/features/views/ViewNavigation.js.map +1 -0
- package/lib/features/views/ViewResults.d.ts +9 -0
- package/lib/features/views/ViewResults.d.ts.map +1 -0
- package/lib/features/views/ViewResults.js +229 -0
- package/lib/features/views/ViewResults.js.map +1 -0
- package/lib/features/views/ViewSearch.d.ts +3 -0
- package/lib/features/views/ViewSearch.d.ts.map +1 -0
- package/lib/features/views/ViewSearch.js +74 -0
- package/lib/features/views/ViewSearch.js.map +1 -0
- package/lib/features/views/index.d.ts +7 -0
- package/lib/features/views/index.d.ts.map +1 -0
- package/lib/features/views/index.js +7 -0
- package/lib/features/views/index.js.map +1 -0
- package/lib/features/views/types.d.ts +39 -0
- package/lib/features/views/types.d.ts.map +1 -0
- package/lib/features/views/types.js +2 -0
- package/lib/features/views/types.js.map +1 -0
- package/lib/features/views/viewState.d.ts +14 -0
- package/lib/features/views/viewState.d.ts.map +1 -0
- package/lib/features/views/viewState.js +117 -0
- package/lib/features/views/viewState.js.map +1 -0
- package/lib/i18n/locales/ar.json +134 -1
- package/lib/i18n/locales/de.json +130 -1
- package/lib/i18n/locales/en.json +363 -33
- package/lib/i18n/locales/es.json +131 -1
- package/lib/i18n/locales/fr.json +131 -1
- package/lib/i18n/locales/it.json +131 -1
- package/lib/i18n/locales/ja.json +129 -1
- package/lib/i18n/locales/ko.json +129 -1
- package/lib/i18n/locales/pt.json +131 -1
- package/lib/i18n/locales/ru.json +132 -1
- package/lib/i18n/locales/tr.json +130 -1
- package/lib/i18n/locales/zh-TW.json +129 -1
- package/lib/i18n/locales/zh.json +129 -1
- package/lib/rich-text/EditorToolbar.d.ts +37 -0
- package/lib/rich-text/EditorToolbar.d.ts.map +1 -0
- package/lib/rich-text/EditorToolbar.js +215 -0
- package/lib/rich-text/EditorToolbar.js.map +1 -0
- package/lib/rich-text/VertesiaRichTextEditor.d.ts +26 -0
- package/lib/rich-text/VertesiaRichTextEditor.d.ts.map +1 -0
- package/lib/rich-text/VertesiaRichTextEditor.js +67 -0
- package/lib/rich-text/VertesiaRichTextEditor.js.map +1 -0
- package/lib/rich-text/index.d.ts +2 -0
- package/lib/rich-text/index.d.ts.map +1 -0
- package/lib/rich-text/index.js +2 -0
- package/lib/rich-text/index.js.map +1 -0
- package/lib/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/router/HistoryNavigator.js +23 -13
- package/lib/router/HistoryNavigator.js.map +1 -1
- package/lib/router/Nav.d.ts.map +1 -1
- package/lib/router/Nav.js +15 -6
- package/lib/router/Nav.js.map +1 -1
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +5 -3
- package/lib/session/UserSession.js.map +1 -1
- package/lib/vertesia-ui-core.js +4 -4
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +40 -28
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +15 -15
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-rich-text.js +5 -0
- package/lib/vertesia-ui-rich-text.js.map +1 -0
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +25 -7
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/form/Form.js +1 -1
- package/lib/widgets/form/Form.js.map +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js.map +1 -1
- package/lib/widgets/json-view/JSONView.js +6 -6
- package/lib/widgets/json-view/JSONView.js.map +1 -1
- package/lib/widgets/markdown/AgentResourceResolver.d.ts +31 -0
- package/lib/widgets/markdown/AgentResourceResolver.d.ts.map +1 -0
- package/lib/widgets/markdown/AgentResourceResolver.js +39 -0
- package/lib/widgets/markdown/AgentResourceResolver.js.map +1 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.d.ts +63 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.d.ts.map +1 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.js +582 -0
- package/lib/widgets/markdown/ArtifactEditingSurface.js.map +1 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts +69 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.d.ts.map +1 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js +374 -0
- package/lib/widgets/markdown/CollaborativeMarkdownRenderer.js.map +1 -0
- package/lib/widgets/markdown/MarkdownLink.d.ts +3 -1
- package/lib/widgets/markdown/MarkdownLink.d.ts.map +1 -1
- package/lib/widgets/markdown/MarkdownLink.js +41 -14
- package/lib/widgets/markdown/MarkdownLink.js.map +1 -1
- package/lib/widgets/markdown/MarkdownRenderer.d.ts +8 -1
- package/lib/widgets/markdown/MarkdownRenderer.d.ts.map +1 -1
- package/lib/widgets/markdown/MarkdownRenderer.js +20 -4
- package/lib/widgets/markdown/MarkdownRenderer.js.map +1 -1
- package/lib/widgets/markdown/index.d.ts +5 -1
- package/lib/widgets/markdown/index.d.ts.map +1 -1
- package/lib/widgets/markdown/index.js +5 -1
- package/lib/widgets/markdown/index.js.map +1 -1
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.d.ts.map +1 -1
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.js +14 -2
- package/lib/widgets/markdown/normalizeCustomSchemeLinks.js.map +1 -1
- package/lib/widgets/markdown/textDiff.d.ts +52 -0
- package/lib/widgets/markdown/textDiff.d.ts.map +1 -0
- package/lib/widgets/markdown/textDiff.js +362 -0
- package/lib/widgets/markdown/textDiff.js.map +1 -0
- package/lib/widgets/markdown/useArtifactContent.d.ts +5 -3
- package/lib/widgets/markdown/useArtifactContent.d.ts.map +1 -1
- package/lib/widgets/markdown/useArtifactContent.js +6 -3
- package/lib/widgets/markdown/useArtifactContent.js.map +1 -1
- package/lib/widgets/markdown/useResolvedUrl.d.ts +1 -5
- package/lib/widgets/markdown/useResolvedUrl.d.ts.map +1 -1
- package/lib/widgets/markdown/useResolvedUrl.js +19 -31
- package/lib/widgets/markdown/useResolvedUrl.js.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.js +29 -0
- package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.d.ts +8 -0
- package/lib/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.js +16 -0
- package/lib/widgets/schema-editor/ManagedSchema.js.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +2 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js +1 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js +4 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.js +22 -11
- package/lib/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts +9 -0
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.d.ts.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.js +20 -17
- package/lib/widgets/xml-viewer/hooks/useXMLViewer.js.map +1 -1
- package/package.json +37 -33
- package/src/__tests__/a11y.test.tsx +77 -1
- package/src/__tests__/axe-helper.ts +17 -7
- package/src/__tests__/setup.ts +25 -0
- package/src/core/components/SidePanel.tsx +1 -1
- package/src/core/components/shadcn/button.tsx +67 -12
- package/src/core/components/shadcn/filters/filterBar.tsx +1 -0
- package/src/core/components/shadcn/modal/dialog.tsx +4 -2
- package/src/core/components/shadcn/tabs.test.tsx +65 -0
- package/src/core/components/shadcn/tabs.tsx +25 -3
- package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +1 -1
- package/src/features/agent/chat/AgentChatPlaybackControls.tsx +0 -5
- package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +31 -0
- package/src/features/agent/chat/AgentRequestInputOverlay.tsx +6 -2
- package/src/features/agent/chat/AgentRightPanel.tsx +16 -1
- package/src/features/agent/chat/ArtifactsTab.test.tsx +55 -0
- package/src/features/agent/chat/ArtifactsTab.tsx +222 -61
- package/src/features/agent/chat/DocumentEditingActionCard.test.tsx +105 -0
- package/src/features/agent/chat/DocumentEditingActionCard.tsx +210 -0
- package/src/features/agent/chat/ImageLightbox.tsx +0 -1
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +285 -40
- package/src/features/agent/chat/ModernAgentConversation.tsx +247 -77
- package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.test.tsx +79 -0
- package/src/features/agent/chat/ModernAgentOutput/AgentMarkdownAnchor.tsx +94 -0
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +263 -35
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +236 -118
- package/src/features/agent/chat/ModernAgentOutput/AttachmentPreview.tsx +17 -0
- package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.test.tsx +44 -0
- package/src/features/agent/chat/ModernAgentOutput/CollapsibleAgentMarkdown.tsx +88 -0
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -3
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +0 -2
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +34 -47
- package/src/features/agent/chat/ModernAgentOutput/ResourceChangeSummary.tsx +40 -0
- package/src/features/agent/chat/ModernAgentOutput/ResourceChip.test.tsx +148 -0
- package/src/features/agent/chat/ModernAgentOutput/ResourceChip.tsx +141 -0
- package/src/features/agent/chat/ModernAgentOutput/ToolCallGroup.tsx +33 -1
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.test.ts +80 -0
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +21 -1
- package/src/features/agent/chat/ModernAgentOutput/resourceLinks.tsx +43 -0
- package/src/features/agent/chat/ModernAgentOutput/resourceSummary.test.ts +229 -0
- package/src/features/agent/chat/ModernAgentOutput/resourceSummary.ts +152 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +17 -0
- package/src/features/agent/chat/ModernAgentOutput/utils.ts +14 -1
- package/src/features/agent/chat/hooks/useAgentStream.test.tsx +188 -0
- package/src/features/agent/chat/hooks/useAgentStream.ts +28 -8
- package/src/features/agent/chat/index.ts +11 -0
- package/src/features/environment/SelectEnvironment.tsx +186 -0
- package/src/features/environment/index.ts +1 -0
- package/src/features/index.ts +2 -0
- package/src/features/magic-pdf/AnnotatedImageSlider.tsx +62 -66
- package/src/features/magic-pdf/DownloadPopover.tsx +5 -48
- package/src/features/magic-pdf/ExtractedContentView.tsx +2 -14
- package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +86 -0
- package/src/features/magic-pdf/GroundedExtractionView.test.tsx +65 -0
- package/src/features/magic-pdf/GroundedExtractionView.tsx +1055 -0
- package/src/features/magic-pdf/MagicPdfProvider.tsx +17 -47
- package/src/features/magic-pdf/MagicPdfView.tsx +3 -51
- package/src/features/magic-pdf/index.ts +1 -0
- package/src/features/magic-pdf/types.ts +1 -1
- package/src/features/oauth/McpConnectionsButton.tsx +0 -2
- package/src/features/oauth/McpConnectionsDialog.tsx +0 -1
- package/src/features/oauth/RemoteMcpConnectionButton.tsx +0 -1
- package/src/features/pdf-viewer/PdfPageSlider.tsx +5 -5
- package/src/features/pdf-viewer/SimplePdfViewer.tsx +11 -12
- package/src/features/permissions/UserPermissionsProvider.tsx +1 -1
- package/src/features/store/objects/DocumentQuickFilter.tsx +13 -15
- package/src/features/store/objects/DocumentSearchResults.tsx +5 -8
- package/src/features/store/objects/components/ContentDispositionButton.tsx +5 -1
- package/src/features/store/objects/components/ContentOverview.tsx +356 -105
- package/src/features/store/objects/components/DocumentEditingConfigurationSelector.test.ts +34 -0
- package/src/features/store/objects/components/DocumentEditingConfigurationSelector.tsx +211 -0
- package/src/features/store/objects/components/DocumentEditingLockStatus.test.tsx +32 -0
- package/src/features/store/objects/components/DocumentEditingLockStatus.tsx +45 -0
- package/src/features/store/objects/components/DocumentEditingPanel.test.tsx +336 -0
- package/src/features/store/objects/components/DocumentEditingPanel.tsx +1236 -0
- package/src/features/store/objects/components/DocumentIcon.tsx +1 -1
- package/src/features/store/objects/components/TextEditorPanel.test.tsx +48 -0
- package/src/features/store/objects/components/TextEditorPanel.tsx +41 -20
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/components/documentArtifactRefs.test.ts +65 -0
- package/src/features/store/objects/components/documentArtifactRefs.ts +72 -0
- package/src/features/store/objects/components/documentEditingAgentConfig.test.ts +28 -0
- package/src/features/store/objects/components/documentEditingAgentConfig.ts +41 -0
- package/src/features/store/objects/components/documentEditingPrompts.test.ts +26 -0
- package/src/features/store/objects/components/documentEditingPrompts.ts +12 -0
- package/src/features/store/objects/components/documentEditingRun.test.ts +176 -0
- package/src/features/store/objects/components/documentEditingRun.ts +184 -0
- package/src/features/store/objects/components/documentEditingTarget.test.ts +96 -0
- package/src/features/store/objects/components/documentEditingTarget.ts +63 -0
- package/src/features/store/objects/components/index.ts +1 -0
- package/src/features/store/objects/components/useContentPanelHooks.ts +55 -42
- package/src/features/store/objects/components/useDownloadFile.test.ts +20 -0
- package/src/features/store/objects/components/useDownloadFile.ts +5 -1
- package/src/features/store/objects/layout/renderers.tsx +1 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +1 -1
- package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +2 -2
- package/src/features/store/types/ContentObjectTypesTable.tsx +12 -14
- package/src/features/store/types/IntakePolicyEditor.tsx +679 -0
- package/src/features/store/types/IntakePolicyForm.tsx +838 -0
- package/src/features/store/types/SelectContentTypeModal.tsx +2 -2
- package/src/features/store/types/index.ts +2 -0
- package/src/features/store/types/intake-policy-editor.logic.test.ts +109 -0
- package/src/features/store/types/intake-policy-editor.logic.ts +87 -0
- package/src/features/store/types/typeCatalogCache.ts +45 -0
- package/src/features/user/UserInfo.tsx +7 -7
- package/src/features/views/ViewExperience.test.tsx +273 -0
- package/src/features/views/ViewExperience.tsx +408 -0
- package/src/features/views/ViewNavigation.test.tsx +86 -0
- package/src/features/views/ViewNavigation.tsx +187 -0
- package/src/features/views/ViewResults.test.ts +82 -0
- package/src/features/views/ViewResults.tsx +609 -0
- package/src/features/views/ViewSearch.test.tsx +147 -0
- package/src/features/views/ViewSearch.tsx +205 -0
- package/src/features/views/index.ts +6 -0
- package/src/features/views/types.ts +57 -0
- package/src/features/views/viewState.test.ts +111 -0
- package/src/features/views/viewState.ts +132 -0
- package/src/i18n/locales/ar.json +134 -1
- package/src/i18n/locales/de.json +130 -1
- package/src/i18n/locales/en.json +1083 -753
- package/src/i18n/locales/es.json +131 -1
- package/src/i18n/locales/fr.json +131 -1
- package/src/i18n/locales/it.json +131 -1
- package/src/i18n/locales/ja.json +129 -1
- package/src/i18n/locales/ko.json +129 -1
- package/src/i18n/locales/pt.json +131 -1
- package/src/i18n/locales/ru.json +132 -1
- package/src/i18n/locales/tr.json +130 -1
- package/src/i18n/locales/zh-TW.json +129 -1
- package/src/i18n/locales/zh.json +129 -1
- package/src/rich-text/EditorToolbar.tsx +708 -0
- package/src/rich-text/VertesiaRichTextEditor.test.tsx +211 -0
- package/src/rich-text/VertesiaRichTextEditor.tsx +241 -0
- package/src/rich-text/index.ts +9 -0
- package/src/router/HistoryNavigator.test.ts +48 -0
- package/src/router/HistoryNavigator.ts +24 -13
- package/src/router/Nav.tsx +18 -8
- package/src/session/UserSession.test.ts +39 -0
- package/src/session/UserSession.ts +5 -3
- package/src/widgets/form/Form.tsx +1 -1
- package/src/widgets/json-view/JSONSwitcher.tsx +2 -2
- package/src/widgets/json-view/JSONView.tsx +7 -7
- package/src/widgets/markdown/AgentResourceResolver.test.ts +24 -0
- package/src/widgets/markdown/AgentResourceResolver.tsx +70 -0
- package/src/widgets/markdown/ArtifactEditingSurface.test.tsx +537 -0
- package/src/widgets/markdown/ArtifactEditingSurface.tsx +878 -0
- package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +484 -0
- package/src/widgets/markdown/CollaborativeMarkdownRenderer.tsx +825 -0
- package/src/widgets/markdown/MarkdownLink.test.tsx +122 -0
- package/src/widgets/markdown/MarkdownLink.tsx +102 -17
- package/src/widgets/markdown/MarkdownRenderer.tsx +30 -3
- package/src/widgets/markdown/index.ts +39 -1
- package/src/widgets/markdown/normalizeCustomSchemeLinks.ts +15 -2
- package/src/widgets/markdown/textDiff.test.ts +156 -0
- package/src/widgets/markdown/textDiff.ts +399 -0
- package/src/widgets/markdown/useArtifactContent.ts +9 -3
- package/src/widgets/markdown/useResolvedUrl.test.ts +29 -40
- package/src/widgets/markdown/useResolvedUrl.ts +33 -35
- package/src/widgets/monacoEditor/MonacoEditor.tsx +29 -0
- package/src/widgets/schema-editor/ManagedSchema.ts +22 -0
- package/src/widgets/schema-editor/editor/EditableSchemaProperty.tsx +3 -0
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +14 -3
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +80 -29
- package/src/widgets/xml-viewer/hooks/useXMLViewer.test.ts +26 -0
- package/src/widgets/xml-viewer/hooks/useXMLViewer.ts +23 -18
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { AgentsApi } from '@vertesia/client';
|
|
2
|
+
import type { AgentRun } from '@vertesia/common';
|
|
3
|
+
|
|
4
|
+
const DOCUMENT_EDITING_TAG = 'document-editing';
|
|
5
|
+
const DOCUMENT_ROOT_TAG_PREFIX = 'document-root:';
|
|
6
|
+
const LEGACY_DOCUMENT_TAG_PREFIX = 'document:';
|
|
7
|
+
export const DOCUMENT_EDITING_DEFAULT_INTERACTION = 'sys:GeneralAgent';
|
|
8
|
+
const openDocumentEditingScopes = new Set<string>();
|
|
9
|
+
const MARKDOWN_CONTENT_TYPES = new Set(['text/markdown', 'text/x-markdown']);
|
|
10
|
+
const DOCUMENT_EDITING_CONTENT_TYPES = new Set([...MARKDOWN_CONTENT_TYPES, 'text/plain']);
|
|
11
|
+
|
|
12
|
+
export type DocumentEditingRunProperties = {
|
|
13
|
+
resource_kind: 'store_document';
|
|
14
|
+
document_id: string;
|
|
15
|
+
document_root_id: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface DocumentEditingRunIdentity {
|
|
19
|
+
tags: string[];
|
|
20
|
+
properties: DocumentEditingRunProperties;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type DocumentEditingRunApi = Pick<AgentsApi, 'list' | 'retrieve' | 'search'>;
|
|
24
|
+
|
|
25
|
+
export function createDocumentEditingScopeKey(projectId: string, documentRootId: string): string {
|
|
26
|
+
return `${projectId}:${documentRootId}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function isDocumentEditingScopeOpen(scopeKey: string): boolean {
|
|
30
|
+
return openDocumentEditingScopes.has(scopeKey);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function setDocumentEditingScopeOpen(scopeKey: string, isOpen: boolean): void {
|
|
34
|
+
if (isOpen) {
|
|
35
|
+
openDocumentEditingScopes.add(scopeKey);
|
|
36
|
+
} else {
|
|
37
|
+
openDocumentEditingScopes.delete(scopeKey);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function getRecord(value: unknown): Record<string, unknown> | undefined {
|
|
42
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? (value as Record<string, unknown>) : undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function documentRootTag(documentRootId: string): string {
|
|
46
|
+
return `${DOCUMENT_ROOT_TAG_PREFIX}${documentRootId}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function legacyDocumentTag(documentId: string): string {
|
|
50
|
+
return `${LEGACY_DOCUMENT_TAG_PREFIX}${documentId}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function createDocumentEditingRunIdentity(
|
|
54
|
+
documentId: string,
|
|
55
|
+
documentRootId: string,
|
|
56
|
+
): DocumentEditingRunIdentity {
|
|
57
|
+
return {
|
|
58
|
+
tags: [DOCUMENT_EDITING_TAG, documentRootTag(documentRootId), legacyDocumentTag(documentId)],
|
|
59
|
+
properties: {
|
|
60
|
+
resource_kind: 'store_document',
|
|
61
|
+
document_id: documentId,
|
|
62
|
+
document_root_id: documentRootId,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getDocumentTextActionAccess(canEdit: boolean, canCollaborate: boolean) {
|
|
68
|
+
return {
|
|
69
|
+
canEdit,
|
|
70
|
+
canCollaborate,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function normalizedContentType(contentType: string | undefined): string | undefined {
|
|
75
|
+
return contentType?.split(';', 1)[0]?.trim().toLowerCase() || undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function isMarkdownContentType(contentType: string | undefined): boolean {
|
|
79
|
+
const normalized = normalizedContentType(contentType);
|
|
80
|
+
return normalized !== undefined && MARKDOWN_CONTENT_TYPES.has(normalized);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isDocumentEditingContentType(contentType: string | undefined): boolean {
|
|
84
|
+
const normalized = normalizedContentType(contentType);
|
|
85
|
+
return normalized !== undefined && DOCUMENT_EDITING_CONTENT_TYPES.has(normalized);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function isDocumentEditingRun(
|
|
89
|
+
run: AgentRun,
|
|
90
|
+
documentId: string,
|
|
91
|
+
documentRootId: string,
|
|
92
|
+
startedBy: string,
|
|
93
|
+
interaction = DOCUMENT_EDITING_DEFAULT_INTERACTION,
|
|
94
|
+
): boolean {
|
|
95
|
+
if (run.interaction !== interaction || run.started_by !== startedBy) return false;
|
|
96
|
+
// A cancelled run was explicitly terminated by the user; never resume it as the editing session.
|
|
97
|
+
if (run.status === 'cancelled') return false;
|
|
98
|
+
|
|
99
|
+
const tags = run.tags ?? [];
|
|
100
|
+
if (!tags.includes(DOCUMENT_EDITING_TAG)) return false;
|
|
101
|
+
|
|
102
|
+
const properties = getRecord(run.properties);
|
|
103
|
+
const hasStableRootTag = tags.includes(documentRootTag(documentRootId));
|
|
104
|
+
if (hasStableRootTag) {
|
|
105
|
+
return properties?.resource_kind === 'store_document' && properties.document_root_id === documentRootId;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Runs created before stable root properties were added only carry a document tag.
|
|
109
|
+
return tags.includes(legacyDocumentTag(documentRootId)) || tags.includes(legacyDocumentTag(documentId));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
async function retrieveMatchingRun(
|
|
113
|
+
agents: DocumentEditingRunApi,
|
|
114
|
+
runIds: string[],
|
|
115
|
+
documentId: string,
|
|
116
|
+
documentRootId: string,
|
|
117
|
+
startedBy: string,
|
|
118
|
+
interaction: string,
|
|
119
|
+
): Promise<AgentRun | undefined> {
|
|
120
|
+
for (const runId of runIds) {
|
|
121
|
+
try {
|
|
122
|
+
const run = await agents.retrieve(runId);
|
|
123
|
+
if (isDocumentEditingRun(run, documentId, documentRootId, startedBy, interaction)) return run;
|
|
124
|
+
} catch {
|
|
125
|
+
// The run may have been deleted between search and retrieval. Try the next candidate.
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export async function findDocumentEditingRun(
|
|
132
|
+
agents: DocumentEditingRunApi,
|
|
133
|
+
documentId: string,
|
|
134
|
+
documentRootId: string,
|
|
135
|
+
startedBy: string,
|
|
136
|
+
interaction = DOCUMENT_EDITING_DEFAULT_INTERACTION,
|
|
137
|
+
): Promise<AgentRun | undefined> {
|
|
138
|
+
const lookupTags = [
|
|
139
|
+
documentRootTag(documentRootId),
|
|
140
|
+
legacyDocumentTag(documentRootId),
|
|
141
|
+
legacyDocumentTag(documentId),
|
|
142
|
+
];
|
|
143
|
+
const searchedRunIds = new Set<string>();
|
|
144
|
+
|
|
145
|
+
for (const tag of new Set(lookupTags)) {
|
|
146
|
+
try {
|
|
147
|
+
const response = await agents.search({
|
|
148
|
+
interaction,
|
|
149
|
+
started_by: startedBy,
|
|
150
|
+
tags: [tag],
|
|
151
|
+
limit: 20,
|
|
152
|
+
sort: ['updated_at:desc'],
|
|
153
|
+
});
|
|
154
|
+
const candidateIds = response.hits.map((hit) => hit.id).filter((id) => !searchedRunIds.has(id));
|
|
155
|
+
for (const id of candidateIds) {
|
|
156
|
+
searchedRunIds.add(id);
|
|
157
|
+
}
|
|
158
|
+
const run = await retrieveMatchingRun(
|
|
159
|
+
agents,
|
|
160
|
+
candidateIds,
|
|
161
|
+
documentId,
|
|
162
|
+
documentRootId,
|
|
163
|
+
startedBy,
|
|
164
|
+
interaction,
|
|
165
|
+
);
|
|
166
|
+
if (run) return run;
|
|
167
|
+
} catch {
|
|
168
|
+
// Fall through to the authoritative Mongo-backed list lookup below.
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const response = await agents.list({
|
|
174
|
+
interaction,
|
|
175
|
+
started_by: startedBy,
|
|
176
|
+
limit: 100,
|
|
177
|
+
sort: 'updated_at',
|
|
178
|
+
order: 'desc',
|
|
179
|
+
});
|
|
180
|
+
return response.items.find(
|
|
181
|
+
(run): run is AgentRun =>
|
|
182
|
+
run.run_kind === 'agent' && isDocumentEditingRun(run, documentId, documentRootId, startedBy, interaction),
|
|
183
|
+
);
|
|
184
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ContentObject, ContentObjectItem } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import {
|
|
4
|
+
type DocumentEditingTargetApi,
|
|
5
|
+
DocumentEditingTargetError,
|
|
6
|
+
resolveDocumentEditingTarget,
|
|
7
|
+
} from './documentEditingTarget.js';
|
|
8
|
+
|
|
9
|
+
function contentObject(id: string, head: boolean, etag = `${id}-etag`): ContentObject {
|
|
10
|
+
return {
|
|
11
|
+
id,
|
|
12
|
+
content: { source: `gs://bucket/${id}.md`, type: 'text/markdown', etag },
|
|
13
|
+
revision: { root: 'root-id', parent: 'root-id', head },
|
|
14
|
+
} as unknown as ContentObject;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function revisionItem(id: string, head: boolean): ContentObjectItem {
|
|
18
|
+
return {
|
|
19
|
+
id,
|
|
20
|
+
revision: { root: 'root-id', parent: 'root-id', head },
|
|
21
|
+
} as unknown as ContentObjectItem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function targetApi(): DocumentEditingTargetApi & {
|
|
25
|
+
retrieve: ReturnType<typeof vi.fn<(id: string) => Promise<ContentObject>>>;
|
|
26
|
+
getRevisions: ReturnType<typeof vi.fn<(id: string) => Promise<ContentObjectItem[]>>>;
|
|
27
|
+
getObjectText: ReturnType<typeof vi.fn<(id: string) => Promise<{ text?: string }>>>;
|
|
28
|
+
} {
|
|
29
|
+
return {
|
|
30
|
+
retrieve: vi.fn<(id: string) => Promise<ContentObject>>(),
|
|
31
|
+
getRevisions: vi.fn<(id: string) => Promise<ContentObjectItem[]>>(),
|
|
32
|
+
getObjectText: vi.fn<(id: string) => Promise<{ text?: string }>>(),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
describe('resolveDocumentEditingTarget', () => {
|
|
37
|
+
it('uses a freshly retrieved head revision and its text', async () => {
|
|
38
|
+
const objects = targetApi();
|
|
39
|
+
objects.retrieve.mockResolvedValue(contentObject('head-id', true));
|
|
40
|
+
objects.getObjectText.mockResolvedValue({ text: '# Current head' });
|
|
41
|
+
|
|
42
|
+
await expect(resolveDocumentEditingTarget(objects, 'head-id')).resolves.toEqual({
|
|
43
|
+
id: 'head-id',
|
|
44
|
+
etag: 'head-id-etag',
|
|
45
|
+
content: '# Current head',
|
|
46
|
+
});
|
|
47
|
+
expect(objects.getRevisions).not.toHaveBeenCalled();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('resolves a historical revision to the unique current head', async () => {
|
|
51
|
+
const objects = targetApi();
|
|
52
|
+
objects.retrieve
|
|
53
|
+
.mockResolvedValueOnce(contentObject('old-id', false))
|
|
54
|
+
.mockResolvedValueOnce(contentObject('head-id', true));
|
|
55
|
+
objects.getRevisions.mockResolvedValue([revisionItem('old-id', false), revisionItem('head-id', true)]);
|
|
56
|
+
objects.getObjectText.mockResolvedValue({ text: '# Current head' });
|
|
57
|
+
|
|
58
|
+
await expect(resolveDocumentEditingTarget(objects, 'old-id')).resolves.toEqual({
|
|
59
|
+
id: 'head-id',
|
|
60
|
+
etag: 'head-id-etag',
|
|
61
|
+
content: '# Current head',
|
|
62
|
+
});
|
|
63
|
+
expect(objects.retrieve).toHaveBeenNthCalledWith(2, 'head-id');
|
|
64
|
+
expect(objects.getObjectText).toHaveBeenCalledWith('head-id');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('rejects a historical revision when the current head cannot be proven', async () => {
|
|
68
|
+
const objects = targetApi();
|
|
69
|
+
objects.retrieve.mockResolvedValue(contentObject('old-id', false));
|
|
70
|
+
objects.getRevisions.mockResolvedValue([revisionItem('old-id', false)]);
|
|
71
|
+
|
|
72
|
+
await expect(resolveDocumentEditingTarget(objects, 'old-id')).rejects.toBeInstanceOf(
|
|
73
|
+
DocumentEditingTargetError,
|
|
74
|
+
);
|
|
75
|
+
expect(objects.getObjectText).not.toHaveBeenCalled();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('rejects when the resolved head changes before it can be loaded', async () => {
|
|
79
|
+
const objects = targetApi();
|
|
80
|
+
objects.retrieve
|
|
81
|
+
.mockResolvedValueOnce(contentObject('old-id', false))
|
|
82
|
+
.mockResolvedValueOnce(contentObject('former-head-id', false));
|
|
83
|
+
objects.getRevisions.mockResolvedValue([revisionItem('old-id', false), revisionItem('former-head-id', true)]);
|
|
84
|
+
|
|
85
|
+
await expect(resolveDocumentEditingTarget(objects, 'old-id')).rejects.toThrow('is no longer the current head');
|
|
86
|
+
expect(objects.getObjectText).not.toHaveBeenCalled();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('rejects a target without a content ETag', async () => {
|
|
90
|
+
const objects = targetApi();
|
|
91
|
+
objects.retrieve.mockResolvedValue(contentObject('head-id', true, ''));
|
|
92
|
+
|
|
93
|
+
await expect(resolveDocumentEditingTarget(objects, 'head-id')).rejects.toThrow('has no content ETag');
|
|
94
|
+
expect(objects.getObjectText).not.toHaveBeenCalled();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ContentObject, ContentObjectItem, ContentObjectTextResponse } from '@vertesia/common';
|
|
2
|
+
|
|
3
|
+
export interface DocumentEditingTargetApi {
|
|
4
|
+
retrieve(id: string): Promise<ContentObject>;
|
|
5
|
+
getRevisions(id: string): Promise<ContentObjectItem[]>;
|
|
6
|
+
getObjectText(id: string): Promise<ContentObjectTextResponse>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ResolvedDocumentEditingTarget {
|
|
10
|
+
id: string;
|
|
11
|
+
etag: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export class DocumentEditingTargetError extends Error {
|
|
16
|
+
constructor(message: string, cause?: unknown) {
|
|
17
|
+
super(message, cause === undefined ? undefined : { cause });
|
|
18
|
+
this.name = 'DocumentEditingTargetError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the current head and load its write precondition and text as one unit.
|
|
24
|
+
* Nothing from a historical revision is returned when the head cannot be proven.
|
|
25
|
+
*/
|
|
26
|
+
export async function resolveDocumentEditingTarget(
|
|
27
|
+
objects: DocumentEditingTargetApi,
|
|
28
|
+
requestedDocumentId: string,
|
|
29
|
+
): Promise<ResolvedDocumentEditingTarget> {
|
|
30
|
+
const requestedObject = await objects.retrieve(requestedDocumentId);
|
|
31
|
+
let targetObject = requestedObject;
|
|
32
|
+
const resolvingHistoricalRevision = Boolean(requestedObject.revision && !requestedObject.revision.head);
|
|
33
|
+
|
|
34
|
+
if (resolvingHistoricalRevision) {
|
|
35
|
+
const revisions = await objects.getRevisions(requestedObject.id);
|
|
36
|
+
const heads = revisions.filter((revision) => revision.revision?.head === true);
|
|
37
|
+
if (heads.length !== 1) {
|
|
38
|
+
throw new DocumentEditingTargetError(
|
|
39
|
+
`Expected one head revision for document ${requestedDocumentId}, found ${heads.length}`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
targetObject = await objects.retrieve(heads[0].id);
|
|
43
|
+
if (targetObject.revision?.head !== true) {
|
|
44
|
+
throw new DocumentEditingTargetError(`Resolved document ${targetObject.id} is no longer the current head`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const etag = targetObject.content?.etag;
|
|
49
|
+
if (!etag) {
|
|
50
|
+
throw new DocumentEditingTargetError(`Document ${targetObject.id} has no content ETag`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const response = await objects.getObjectText(targetObject.id);
|
|
54
|
+
if (typeof response.text !== 'string') {
|
|
55
|
+
throw new DocumentEditingTargetError(`Document ${targetObject.id} has no text content`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return {
|
|
59
|
+
id: targetObject.id,
|
|
60
|
+
etag,
|
|
61
|
+
content: response.text,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type DocAnalyzerProgress,
|
|
3
|
-
type DocProcessorOutputFormat,
|
|
4
|
-
MarkdownRenditionFormat,
|
|
5
|
-
WorkflowExecutionStatus,
|
|
6
|
-
} from '@vertesia/common';
|
|
1
|
+
import { type DocAnalyzerProgress, MarkdownRenditionFormat, WorkflowExecutionStatus } from '@vertesia/common';
|
|
7
2
|
import { i18nInstance, NAMESPACE } from '@vertesia/ui/i18n';
|
|
8
3
|
import { useUserSession } from '@vertesia/ui/session';
|
|
9
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
10
5
|
|
|
11
6
|
// Maximum text size before cropping (128K characters)
|
|
12
7
|
const MAX_TEXT_DISPLAY_SIZE = 128 * 1024;
|
|
@@ -14,7 +9,7 @@ const MAX_TEXT_DISPLAY_SIZE = 128 * 1024;
|
|
|
14
9
|
/**
|
|
15
10
|
* Hook for managing object text loading and cropping.
|
|
16
11
|
*/
|
|
17
|
-
export function useObjectText(objectId: string, initialText?: string, loadOnMount = false) {
|
|
12
|
+
export function useObjectText(objectId: string, initialText?: string, loadOnMount = false, changeGroupId = objectId) {
|
|
18
13
|
const { store } = useUserSession();
|
|
19
14
|
|
|
20
15
|
const [fullText, setFullText] = useState<string | undefined>(initialText);
|
|
@@ -26,56 +21,81 @@ export function useObjectText(objectId: string, initialText?: string, loadOnMoun
|
|
|
26
21
|
});
|
|
27
22
|
const [isLoading, setIsLoading] = useState(false);
|
|
28
23
|
const [isCropped, setIsCropped] = useState(() => !!initialText && initialText.length > MAX_TEXT_DISPLAY_SIZE);
|
|
24
|
+
const [changeHighlight, setChangeHighlight] = useState<{ previousText: string; version: number }>();
|
|
25
|
+
const fullTextRef = useRef(initialText);
|
|
26
|
+
const objectIdRef = useRef(objectId);
|
|
27
|
+
const changeGroupIdRef = useRef(changeGroupId);
|
|
28
|
+
const suppressNextHighlightRef = useRef(false);
|
|
29
|
+
|
|
30
|
+
const applyText = useCallback((nextText: string | undefined, shouldHighlight = true) => {
|
|
31
|
+
const previousText = fullTextRef.current;
|
|
32
|
+
if (shouldHighlight && previousText && nextText && previousText !== nextText) {
|
|
33
|
+
setChangeHighlight((current) => ({
|
|
34
|
+
previousText,
|
|
35
|
+
version: (current?.version ?? 0) + 1,
|
|
36
|
+
}));
|
|
37
|
+
} else if (!shouldHighlight) {
|
|
38
|
+
setChangeHighlight(undefined);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fullTextRef.current = nextText;
|
|
42
|
+
setFullText(nextText);
|
|
43
|
+
if (nextText && nextText.length > MAX_TEXT_DISPLAY_SIZE) {
|
|
44
|
+
setDisplayText(nextText.substring(0, MAX_TEXT_DISPLAY_SIZE));
|
|
45
|
+
setIsCropped(true);
|
|
46
|
+
} else {
|
|
47
|
+
setDisplayText(nextText);
|
|
48
|
+
setIsCropped(false);
|
|
49
|
+
}
|
|
50
|
+
}, []);
|
|
29
51
|
|
|
30
52
|
const loadText = useCallback(() => {
|
|
53
|
+
const requestedObjectId = objectId;
|
|
54
|
+
const requestedChangeGroupId = changeGroupId;
|
|
31
55
|
setIsLoading(true);
|
|
32
56
|
store.objects
|
|
33
57
|
.getObjectText(objectId)
|
|
34
58
|
.then((res) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
setDisplayText(res.text);
|
|
41
|
-
setIsCropped(false);
|
|
42
|
-
}
|
|
59
|
+
if (objectIdRef.current !== requestedObjectId) return;
|
|
60
|
+
const shouldHighlight =
|
|
61
|
+
changeGroupIdRef.current === requestedChangeGroupId && !suppressNextHighlightRef.current;
|
|
62
|
+
applyText(res.text, shouldHighlight);
|
|
63
|
+
suppressNextHighlightRef.current = false;
|
|
43
64
|
})
|
|
44
65
|
.catch((err) => {
|
|
45
66
|
console.error('Failed to load text', err);
|
|
46
|
-
setFullText(undefined);
|
|
47
|
-
setDisplayText(undefined);
|
|
48
|
-
setIsCropped(false);
|
|
49
67
|
})
|
|
50
68
|
.finally(() => {
|
|
51
|
-
setIsLoading(false);
|
|
69
|
+
if (objectIdRef.current === requestedObjectId) setIsLoading(false);
|
|
52
70
|
});
|
|
53
|
-
}, [objectId, store]);
|
|
71
|
+
}, [applyText, changeGroupId, objectId, store]);
|
|
54
72
|
|
|
55
73
|
// Reset state when objectId changes
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
useLayoutEffect(() => {
|
|
75
|
+
const objectChanged = objectIdRef.current !== objectId;
|
|
76
|
+
const changeGroupChanged = changeGroupIdRef.current !== changeGroupId;
|
|
77
|
+
objectIdRef.current = objectId;
|
|
78
|
+
changeGroupIdRef.current = changeGroupId;
|
|
79
|
+
if (changeGroupChanged) suppressNextHighlightRef.current = true;
|
|
80
|
+
|
|
81
|
+
// Keep the previous revision mounted until the next revision's text is ready.
|
|
82
|
+
if (initialText !== undefined) {
|
|
83
|
+
applyText(initialText, !changeGroupChanged);
|
|
84
|
+
suppressNextHighlightRef.current = false;
|
|
66
85
|
}
|
|
67
86
|
|
|
68
87
|
// Load text if requested
|
|
69
|
-
if (loadOnMount &&
|
|
88
|
+
if (loadOnMount && initialText === undefined && (objectChanged || fullTextRef.current === undefined)) {
|
|
70
89
|
loadText();
|
|
71
90
|
}
|
|
72
|
-
}, [initialText, loadOnMount, loadText]);
|
|
91
|
+
}, [applyText, changeGroupId, initialText, loadOnMount, loadText, objectId]);
|
|
73
92
|
|
|
74
93
|
return {
|
|
75
94
|
fullText,
|
|
76
95
|
displayText,
|
|
77
96
|
isLoading,
|
|
78
97
|
isCropped,
|
|
98
|
+
changeHighlight,
|
|
79
99
|
loadText,
|
|
80
100
|
};
|
|
81
101
|
}
|
|
@@ -89,7 +109,6 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
89
109
|
const [state, setState] = useState<{
|
|
90
110
|
progress?: DocAnalyzerProgress;
|
|
91
111
|
status?: WorkflowExecutionStatus;
|
|
92
|
-
outputFormat?: DocProcessorOutputFormat;
|
|
93
112
|
isComplete: boolean;
|
|
94
113
|
}>({ isComplete: false });
|
|
95
114
|
|
|
@@ -102,7 +121,6 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
102
121
|
const updateStateIfChanged = (
|
|
103
122
|
nextProgress: DocAnalyzerProgress | undefined,
|
|
104
123
|
nextStatus: WorkflowExecutionStatus | undefined,
|
|
105
|
-
nextOutputFormat: DocProcessorOutputFormat | undefined,
|
|
106
124
|
nextIsComplete: boolean,
|
|
107
125
|
) => {
|
|
108
126
|
setState((prev) => {
|
|
@@ -111,7 +129,6 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
111
129
|
|
|
112
130
|
if (
|
|
113
131
|
prev.status === nextStatus &&
|
|
114
|
-
prev.outputFormat === nextOutputFormat &&
|
|
115
132
|
prev.isComplete === nextIsComplete &&
|
|
116
133
|
prevProgress === nextProgressSignature
|
|
117
134
|
) {
|
|
@@ -121,7 +138,6 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
121
138
|
return {
|
|
122
139
|
progress: nextProgress,
|
|
123
140
|
status: nextStatus,
|
|
124
|
-
outputFormat: nextOutputFormat,
|
|
125
141
|
isComplete: nextIsComplete,
|
|
126
142
|
};
|
|
127
143
|
});
|
|
@@ -134,17 +150,15 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
134
150
|
.analyze(objectId)
|
|
135
151
|
.getStatus()
|
|
136
152
|
.then((r) => {
|
|
137
|
-
const nextOutputFormat = r.output_format ?? r.progress?.output_format;
|
|
138
|
-
|
|
139
153
|
if (r.status === WorkflowExecutionStatus.RUNNING) {
|
|
140
|
-
updateStateIfChanged(r.progress, r.status,
|
|
154
|
+
updateStateIfChanged(r.progress, r.status, false);
|
|
141
155
|
// Workflow is running, poll every 2 seconds for progress
|
|
142
156
|
if (!interrupted) {
|
|
143
157
|
timeoutId = setTimeout(poll, 2000);
|
|
144
158
|
}
|
|
145
159
|
} else {
|
|
146
160
|
// Workflow completed or terminal state
|
|
147
|
-
updateStateIfChanged(r.progress, r.status,
|
|
161
|
+
updateStateIfChanged(r.progress, r.status, true);
|
|
148
162
|
}
|
|
149
163
|
})
|
|
150
164
|
.catch(() => {
|
|
@@ -167,7 +181,6 @@ export function usePdfProcessingStatus(objectId: string, shouldPoll: boolean) {
|
|
|
167
181
|
return {
|
|
168
182
|
progress: state.progress,
|
|
169
183
|
status: state.status,
|
|
170
|
-
outputFormat: state.outputFormat,
|
|
171
184
|
isComplete: state.isComplete,
|
|
172
185
|
};
|
|
173
186
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ContentObject } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { getContentObjectDownloadName } from './useDownloadFile.js';
|
|
4
|
+
|
|
5
|
+
describe('getContentObjectDownloadName', () => {
|
|
6
|
+
it('preserves the original source extension instead of an extensionless display name', () => {
|
|
7
|
+
const object = {
|
|
8
|
+
name: 'Quarterly Report',
|
|
9
|
+
content: { name: 'quarterly-report.md', type: 'text/markdown' },
|
|
10
|
+
} as ContentObject;
|
|
11
|
+
|
|
12
|
+
expect(getContentObjectDownloadName(object)).toBe('quarterly-report.md');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('falls back to the object name when the content has no source name', () => {
|
|
16
|
+
const object = { name: 'Quarterly Report' } as ContentObject;
|
|
17
|
+
|
|
18
|
+
expect(getContentObjectDownloadName(object)).toBe('Quarterly Report');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VertesiaClient, ZenoClient } from '@vertesia/client';
|
|
2
|
-
import type { MarkdownRenditionFormat, RenderMarkdownPayload } from '@vertesia/common';
|
|
2
|
+
import type { ContentObject, MarkdownRenditionFormat, RenderMarkdownPayload } from '@vertesia/common';
|
|
3
3
|
import type { ToastFn } from '@vertesia/ui/core';
|
|
4
4
|
import { i18nInstance, NAMESPACE } from '@vertesia/ui/i18n';
|
|
5
5
|
import { useCallback, useState } from 'react';
|
|
@@ -37,6 +37,10 @@ export interface UseDownloadFileResult {
|
|
|
37
37
|
isDownloading: boolean;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
export function getContentObjectDownloadName(object: Pick<ContentObject, 'name' | 'content'>): string | undefined {
|
|
41
|
+
return object.content?.name || object.name;
|
|
42
|
+
}
|
|
43
|
+
|
|
40
44
|
/**
|
|
41
45
|
* Hook for downloading files from various sources.
|
|
42
46
|
* Handles GCS URIs (via client.files API), direct URLs, and markdown rendering.
|
|
@@ -156,7 +156,6 @@ const renderers: Record<
|
|
|
156
156
|
<td key={index} className="flex justify-start items-center gap-2 group/field">
|
|
157
157
|
<Button
|
|
158
158
|
variant="ghost"
|
|
159
|
-
aria-label="Preview Object"
|
|
160
159
|
title="Preview Object"
|
|
161
160
|
onClick={(e) => {
|
|
162
161
|
e.stopPropagation();
|
|
@@ -213,7 +212,7 @@ const renderers: Record<
|
|
|
213
212
|
{displayValue}
|
|
214
213
|
<Button
|
|
215
214
|
variant="ghost"
|
|
216
|
-
|
|
215
|
+
title="Preview Object"
|
|
217
216
|
onClick={(e) => {
|
|
218
217
|
e.stopPropagation();
|
|
219
218
|
onClick?.(objectId);
|
|
@@ -71,7 +71,7 @@ function StartWorkflowModal({ objectIds, onClose }: StartWorkflowModalProps) {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
return (
|
|
74
|
-
<Modal isOpen onClose={onClose}>
|
|
74
|
+
<Modal isOpen onClose={onClose} size="lg">
|
|
75
75
|
<ModalTitle>{t('store.actions.startWorkflowByRule')}</ModalTitle>
|
|
76
76
|
<ModalBody>
|
|
77
77
|
<div className="pb-2">{t('store.actions.chooseWorkflowRule')}</div>
|
|
@@ -82,7 +82,7 @@ function StartWorkflowModal({ objectIds, onClose }: StartWorkflowModalProps) {
|
|
|
82
82
|
) : (
|
|
83
83
|
<div className="max-h-[420px] overflow-y-auto border-border border rounded-md">
|
|
84
84
|
<SelectList
|
|
85
|
-
className="text-start"
|
|
85
|
+
className="text-start w-full"
|
|
86
86
|
options={rules ?? []}
|
|
87
87
|
value={selected}
|
|
88
88
|
onChange={setSelected}
|
|
@@ -81,20 +81,18 @@ export function ContentObjectTypesTable({
|
|
|
81
81
|
<span className="truncate">{obj.name}</span>
|
|
82
82
|
<CopyButton content={obj.id} className={ACTION_BTN_CLASS} />
|
|
83
83
|
{onFilter && (
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</Button>
|
|
97
|
-
</VTooltip>
|
|
84
|
+
<Button
|
|
85
|
+
variant="ghost"
|
|
86
|
+
size="sm"
|
|
87
|
+
title={`Filter by ${obj.name}`}
|
|
88
|
+
className={ACTION_BTN_CLASS}
|
|
89
|
+
onClick={(e) => {
|
|
90
|
+
e.stopPropagation();
|
|
91
|
+
onFilter('name', obj.name);
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<Filter className="size-3" />
|
|
95
|
+
</Button>
|
|
98
96
|
)}
|
|
99
97
|
</div>
|
|
100
98
|
</td>
|