@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
|
@@ -10,6 +10,8 @@ export interface MarkdownRendererProps {
|
|
|
10
10
|
* Optional workflow run id used to resolve shorthand artifact paths (e.g. artifact:out/result.csv)
|
|
11
11
|
*/
|
|
12
12
|
artifactRunId?: string;
|
|
13
|
+
/** Open Markdown artifact links in a host-provided viewer instead of downloading them. */
|
|
14
|
+
onArtifactOpen?: (path: string) => void;
|
|
13
15
|
/** Additional className for the markdown wrapper */
|
|
14
16
|
className?: string;
|
|
15
17
|
/** Additional className for code blocks */
|
|
@@ -24,7 +26,12 @@ export interface MarkdownRendererProps {
|
|
|
24
26
|
onProposalSelect?: (optionId: string) => void;
|
|
25
27
|
/** Callback when user submits free-form response to proposal */
|
|
26
28
|
onProposalSubmit?: (response: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Keep parser source positions aligned with `children` by skipping source-changing
|
|
31
|
+
* normalization. Editing surfaces use this when node offsets are part of an anchor.
|
|
32
|
+
*/
|
|
33
|
+
preserveSourcePositions?: boolean;
|
|
27
34
|
}
|
|
28
|
-
export declare function MarkdownRenderer({ children, components, remarkPlugins, removeComments, artifactRunId, className, codeClassName, inlineCodeClassName, linkClassName, imageClassName, onProposalSelect, onProposalSubmit, }: MarkdownRendererProps): React.JSX.Element;
|
|
35
|
+
export declare function MarkdownRenderer({ children, components, remarkPlugins, removeComments, artifactRunId, onArtifactOpen, className, codeClassName, inlineCodeClassName, linkClassName, imageClassName, onProposalSelect, onProposalSubmit, preserveSourcePositions, }: MarkdownRendererProps): React.JSX.Element;
|
|
29
36
|
export {};
|
|
30
37
|
//# sourceMappingURL=MarkdownRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/widgets/markdown/MarkdownRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,EAAE,EAAE,KAAK,UAAU,EAAuB,MAAM,gBAAgB,CAAC;AAuBhF,KAAK,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../../src/widgets/markdown/MarkdownRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,EAAE,EAAE,KAAK,UAAU,EAAuB,MAAM,gBAAgB,CAAC;AAuBhF,KAAK,gBAAgB,GAAG,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;AA+C5F,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C;;;OAGG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACrC;AAKD,wBAAgB,gBAAgB,CAAC,EAC7B,QAAQ,EACR,UAAU,EACV,aAAkB,EAClB,cAAqB,EACrB,aAAa,EACb,cAAc,EACd,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,uBAA+B,GAClC,EAAE,qBAAqB,qBAkNvB"}
|
|
@@ -20,7 +20,20 @@ import { normalizeDirectives } from './normalizeDirectives';
|
|
|
20
20
|
import { preprocessMathDelimiters } from './preprocessMathDelimiters';
|
|
21
21
|
import { remarkDirectiveHandler } from './remarkDirectiveHandler';
|
|
22
22
|
// Custom URL schemes that we handle in our components
|
|
23
|
-
const ALLOWED_CUSTOM_SCHEMES = [
|
|
23
|
+
const ALLOWED_CUSTOM_SCHEMES = [
|
|
24
|
+
'artifact:',
|
|
25
|
+
'image:',
|
|
26
|
+
'store:',
|
|
27
|
+
'document:',
|
|
28
|
+
'document://',
|
|
29
|
+
'collection:',
|
|
30
|
+
'interaction:',
|
|
31
|
+
'prompt:',
|
|
32
|
+
'agent:',
|
|
33
|
+
'workflow:',
|
|
34
|
+
'process:',
|
|
35
|
+
'run:',
|
|
36
|
+
];
|
|
24
37
|
/**
|
|
25
38
|
* Custom URL transform that allows our custom schemes while using
|
|
26
39
|
* the default transform for standard URLs (which sanitizes unsafe schemes).
|
|
@@ -50,9 +63,11 @@ function remarkRemoveComments() {
|
|
|
50
63
|
}
|
|
51
64
|
// Create default handlers once, outside component
|
|
52
65
|
const defaultCodeBlockHandlers = createDefaultCodeBlockHandlers();
|
|
53
|
-
export function MarkdownRenderer({ children, components, remarkPlugins = [], removeComments = true, artifactRunId, className, codeClassName, inlineCodeClassName, linkClassName, imageClassName, onProposalSelect, onProposalSubmit, }) {
|
|
66
|
+
export function MarkdownRenderer({ children, components, remarkPlugins = [], removeComments = true, artifactRunId, onArtifactOpen, className, codeClassName, inlineCodeClassName, linkClassName, imageClassName, onProposalSelect, onProposalSubmit, preserveSourcePositions = false, }) {
|
|
54
67
|
const codeBlockRegistry = useCodeBlockRendererRegistry();
|
|
55
|
-
const normalizedMarkdown = React.useMemo(() =>
|
|
68
|
+
const normalizedMarkdown = React.useMemo(() => preserveSourcePositions
|
|
69
|
+
? children
|
|
70
|
+
: normalizeDirectives(normalizeCustomSchemeLinks(preprocessMathDelimiters(children))), [children, preserveSourcePositions]);
|
|
56
71
|
// Remark plugins (markdown parsing)
|
|
57
72
|
// Order matters: GFM first, then directive (must precede handler),
|
|
58
73
|
// then definition-list/supersub, then math, then user plugins.
|
|
@@ -124,7 +139,7 @@ export function MarkdownRenderer({ children, components, remarkPlugins = [], rem
|
|
|
124
139
|
};
|
|
125
140
|
const LinkComponent = (props) => {
|
|
126
141
|
const { node, href, children: linkChildren, ...rest } = props;
|
|
127
|
-
return (_jsx(MarkdownLink, { node: node, href: href, className: linkClassName, artifactRunId: artifactRunId, ExistingLink: typeof ExistingLink === 'function'
|
|
142
|
+
return (_jsx(MarkdownLink, { node: node, href: href, className: linkClassName, artifactRunId: artifactRunId, onArtifactOpen: onArtifactOpen, ExistingLink: typeof ExistingLink === 'function'
|
|
128
143
|
? ExistingLink
|
|
129
144
|
: undefined, ...rest, children: linkChildren }));
|
|
130
145
|
};
|
|
@@ -147,6 +162,7 @@ export function MarkdownRenderer({ children, components, remarkPlugins = [], rem
|
|
|
147
162
|
}, [
|
|
148
163
|
components,
|
|
149
164
|
artifactRunId,
|
|
165
|
+
onArtifactOpen,
|
|
150
166
|
codeBlockRegistry,
|
|
151
167
|
codeClassName,
|
|
152
168
|
inlineCodeClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.js","sourceRoot":"","sources":["../../../src/widgets/markdown/MarkdownRenderer.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,EAAE,EAAmB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnF,OAAO,eAAe,MAAM,kBAAkB,CAAC;AAC/C,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,wBAAwB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cAAc;SACtB,CAAC;IACN,CAAC,EAAE;QACC,UAAU;QACV,aAAa;QACb,cAAc;QACd,iBAAiB;QACjB,aAAa;QACb,mBAAmB;QACnB,aAAa;QACb,cAAc;KACjB,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,CACpB,KAAC,wBAAwB,IACrB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,YAElC,KAAC,QAAQ,IACL,aAAa,EAAE,kBAAkB,EACjC,aAAa,EAAE,kBAAkB,EACjC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,uBAAuB,EACnC,YAAY,EAAE,kBAAkB,YAE/B,kBAAkB,GACZ,GACY,CAC9B,CAAC;IAEF,IAAI,SAAS,EAAE,CAAC;QACZ,OAAO,cAAK,SAAS,EAAE,cAAc,SAAS,EAAE,YAAG,eAAe,GAAO,CAAC;IAC9E,CAAC;IAED,OAAO,cAAK,SAAS,EAAC,YAAY,YAAE,eAAe,GAAO,CAAC;AAC/D,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
export { type AgentResourceLinkReference, type AgentResourceResolver, AgentResourceResolverProvider, type AgentResourceTarget, parseAgentResourceHref, type ResourceResolveContext, useAgentResourceResolver, } from './AgentResourceResolver';
|
|
1
2
|
export { ArtifactContentRenderer, type ArtifactContentRendererProps, type ExpandRenderType, } from './ArtifactContentRenderer';
|
|
3
|
+
export { ArtifactEditingSurface, type ArtifactEditingSurfaceDocumentEdit, type ArtifactEditingSurfaceProps, type ArtifactSaveStatus, applyArtifactRefreshChanges, isArtifactRefreshEvent, } from './ArtifactEditingSurface';
|
|
2
4
|
export { type CodeBlockHandlerContext, CodeBlockHandlerProvider, useCodeBlockContext, } from './CodeBlockContext';
|
|
3
5
|
export { CodeBlockErrorBoundary, CodeBlockPlaceholder, type CodeBlockPlaceholderProps, type CodeBlockType, } from './CodeBlockPlaceholder';
|
|
4
6
|
export { type CodeBlockRendererProps, CodeBlockRendererProvider, useCodeBlockComponent, useCodeBlockRendererRegistry, } from './CodeBlockRendering';
|
|
7
|
+
export { applyMarkdownEditingChange, CollaborativeMarkdownRenderer, type CollaborativeMarkdownRendererProps, createMarkdownBlockAnchor, formatMarkdownEditingAction, type MarkdownBlockAnchor, type MarkdownBlockType, type MarkdownEditingAction, type MarkdownEditingResource, } from './CollaborativeMarkdownRenderer';
|
|
5
8
|
export { ChartCodeBlockHandler, createDefaultCodeBlockHandlers, ExpandCodeBlockHandler, isExpandLanguage, isIncompleteJson, MermaidCodeBlockHandler, } from './codeBlockHandlers';
|
|
6
9
|
export { MarkdownFigure, type MarkdownFigureProps } from './MarkdownFigure';
|
|
7
10
|
export { MarkdownImage, type MarkdownImageProps } from './MarkdownImage';
|
|
8
11
|
export { MarkdownLink, type MarkdownLinkProps } from './MarkdownLink';
|
|
9
12
|
export { MarkdownRenderer, type MarkdownRendererProps } from './MarkdownRenderer';
|
|
10
13
|
export { MermaidDiagram } from './MermaidDiagram';
|
|
14
|
+
export { createUnifiedLineDiff, diffTextSegments, diffWordSegments, getTextLineChangeRegions, rebaseTextChanges, type TextDiffSegment, type TextLineChangeRegion, type TextRebaseResult, type UnifiedLineDiffOptions, } from './textDiff';
|
|
11
15
|
export { type ArtifactContentState, type UseArtifactContentOptions, useArtifactContent, } from './useArtifactContent';
|
|
12
|
-
export {
|
|
16
|
+
export { parseUrlScheme, type ResolvedUrlState, type UrlScheme, type UseResolvedUrlOptions, useResolvedUrl, } from './useResolvedUrl';
|
|
13
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/widgets/markdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,gBAAgB,GACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,KAAK,uB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sBAAsB,GAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,kBAAkB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,cAAc,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
export { AgentResourceResolverProvider, parseAgentResourceHref, useAgentResourceResolver, } from './AgentResourceResolver';
|
|
1
2
|
export { ArtifactContentRenderer, } from './ArtifactContentRenderer';
|
|
3
|
+
export { ArtifactEditingSurface, applyArtifactRefreshChanges, isArtifactRefreshEvent, } from './ArtifactEditingSurface';
|
|
2
4
|
export { CodeBlockHandlerProvider, useCodeBlockContext, } from './CodeBlockContext';
|
|
3
5
|
export { CodeBlockErrorBoundary, CodeBlockPlaceholder, } from './CodeBlockPlaceholder';
|
|
4
6
|
export { CodeBlockRendererProvider, useCodeBlockComponent, useCodeBlockRendererRegistry, } from './CodeBlockRendering';
|
|
7
|
+
export { applyMarkdownEditingChange, CollaborativeMarkdownRenderer, createMarkdownBlockAnchor, formatMarkdownEditingAction, } from './CollaborativeMarkdownRenderer';
|
|
5
8
|
export { ChartCodeBlockHandler, createDefaultCodeBlockHandlers, ExpandCodeBlockHandler, isExpandLanguage, isIncompleteJson, MermaidCodeBlockHandler, } from './codeBlockHandlers';
|
|
6
9
|
export { MarkdownFigure } from './MarkdownFigure';
|
|
7
10
|
export { MarkdownImage } from './MarkdownImage';
|
|
8
11
|
export { MarkdownLink } from './MarkdownLink';
|
|
9
12
|
export { MarkdownRenderer } from './MarkdownRenderer';
|
|
10
13
|
export { MermaidDiagram } from './MermaidDiagram';
|
|
14
|
+
export { createUnifiedLineDiff, diffTextSegments, diffWordSegments, getTextLineChangeRegions, rebaseTextChanges, } from './textDiff';
|
|
11
15
|
export { useArtifactContent, } from './useArtifactContent';
|
|
12
|
-
export {
|
|
16
|
+
export { parseUrlScheme, useResolvedUrl, } from './useResolvedUrl';
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/markdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEH,wBAAwB,EACxB,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,sBAAsB,EACtB,oBAAoB,GAGvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEH,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAA4B,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAGH,kBAAkB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/widgets/markdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,6BAA6B,EAE7B,sBAAsB,EAEtB,wBAAwB,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,uBAAuB,GAG1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,sBAAsB,EAItB,2BAA2B,EAC3B,sBAAsB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEH,wBAAwB,EACxB,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,sBAAsB,EACtB,oBAAoB,GAGvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEH,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,EAE7B,yBAAyB,EACzB,2BAA2B,GAK9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,qBAAqB,EACrB,8BAA8B,EAC9B,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAA4B,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAA2B,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,YAAY,EAA0B,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAA8B,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,GAKpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAGH,kBAAkB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,cAAc,EAId,cAAc,GACjB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeCustomSchemeLinks.d.ts","sourceRoot":"","sources":["../../../src/widgets/markdown/normalizeCustomSchemeLinks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizeCustomSchemeLinks.d.ts","sourceRoot":"","sources":["../../../src/widgets/markdown/normalizeCustomSchemeLinks.ts"],"names":[],"mappings":"AAyEA;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgBnE"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
const CUSTOM_SCHEME_PREFIXES = [
|
|
1
|
+
const CUSTOM_SCHEME_PREFIXES = [
|
|
2
|
+
'artifact:',
|
|
3
|
+
'image:',
|
|
4
|
+
'store:',
|
|
5
|
+
'document://',
|
|
6
|
+
'collection:',
|
|
7
|
+
'interaction:',
|
|
8
|
+
'prompt:',
|
|
9
|
+
'agent:',
|
|
10
|
+
'workflow:',
|
|
11
|
+
'process:',
|
|
12
|
+
'run:',
|
|
13
|
+
];
|
|
2
14
|
// Excludes `[` from the link-text and destination classes: a long run of `[` (or
|
|
3
15
|
// `[](image:` groups) with no closing delimiter would otherwise be re-scanned at every
|
|
4
16
|
// start position, giving polynomial backtracking (CodeQL js/polynomial-redos).
|
|
5
|
-
const CUSTOM_LINK_REGEX = /(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:)[^)[\n]+)(\))/g;
|
|
17
|
+
const CUSTOM_LINK_REGEX = /(!?\[[^[\]\n]*\]\()((?:artifact:|image:|store:|document:\/\/|collection:|interaction:|prompt:|agent:|workflow:|process:|run:)[^)[\n]+)(\))/g;
|
|
6
18
|
const INLINE_CODE_REGEX = /`[^`\n]*`/g;
|
|
7
19
|
const FENCED_CODE_BLOCK_REGEX = /(^|\n)(`{3,}|~{3,})[^\n]*\n[\s\S]*?\n\2(?=\n|$)/g;
|
|
8
20
|
const LINK_TITLE_SUFFIX_REGEX = /\s+("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\([^)]*\))\s*$/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizeCustomSchemeLinks.js","sourceRoot":"","sources":["../../../src/widgets/markdown/normalizeCustomSchemeLinks.ts"],"names":[],"mappings":"AAAA,MAAM,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"normalizeCustomSchemeLinks.js","sourceRoot":"","s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ClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAgB;IACvD,IAAI,CAAC,QAAQ,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnF,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;QAC7D,MAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7E,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC9C,CAAC;IAED,MAAM,IAAI,0BAA0B,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface TextDiffSegment {
|
|
2
|
+
type: 'equal' | 'added' | 'removed';
|
|
3
|
+
text: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Word-level diff of two texts, returned as ordered segments suitable for
|
|
7
|
+
* rendering a unified inline diff. Whitespace is kept in the segments so the
|
|
8
|
+
* concatenation of `equal` + `removed` segments equals `before`, and
|
|
9
|
+
* `equal` + `added` segments equals `after`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function diffWordSegments(before: string, after: string): TextDiffSegment[];
|
|
12
|
+
/**
|
|
13
|
+
* Document-scale text diff. Exact lines are aligned first, then word-level
|
|
14
|
+
* highlighting is applied only inside each changed line hunk. This avoids the
|
|
15
|
+
* word diff's bounded-LCS fallback turning a large document middle into one
|
|
16
|
+
* wholesale removal and addition.
|
|
17
|
+
*/
|
|
18
|
+
export declare function diffTextSegments(before: string, after: string): TextDiffSegment[];
|
|
19
|
+
export interface TextLineChangeRegion {
|
|
20
|
+
/** Zero-based line in the current document where the change starts. */
|
|
21
|
+
startLine: number;
|
|
22
|
+
/** Inclusive zero-based line in the current document where the change ends. */
|
|
23
|
+
endLine: number;
|
|
24
|
+
}
|
|
25
|
+
/** Returns distinct current-document line hunks for a change minimap. */
|
|
26
|
+
export declare function getTextLineChangeRegions(before: string, after: string): TextLineChangeRegion[];
|
|
27
|
+
export type TextRebaseResult = {
|
|
28
|
+
status: 'rebased';
|
|
29
|
+
content: string;
|
|
30
|
+
} | {
|
|
31
|
+
status: 'conflict';
|
|
32
|
+
content: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Conservatively reapplies local line edits onto a concurrently changed document.
|
|
36
|
+
* Identical edits are deduplicated. Any overlapping base ranges return a conflict
|
|
37
|
+
* and preserve `local` unchanged for recovery by the caller.
|
|
38
|
+
*/
|
|
39
|
+
export declare function rebaseTextChanges(base: string, local: string, remote: string): TextRebaseResult;
|
|
40
|
+
export interface UnifiedLineDiffOptions {
|
|
41
|
+
/** Unchanged lines shown around each change (default 2). */
|
|
42
|
+
context?: number;
|
|
43
|
+
/** When set, returns undefined if the formatted diff would exceed this length. */
|
|
44
|
+
maxChars?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Line-level unified diff (`@@ -a,b +c,d @@` hunks with `-`/`+`/space prefixes)
|
|
48
|
+
* of two texts. Returns undefined when the texts are identical, or when the
|
|
49
|
+
* formatted diff exceeds `maxChars` — callers fall back to a non-diff summary.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createUnifiedLineDiff(before: string, after: string, options?: UnifiedLineDiffOptions): string | undefined;
|
|
52
|
+
//# sourceMappingURL=textDiff.d.ts.map
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GAAE,sBAA2B,GACrC,MAAM,GAAG,SAAS,CAyDpB"}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
// Above this token count the LCS table gets expensive; fall back to a whole-text replace.
|
|
2
|
+
const MAX_LCS_TOKENS = 600;
|
|
3
|
+
function tokenize(text) {
|
|
4
|
+
return text.split(/(\s+)/).filter((token) => token.length > 0);
|
|
5
|
+
}
|
|
6
|
+
function pushSegment(segments, type, text) {
|
|
7
|
+
if (!text)
|
|
8
|
+
return;
|
|
9
|
+
const last = segments[segments.length - 1];
|
|
10
|
+
if (last && last.type === type) {
|
|
11
|
+
last.text += text;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
segments.push({ type, text });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function lcsSegments(before, after, segments) {
|
|
18
|
+
// lengths[i][j] = LCS length of before[i..] and after[j..]
|
|
19
|
+
const rows = before.length + 1;
|
|
20
|
+
const cols = after.length + 1;
|
|
21
|
+
const lengths = new Uint32Array(rows * cols);
|
|
22
|
+
for (let i = before.length - 1; i >= 0; i--) {
|
|
23
|
+
for (let j = after.length - 1; j >= 0; j--) {
|
|
24
|
+
lengths[i * cols + j] =
|
|
25
|
+
before[i] === after[j]
|
|
26
|
+
? lengths[(i + 1) * cols + j + 1] + 1
|
|
27
|
+
: Math.max(lengths[(i + 1) * cols + j], lengths[i * cols + j + 1]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
let i = 0;
|
|
31
|
+
let j = 0;
|
|
32
|
+
while (i < before.length && j < after.length) {
|
|
33
|
+
if (before[i] === after[j]) {
|
|
34
|
+
pushSegment(segments, 'equal', before[i]);
|
|
35
|
+
i++;
|
|
36
|
+
j++;
|
|
37
|
+
}
|
|
38
|
+
else if (lengths[(i + 1) * cols + j] >= lengths[i * cols + j + 1]) {
|
|
39
|
+
pushSegment(segments, 'removed', before[i]);
|
|
40
|
+
i++;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
pushSegment(segments, 'added', after[j]);
|
|
44
|
+
j++;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
pushSegment(segments, 'removed', before.slice(i).join(''));
|
|
48
|
+
pushSegment(segments, 'added', after.slice(j).join(''));
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Word-level diff of two texts, returned as ordered segments suitable for
|
|
52
|
+
* rendering a unified inline diff. Whitespace is kept in the segments so the
|
|
53
|
+
* concatenation of `equal` + `removed` segments equals `before`, and
|
|
54
|
+
* `equal` + `added` segments equals `after`.
|
|
55
|
+
*/
|
|
56
|
+
export function diffWordSegments(before, after) {
|
|
57
|
+
if (before === after) {
|
|
58
|
+
return before ? [{ type: 'equal', text: before }] : [];
|
|
59
|
+
}
|
|
60
|
+
const beforeTokens = tokenize(before);
|
|
61
|
+
const afterTokens = tokenize(after);
|
|
62
|
+
// Trim the common prefix and suffix so the quadratic LCS only runs on the changed middle.
|
|
63
|
+
let start = 0;
|
|
64
|
+
while (start < beforeTokens.length && start < afterTokens.length && beforeTokens[start] === afterTokens[start]) {
|
|
65
|
+
start++;
|
|
66
|
+
}
|
|
67
|
+
let beforeEnd = beforeTokens.length;
|
|
68
|
+
let afterEnd = afterTokens.length;
|
|
69
|
+
while (beforeEnd > start && afterEnd > start && beforeTokens[beforeEnd - 1] === afterTokens[afterEnd - 1]) {
|
|
70
|
+
beforeEnd--;
|
|
71
|
+
afterEnd--;
|
|
72
|
+
}
|
|
73
|
+
const segments = [];
|
|
74
|
+
pushSegment(segments, 'equal', beforeTokens.slice(0, start).join(''));
|
|
75
|
+
const beforeMiddle = beforeTokens.slice(start, beforeEnd);
|
|
76
|
+
const afterMiddle = afterTokens.slice(start, afterEnd);
|
|
77
|
+
if (beforeMiddle.length * afterMiddle.length > MAX_LCS_TOKENS * MAX_LCS_TOKENS) {
|
|
78
|
+
pushSegment(segments, 'removed', beforeMiddle.join(''));
|
|
79
|
+
pushSegment(segments, 'added', afterMiddle.join(''));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
lcsSegments(beforeMiddle, afterMiddle, segments);
|
|
83
|
+
}
|
|
84
|
+
pushSegment(segments, 'equal', beforeTokens.slice(beforeEnd).join(''));
|
|
85
|
+
return segments;
|
|
86
|
+
}
|
|
87
|
+
function lcsLineOps(before, after) {
|
|
88
|
+
const ops = [];
|
|
89
|
+
let start = 0;
|
|
90
|
+
while (start < before.length && start < after.length && before[start] === after[start]) {
|
|
91
|
+
ops.push({ type: 'equal', line: before[start] });
|
|
92
|
+
start++;
|
|
93
|
+
}
|
|
94
|
+
let beforeEnd = before.length;
|
|
95
|
+
let afterEnd = after.length;
|
|
96
|
+
const tail = [];
|
|
97
|
+
while (beforeEnd > start && afterEnd > start && before[beforeEnd - 1] === after[afterEnd - 1]) {
|
|
98
|
+
beforeEnd--;
|
|
99
|
+
afterEnd--;
|
|
100
|
+
tail.unshift({ type: 'equal', line: before[beforeEnd] });
|
|
101
|
+
}
|
|
102
|
+
const beforeMiddle = before.slice(start, beforeEnd);
|
|
103
|
+
const afterMiddle = after.slice(start, afterEnd);
|
|
104
|
+
if (beforeMiddle.length * afterMiddle.length > MAX_LCS_TOKENS * MAX_LCS_TOKENS) {
|
|
105
|
+
for (const line of beforeMiddle)
|
|
106
|
+
ops.push({ type: 'removed', line });
|
|
107
|
+
for (const line of afterMiddle)
|
|
108
|
+
ops.push({ type: 'added', line });
|
|
109
|
+
return [...ops, ...tail];
|
|
110
|
+
}
|
|
111
|
+
const rows = beforeMiddle.length + 1;
|
|
112
|
+
const cols = afterMiddle.length + 1;
|
|
113
|
+
const lengths = new Uint32Array(rows * cols);
|
|
114
|
+
for (let i = beforeMiddle.length - 1; i >= 0; i--) {
|
|
115
|
+
for (let j = afterMiddle.length - 1; j >= 0; j--) {
|
|
116
|
+
lengths[i * cols + j] =
|
|
117
|
+
beforeMiddle[i] === afterMiddle[j]
|
|
118
|
+
? lengths[(i + 1) * cols + j + 1] + 1
|
|
119
|
+
: Math.max(lengths[(i + 1) * cols + j], lengths[i * cols + j + 1]);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
let i = 0;
|
|
123
|
+
let j = 0;
|
|
124
|
+
while (i < beforeMiddle.length && j < afterMiddle.length) {
|
|
125
|
+
if (beforeMiddle[i] === afterMiddle[j]) {
|
|
126
|
+
ops.push({ type: 'equal', line: beforeMiddle[i] });
|
|
127
|
+
i++;
|
|
128
|
+
j++;
|
|
129
|
+
}
|
|
130
|
+
else if (lengths[(i + 1) * cols + j] >= lengths[i * cols + j + 1]) {
|
|
131
|
+
ops.push({ type: 'removed', line: beforeMiddle[i] });
|
|
132
|
+
i++;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
ops.push({ type: 'added', line: afterMiddle[j] });
|
|
136
|
+
j++;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
while (i < beforeMiddle.length)
|
|
140
|
+
ops.push({ type: 'removed', line: beforeMiddle[i++] });
|
|
141
|
+
while (j < afterMiddle.length)
|
|
142
|
+
ops.push({ type: 'added', line: afterMiddle[j++] });
|
|
143
|
+
return [...ops, ...tail];
|
|
144
|
+
}
|
|
145
|
+
function splitLinesWithEndings(text) {
|
|
146
|
+
return text.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Document-scale text diff. Exact lines are aligned first, then word-level
|
|
150
|
+
* highlighting is applied only inside each changed line hunk. This avoids the
|
|
151
|
+
* word diff's bounded-LCS fallback turning a large document middle into one
|
|
152
|
+
* wholesale removal and addition.
|
|
153
|
+
*/
|
|
154
|
+
export function diffTextSegments(before, after) {
|
|
155
|
+
if (!before.includes('\n') && !after.includes('\n'))
|
|
156
|
+
return diffWordSegments(before, after);
|
|
157
|
+
if (before === after)
|
|
158
|
+
return before ? [{ type: 'equal', text: before }] : [];
|
|
159
|
+
const segments = [];
|
|
160
|
+
const ops = lcsLineOps(splitLinesWithEndings(before), splitLinesWithEndings(after));
|
|
161
|
+
let index = 0;
|
|
162
|
+
while (index < ops.length) {
|
|
163
|
+
const op = ops[index];
|
|
164
|
+
if (op.type === 'equal') {
|
|
165
|
+
pushSegment(segments, 'equal', op.line);
|
|
166
|
+
index++;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
let removed = '';
|
|
170
|
+
let added = '';
|
|
171
|
+
while (index < ops.length && ops[index].type !== 'equal') {
|
|
172
|
+
const changed = ops[index++];
|
|
173
|
+
if (changed.type === 'removed')
|
|
174
|
+
removed += changed.line;
|
|
175
|
+
if (changed.type === 'added')
|
|
176
|
+
added += changed.line;
|
|
177
|
+
}
|
|
178
|
+
for (const segment of diffWordSegments(removed, added)) {
|
|
179
|
+
pushSegment(segments, segment.type, segment.text);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return segments;
|
|
183
|
+
}
|
|
184
|
+
/** Returns distinct current-document line hunks for a change minimap. */
|
|
185
|
+
export function getTextLineChangeRegions(before, after) {
|
|
186
|
+
if (before === after)
|
|
187
|
+
return [];
|
|
188
|
+
const regions = [];
|
|
189
|
+
const ops = lcsLineOps(before.split('\n'), after.split('\n'));
|
|
190
|
+
let currentLine = 0;
|
|
191
|
+
let startLine;
|
|
192
|
+
const closeRegion = () => {
|
|
193
|
+
if (startLine === undefined)
|
|
194
|
+
return;
|
|
195
|
+
regions.push({ startLine, endLine: Math.max(startLine, currentLine - 1) });
|
|
196
|
+
startLine = undefined;
|
|
197
|
+
};
|
|
198
|
+
for (const op of ops) {
|
|
199
|
+
if (op.type === 'equal') {
|
|
200
|
+
closeRegion();
|
|
201
|
+
currentLine++;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
startLine ??= currentLine;
|
|
205
|
+
if (op.type === 'added')
|
|
206
|
+
currentLine++;
|
|
207
|
+
}
|
|
208
|
+
closeRegion();
|
|
209
|
+
return regions;
|
|
210
|
+
}
|
|
211
|
+
function lineChanges(base, changed) {
|
|
212
|
+
const changes = [];
|
|
213
|
+
const ops = lcsLineOps(base, changed);
|
|
214
|
+
let baseIndex = 0;
|
|
215
|
+
let index = 0;
|
|
216
|
+
while (index < ops.length) {
|
|
217
|
+
if (ops[index].type === 'equal') {
|
|
218
|
+
baseIndex++;
|
|
219
|
+
index++;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const start = baseIndex;
|
|
223
|
+
const replacement = [];
|
|
224
|
+
while (index < ops.length && ops[index].type !== 'equal') {
|
|
225
|
+
const op = ops[index++];
|
|
226
|
+
if (op.type === 'removed')
|
|
227
|
+
baseIndex++;
|
|
228
|
+
if (op.type === 'added')
|
|
229
|
+
replacement.push(op.line);
|
|
230
|
+
}
|
|
231
|
+
changes.push({ start, end: baseIndex, replacement });
|
|
232
|
+
}
|
|
233
|
+
return changes;
|
|
234
|
+
}
|
|
235
|
+
function sameLineChange(left, right) {
|
|
236
|
+
return (left.start === right.start &&
|
|
237
|
+
left.end === right.end &&
|
|
238
|
+
left.replacement.length === right.replacement.length &&
|
|
239
|
+
left.replacement.every((line, index) => line === right.replacement[index]));
|
|
240
|
+
}
|
|
241
|
+
function lineChangesOverlap(left, right) {
|
|
242
|
+
const leftInsertion = left.start === left.end;
|
|
243
|
+
const rightInsertion = right.start === right.end;
|
|
244
|
+
if (leftInsertion && rightInsertion)
|
|
245
|
+
return left.start === right.start;
|
|
246
|
+
if (leftInsertion)
|
|
247
|
+
return left.start >= right.start && left.start <= right.end;
|
|
248
|
+
if (rightInsertion)
|
|
249
|
+
return right.start >= left.start && right.start <= left.end;
|
|
250
|
+
return left.start < right.end && right.start < left.end;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Conservatively reapplies local line edits onto a concurrently changed document.
|
|
254
|
+
* Identical edits are deduplicated. Any overlapping base ranges return a conflict
|
|
255
|
+
* and preserve `local` unchanged for recovery by the caller.
|
|
256
|
+
*/
|
|
257
|
+
export function rebaseTextChanges(base, local, remote) {
|
|
258
|
+
if (local === remote)
|
|
259
|
+
return { status: 'rebased', content: local };
|
|
260
|
+
if (local === base)
|
|
261
|
+
return { status: 'rebased', content: remote };
|
|
262
|
+
if (remote === base)
|
|
263
|
+
return { status: 'rebased', content: local };
|
|
264
|
+
const baseLines = base.split('\n');
|
|
265
|
+
const localChanges = lineChanges(baseLines, local.split('\n'));
|
|
266
|
+
const remoteChanges = lineChanges(baseLines, remote.split('\n'));
|
|
267
|
+
const uniqueLocalChanges = [];
|
|
268
|
+
for (const localChange of localChanges) {
|
|
269
|
+
let duplicate = false;
|
|
270
|
+
for (const remoteChange of remoteChanges) {
|
|
271
|
+
if (sameLineChange(localChange, remoteChange)) {
|
|
272
|
+
duplicate = true;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
if (lineChangesOverlap(localChange, remoteChange)) {
|
|
276
|
+
return { status: 'conflict', content: local };
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (!duplicate)
|
|
280
|
+
uniqueLocalChanges.push(localChange);
|
|
281
|
+
}
|
|
282
|
+
const combined = [...remoteChanges, ...uniqueLocalChanges].sort((left, right) => left.start - right.start || left.end - right.end);
|
|
283
|
+
const merged = [];
|
|
284
|
+
let cursor = 0;
|
|
285
|
+
for (const change of combined) {
|
|
286
|
+
merged.push(...baseLines.slice(cursor, change.start), ...change.replacement);
|
|
287
|
+
cursor = change.end;
|
|
288
|
+
}
|
|
289
|
+
merged.push(...baseLines.slice(cursor));
|
|
290
|
+
return { status: 'rebased', content: merged.join('\n') };
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Line-level unified diff (`@@ -a,b +c,d @@` hunks with `-`/`+`/space prefixes)
|
|
294
|
+
* of two texts. Returns undefined when the texts are identical, or when the
|
|
295
|
+
* formatted diff exceeds `maxChars` — callers fall back to a non-diff summary.
|
|
296
|
+
*/
|
|
297
|
+
export function createUnifiedLineDiff(before, after, options = {}) {
|
|
298
|
+
if (before === after)
|
|
299
|
+
return undefined;
|
|
300
|
+
const context = options.context ?? 2;
|
|
301
|
+
const ops = lcsLineOps(before.split('\n'), after.split('\n'));
|
|
302
|
+
// Group changed ops into hunks, merging hunks whose context would overlap.
|
|
303
|
+
const changed = [];
|
|
304
|
+
for (let index = 0; index < ops.length; index++) {
|
|
305
|
+
if (ops[index].type === 'equal')
|
|
306
|
+
continue;
|
|
307
|
+
const previous = changed[changed.length - 1];
|
|
308
|
+
if (previous && index - previous.end <= context * 2) {
|
|
309
|
+
previous.end = index + 1;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
changed.push({ start: index, end: index + 1 });
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (changed.length === 0)
|
|
316
|
+
return undefined;
|
|
317
|
+
const lines = [];
|
|
318
|
+
let beforeLine = 1;
|
|
319
|
+
let afterLine = 1;
|
|
320
|
+
let cursor = 0;
|
|
321
|
+
for (const hunk of changed) {
|
|
322
|
+
const start = Math.max(hunk.start - context, cursor === 0 ? 0 : cursor);
|
|
323
|
+
for (; cursor < start; cursor++) {
|
|
324
|
+
if (ops[cursor].type !== 'added')
|
|
325
|
+
beforeLine++;
|
|
326
|
+
if (ops[cursor].type !== 'removed')
|
|
327
|
+
afterLine++;
|
|
328
|
+
}
|
|
329
|
+
const end = Math.min(hunk.end + context, ops.length);
|
|
330
|
+
let beforeCount = 0;
|
|
331
|
+
let afterCount = 0;
|
|
332
|
+
const body = [];
|
|
333
|
+
for (let index = start; index < end; index++) {
|
|
334
|
+
const op = ops[index];
|
|
335
|
+
if (op.type === 'equal') {
|
|
336
|
+
body.push(` ${op.line}`);
|
|
337
|
+
beforeCount++;
|
|
338
|
+
afterCount++;
|
|
339
|
+
}
|
|
340
|
+
else if (op.type === 'removed') {
|
|
341
|
+
body.push(`-${op.line}`);
|
|
342
|
+
beforeCount++;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
body.push(`+${op.line}`);
|
|
346
|
+
afterCount++;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
lines.push(`@@ -${beforeLine},${beforeCount} +${afterLine},${afterCount} @@`, ...body);
|
|
350
|
+
for (; cursor < end; cursor++) {
|
|
351
|
+
if (ops[cursor].type !== 'added')
|
|
352
|
+
beforeLine++;
|
|
353
|
+
if (ops[cursor].type !== 'removed')
|
|
354
|
+
afterLine++;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const formatted = lines.join('\n');
|
|
358
|
+
if (options.maxChars !== undefined && formatted.length > options.maxChars)
|
|
359
|
+
return undefined;
|
|
360
|
+
return formatted;
|
|
361
|
+
}
|
|
362
|
+
//# sourceMappingURL=textDiff.js.map
|