@codingame/monaco-vscode-katex-common 29.1.1 → 30.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +14 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +208 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +637 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +202 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +17 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +53 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +296 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +59 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +110 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +384 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +220 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +97 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +15 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +155 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +36 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +33 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +4 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +37 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +66 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +103 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +35 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +44 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +60 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +5 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +6 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -39
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +746 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +300 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1963 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +314 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +886 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +118 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +313 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +185 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +104 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +43 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +69 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +933 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +32 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +643 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +197 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1317
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +0 -95
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import * as notebookDiff from './notebookDiff.css';
|
|
5
|
+
import { $, append } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
|
+
import { createStyleSheet } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domStylesheets';
|
|
7
|
+
import { MouseController, isMonacoEditor } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/list/listWidget';
|
|
8
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
10
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
11
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
13
|
+
import { WorkbenchList } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService';
|
|
14
|
+
import { IListService } from '@codingame/monaco-vscode-api/vscode/vs/platform/list/browser/listService.service';
|
|
15
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
16
|
+
import { DIFF_CELL_MARGIN } from './notebookDiffEditorBrowser.js';
|
|
17
|
+
import { CollapsedCellOverlayWidget, CellDiffPlaceholderElement, UnchangedCellOverlayWidget, NotebookDocumentMetadataElement, InsertElement, DeletedElement, ModifiedElement, getOptimizedNestedCodeEditorWidgetOptions } from './diffComponents.js';
|
|
18
|
+
import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
19
|
+
import { DiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
|
|
20
|
+
import { MenuItemAction } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
21
|
+
import { IMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service';
|
|
22
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
23
|
+
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
24
|
+
import { CodiconActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
|
|
25
|
+
import { createBareFontInfoFromRawSettings } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/fontInfoFromSettings';
|
|
26
|
+
import { PixelRatio } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/pixelRatio';
|
|
27
|
+
import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
28
|
+
import { fixedDiffEditorOptions, fixedEditorOptions } from './diffCellEditorOptions.js';
|
|
29
|
+
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
30
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
31
|
+
import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
32
|
+
|
|
33
|
+
var CellDiffPlaceholderRenderer_1, NotebookDocumentMetadataDiffRenderer_1, CellDiffSingleSideRenderer_1, CellDiffSideBySideRenderer_1;
|
|
34
|
+
registerCss(notebookDiff);
|
|
35
|
+
let NotebookCellTextDiffListDelegate = class NotebookCellTextDiffListDelegate {
|
|
36
|
+
constructor(targetWindow, configurationService) {
|
|
37
|
+
this.configurationService = configurationService;
|
|
38
|
+
const editorOptions = this.configurationService.getValue("editor");
|
|
39
|
+
this.lineHeight = createBareFontInfoFromRawSettings(editorOptions, PixelRatio.getInstance(targetWindow).value).lineHeight;
|
|
40
|
+
}
|
|
41
|
+
getHeight(element) {
|
|
42
|
+
return element.getHeight(this.lineHeight);
|
|
43
|
+
}
|
|
44
|
+
hasDynamicHeight(element) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
getTemplateId(element) {
|
|
48
|
+
switch (element.type) {
|
|
49
|
+
case "delete":
|
|
50
|
+
case "insert":
|
|
51
|
+
return CellDiffSingleSideRenderer.TEMPLATE_ID;
|
|
52
|
+
case "modified":
|
|
53
|
+
case "unchanged":
|
|
54
|
+
return CellDiffSideBySideRenderer.TEMPLATE_ID;
|
|
55
|
+
case "placeholder":
|
|
56
|
+
return CellDiffPlaceholderRenderer.TEMPLATE_ID;
|
|
57
|
+
case "modifiedMetadata":
|
|
58
|
+
case "unchangedMetadata":
|
|
59
|
+
return NotebookDocumentMetadataDiffRenderer.TEMPLATE_ID;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
NotebookCellTextDiffListDelegate = ( __decorate([( __param(1, IConfigurationService))], NotebookCellTextDiffListDelegate));
|
|
64
|
+
let CellDiffPlaceholderRenderer = class CellDiffPlaceholderRenderer {
|
|
65
|
+
static {
|
|
66
|
+
CellDiffPlaceholderRenderer_1 = this;
|
|
67
|
+
}
|
|
68
|
+
static {
|
|
69
|
+
this.TEMPLATE_ID = "cell_diff_placeholder";
|
|
70
|
+
}
|
|
71
|
+
constructor(notebookEditor, instantiationService) {
|
|
72
|
+
this.notebookEditor = notebookEditor;
|
|
73
|
+
this.instantiationService = instantiationService;
|
|
74
|
+
}
|
|
75
|
+
get templateId() {
|
|
76
|
+
return CellDiffPlaceholderRenderer_1.TEMPLATE_ID;
|
|
77
|
+
}
|
|
78
|
+
renderTemplate(container) {
|
|
79
|
+
const body = $(".cell-placeholder-body");
|
|
80
|
+
append(container, body);
|
|
81
|
+
const elementDisposables = ( new DisposableStore());
|
|
82
|
+
const marginOverlay = ( new CollapsedCellOverlayWidget(body));
|
|
83
|
+
const contents = append(body, $(".contents"));
|
|
84
|
+
const placeholder = append(contents, $("span.text", {
|
|
85
|
+
title: ( localize(11239, "Double click to show"))
|
|
86
|
+
}));
|
|
87
|
+
return {
|
|
88
|
+
body,
|
|
89
|
+
container,
|
|
90
|
+
placeholder,
|
|
91
|
+
marginOverlay,
|
|
92
|
+
elementDisposables
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
renderElement(element, index, templateData) {
|
|
96
|
+
templateData.body.classList.remove("left", "right", "full");
|
|
97
|
+
templateData.elementDisposables.add(
|
|
98
|
+
this.instantiationService.createInstance(CellDiffPlaceholderElement, element, templateData)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
disposeTemplate(templateData) {
|
|
102
|
+
templateData.container.innerText = "";
|
|
103
|
+
}
|
|
104
|
+
disposeElement(element, index, templateData) {
|
|
105
|
+
templateData.elementDisposables.clear();
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
CellDiffPlaceholderRenderer = CellDiffPlaceholderRenderer_1 = ( __decorate([( __param(1, IInstantiationService))], CellDiffPlaceholderRenderer));
|
|
109
|
+
let NotebookDocumentMetadataDiffRenderer = class NotebookDocumentMetadataDiffRenderer {
|
|
110
|
+
static {
|
|
111
|
+
NotebookDocumentMetadataDiffRenderer_1 = this;
|
|
112
|
+
}
|
|
113
|
+
static {
|
|
114
|
+
this.TEMPLATE_ID = "notebook_metadata_diff_side_by_side";
|
|
115
|
+
}
|
|
116
|
+
constructor(
|
|
117
|
+
notebookEditor,
|
|
118
|
+
instantiationService,
|
|
119
|
+
contextMenuService,
|
|
120
|
+
keybindingService,
|
|
121
|
+
menuService,
|
|
122
|
+
contextKeyService,
|
|
123
|
+
notificationService,
|
|
124
|
+
themeService,
|
|
125
|
+
accessibilityService
|
|
126
|
+
) {
|
|
127
|
+
this.notebookEditor = notebookEditor;
|
|
128
|
+
this.instantiationService = instantiationService;
|
|
129
|
+
this.contextMenuService = contextMenuService;
|
|
130
|
+
this.keybindingService = keybindingService;
|
|
131
|
+
this.menuService = menuService;
|
|
132
|
+
this.contextKeyService = contextKeyService;
|
|
133
|
+
this.notificationService = notificationService;
|
|
134
|
+
this.themeService = themeService;
|
|
135
|
+
this.accessibilityService = accessibilityService;
|
|
136
|
+
}
|
|
137
|
+
get templateId() {
|
|
138
|
+
return NotebookDocumentMetadataDiffRenderer_1.TEMPLATE_ID;
|
|
139
|
+
}
|
|
140
|
+
renderTemplate(container) {
|
|
141
|
+
const body = $(".cell-body");
|
|
142
|
+
append(container, body);
|
|
143
|
+
const diffEditorContainer = $(".cell-diff-editor-container");
|
|
144
|
+
append(body, diffEditorContainer);
|
|
145
|
+
const cellHeaderContainer = append(diffEditorContainer, $(".input-header-container"));
|
|
146
|
+
const sourceContainer = append(diffEditorContainer, $(".source-container"));
|
|
147
|
+
const {
|
|
148
|
+
editor,
|
|
149
|
+
editorContainer
|
|
150
|
+
} = this._buildSourceEditor(sourceContainer);
|
|
151
|
+
const inputToolbarContainer = append(sourceContainer, $(".editor-input-toolbar-container"));
|
|
152
|
+
const cellToolbarContainer = append(inputToolbarContainer, $("div.property-toolbar"));
|
|
153
|
+
const toolbar = this.instantiationService.createInstance(WorkbenchToolBar, cellToolbarContainer, {
|
|
154
|
+
actionViewItemProvider: (action, options) => {
|
|
155
|
+
if (action instanceof MenuItemAction) {
|
|
156
|
+
const item = ( new CodiconActionViewItem(action, {
|
|
157
|
+
hoverDelegate: options.hoverDelegate
|
|
158
|
+
}, this.keybindingService, this.notificationService, this.contextKeyService, this.themeService, this.contextMenuService, this.accessibilityService));
|
|
159
|
+
return item;
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
},
|
|
163
|
+
highlightToggledItems: true
|
|
164
|
+
});
|
|
165
|
+
const borderContainer = append(body, $(".border-container"));
|
|
166
|
+
const leftBorder = append(borderContainer, $(".left-border"));
|
|
167
|
+
const rightBorder = append(borderContainer, $(".right-border"));
|
|
168
|
+
const topBorder = append(borderContainer, $(".top-border"));
|
|
169
|
+
const bottomBorder = append(borderContainer, $(".bottom-border"));
|
|
170
|
+
const marginOverlay = ( new UnchangedCellOverlayWidget(body));
|
|
171
|
+
const elementDisposables = ( new DisposableStore());
|
|
172
|
+
return {
|
|
173
|
+
body,
|
|
174
|
+
container,
|
|
175
|
+
diffEditorContainer,
|
|
176
|
+
cellHeaderContainer,
|
|
177
|
+
sourceEditor: editor,
|
|
178
|
+
editorContainer,
|
|
179
|
+
inputToolbarContainer,
|
|
180
|
+
toolbar,
|
|
181
|
+
leftBorder,
|
|
182
|
+
rightBorder,
|
|
183
|
+
topBorder,
|
|
184
|
+
bottomBorder,
|
|
185
|
+
marginOverlay,
|
|
186
|
+
elementDisposables
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
_buildSourceEditor(sourceContainer) {
|
|
190
|
+
return buildDiffEditorWidget(this.instantiationService, this.notebookEditor, sourceContainer, {
|
|
191
|
+
readOnly: true
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
renderElement(element, index, templateData) {
|
|
195
|
+
templateData.body.classList.remove("full");
|
|
196
|
+
templateData.elementDisposables.add(this.instantiationService.createInstance(
|
|
197
|
+
NotebookDocumentMetadataElement,
|
|
198
|
+
this.notebookEditor,
|
|
199
|
+
element,
|
|
200
|
+
templateData
|
|
201
|
+
));
|
|
202
|
+
}
|
|
203
|
+
disposeTemplate(templateData) {
|
|
204
|
+
templateData.container.innerText = "";
|
|
205
|
+
templateData.sourceEditor.dispose();
|
|
206
|
+
templateData.toolbar?.dispose();
|
|
207
|
+
templateData.elementDisposables.dispose();
|
|
208
|
+
}
|
|
209
|
+
disposeElement(element, index, templateData) {
|
|
210
|
+
if (templateData.toolbar) {
|
|
211
|
+
templateData.toolbar.context = undefined;
|
|
212
|
+
}
|
|
213
|
+
templateData.elementDisposables.clear();
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
NotebookDocumentMetadataDiffRenderer = NotebookDocumentMetadataDiffRenderer_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IContextMenuService)), ( __param(3, IKeybindingService)), ( __param(4, IMenuService)), ( __param(5, IContextKeyService)), ( __param(6, INotificationService)), ( __param(7, IThemeService)), ( __param(8, IAccessibilityService))], NotebookDocumentMetadataDiffRenderer));
|
|
217
|
+
let CellDiffSingleSideRenderer = class CellDiffSingleSideRenderer {
|
|
218
|
+
static {
|
|
219
|
+
CellDiffSingleSideRenderer_1 = this;
|
|
220
|
+
}
|
|
221
|
+
static {
|
|
222
|
+
this.TEMPLATE_ID = "cell_diff_single";
|
|
223
|
+
}
|
|
224
|
+
constructor(notebookEditor, instantiationService) {
|
|
225
|
+
this.notebookEditor = notebookEditor;
|
|
226
|
+
this.instantiationService = instantiationService;
|
|
227
|
+
}
|
|
228
|
+
get templateId() {
|
|
229
|
+
return CellDiffSingleSideRenderer_1.TEMPLATE_ID;
|
|
230
|
+
}
|
|
231
|
+
renderTemplate(container) {
|
|
232
|
+
const body = $(".cell-body");
|
|
233
|
+
append(container, body);
|
|
234
|
+
const diffEditorContainer = $(".cell-diff-editor-container");
|
|
235
|
+
append(body, diffEditorContainer);
|
|
236
|
+
const diagonalFill = append(body, $(".diagonal-fill"));
|
|
237
|
+
const cellHeaderContainer = append(diffEditorContainer, $(".input-header-container"));
|
|
238
|
+
const sourceContainer = append(diffEditorContainer, $(".source-container"));
|
|
239
|
+
const {
|
|
240
|
+
editor,
|
|
241
|
+
editorContainer
|
|
242
|
+
} = this._buildSourceEditor(sourceContainer);
|
|
243
|
+
const metadataHeaderContainer = append(diffEditorContainer, $(".metadata-header-container"));
|
|
244
|
+
const metadataInfoContainer = append(diffEditorContainer, $(".metadata-info-container"));
|
|
245
|
+
const outputHeaderContainer = append(diffEditorContainer, $(".output-header-container"));
|
|
246
|
+
const outputInfoContainer = append(diffEditorContainer, $(".output-info-container"));
|
|
247
|
+
const borderContainer = append(body, $(".border-container"));
|
|
248
|
+
const leftBorder = append(borderContainer, $(".left-border"));
|
|
249
|
+
const rightBorder = append(borderContainer, $(".right-border"));
|
|
250
|
+
const topBorder = append(borderContainer, $(".top-border"));
|
|
251
|
+
const bottomBorder = append(borderContainer, $(".bottom-border"));
|
|
252
|
+
return {
|
|
253
|
+
body,
|
|
254
|
+
container,
|
|
255
|
+
editorContainer,
|
|
256
|
+
diffEditorContainer,
|
|
257
|
+
diagonalFill,
|
|
258
|
+
cellHeaderContainer,
|
|
259
|
+
sourceEditor: editor,
|
|
260
|
+
metadataHeaderContainer,
|
|
261
|
+
metadataInfoContainer,
|
|
262
|
+
outputHeaderContainer,
|
|
263
|
+
outputInfoContainer,
|
|
264
|
+
leftBorder,
|
|
265
|
+
rightBorder,
|
|
266
|
+
topBorder,
|
|
267
|
+
bottomBorder,
|
|
268
|
+
elementDisposables: ( new DisposableStore())
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
_buildSourceEditor(sourceContainer) {
|
|
272
|
+
return buildSourceEditor(this.instantiationService, this.notebookEditor, sourceContainer);
|
|
273
|
+
}
|
|
274
|
+
renderElement(element, index, templateData) {
|
|
275
|
+
templateData.body.classList.remove("left", "right", "full");
|
|
276
|
+
switch (element.type) {
|
|
277
|
+
case "delete":
|
|
278
|
+
templateData.elementDisposables.add(
|
|
279
|
+
this.instantiationService.createInstance(DeletedElement, this.notebookEditor, element, templateData)
|
|
280
|
+
);
|
|
281
|
+
return;
|
|
282
|
+
case "insert":
|
|
283
|
+
templateData.elementDisposables.add(
|
|
284
|
+
this.instantiationService.createInstance(InsertElement, this.notebookEditor, element, templateData)
|
|
285
|
+
);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
disposeTemplate(templateData) {
|
|
290
|
+
templateData.container.innerText = "";
|
|
291
|
+
templateData.sourceEditor.dispose();
|
|
292
|
+
templateData.elementDisposables.dispose();
|
|
293
|
+
}
|
|
294
|
+
disposeElement(element, index, templateData) {
|
|
295
|
+
templateData.elementDisposables.clear();
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
CellDiffSingleSideRenderer = CellDiffSingleSideRenderer_1 = ( __decorate([( __param(1, IInstantiationService))], CellDiffSingleSideRenderer));
|
|
299
|
+
let CellDiffSideBySideRenderer = class CellDiffSideBySideRenderer {
|
|
300
|
+
static {
|
|
301
|
+
CellDiffSideBySideRenderer_1 = this;
|
|
302
|
+
}
|
|
303
|
+
static {
|
|
304
|
+
this.TEMPLATE_ID = "cell_diff_side_by_side";
|
|
305
|
+
}
|
|
306
|
+
constructor(
|
|
307
|
+
notebookEditor,
|
|
308
|
+
instantiationService,
|
|
309
|
+
contextMenuService,
|
|
310
|
+
keybindingService,
|
|
311
|
+
menuService,
|
|
312
|
+
contextKeyService,
|
|
313
|
+
notificationService,
|
|
314
|
+
themeService,
|
|
315
|
+
accessibilityService
|
|
316
|
+
) {
|
|
317
|
+
this.notebookEditor = notebookEditor;
|
|
318
|
+
this.instantiationService = instantiationService;
|
|
319
|
+
this.contextMenuService = contextMenuService;
|
|
320
|
+
this.keybindingService = keybindingService;
|
|
321
|
+
this.menuService = menuService;
|
|
322
|
+
this.contextKeyService = contextKeyService;
|
|
323
|
+
this.notificationService = notificationService;
|
|
324
|
+
this.themeService = themeService;
|
|
325
|
+
this.accessibilityService = accessibilityService;
|
|
326
|
+
}
|
|
327
|
+
get templateId() {
|
|
328
|
+
return CellDiffSideBySideRenderer_1.TEMPLATE_ID;
|
|
329
|
+
}
|
|
330
|
+
renderTemplate(container) {
|
|
331
|
+
const body = $(".cell-body");
|
|
332
|
+
append(container, body);
|
|
333
|
+
const diffEditorContainer = $(".cell-diff-editor-container");
|
|
334
|
+
append(body, diffEditorContainer);
|
|
335
|
+
const cellHeaderContainer = append(diffEditorContainer, $(".input-header-container"));
|
|
336
|
+
const sourceContainer = append(diffEditorContainer, $(".source-container"));
|
|
337
|
+
const {
|
|
338
|
+
editor,
|
|
339
|
+
editorContainer
|
|
340
|
+
} = this._buildSourceEditor(sourceContainer);
|
|
341
|
+
const inputToolbarContainer = append(sourceContainer, $(".editor-input-toolbar-container"));
|
|
342
|
+
const cellToolbarContainer = append(inputToolbarContainer, $("div.property-toolbar"));
|
|
343
|
+
const toolbar = this.instantiationService.createInstance(WorkbenchToolBar, cellToolbarContainer, {
|
|
344
|
+
actionViewItemProvider: (action, options) => {
|
|
345
|
+
if (action instanceof MenuItemAction) {
|
|
346
|
+
const item = ( new CodiconActionViewItem(action, {
|
|
347
|
+
hoverDelegate: options.hoverDelegate
|
|
348
|
+
}, this.keybindingService, this.notificationService, this.contextKeyService, this.themeService, this.contextMenuService, this.accessibilityService));
|
|
349
|
+
return item;
|
|
350
|
+
}
|
|
351
|
+
return undefined;
|
|
352
|
+
},
|
|
353
|
+
highlightToggledItems: true
|
|
354
|
+
});
|
|
355
|
+
const metadataHeaderContainer = append(diffEditorContainer, $(".metadata-header-container"));
|
|
356
|
+
const metadataInfoContainer = append(diffEditorContainer, $(".metadata-info-container"));
|
|
357
|
+
const outputHeaderContainer = append(diffEditorContainer, $(".output-header-container"));
|
|
358
|
+
const outputInfoContainer = append(diffEditorContainer, $(".output-info-container"));
|
|
359
|
+
const borderContainer = append(body, $(".border-container"));
|
|
360
|
+
const leftBorder = append(borderContainer, $(".left-border"));
|
|
361
|
+
const rightBorder = append(borderContainer, $(".right-border"));
|
|
362
|
+
const topBorder = append(borderContainer, $(".top-border"));
|
|
363
|
+
const bottomBorder = append(borderContainer, $(".bottom-border"));
|
|
364
|
+
const marginOverlay = ( new UnchangedCellOverlayWidget(body));
|
|
365
|
+
const elementDisposables = ( new DisposableStore());
|
|
366
|
+
return {
|
|
367
|
+
body,
|
|
368
|
+
container,
|
|
369
|
+
diffEditorContainer,
|
|
370
|
+
cellHeaderContainer,
|
|
371
|
+
sourceEditor: editor,
|
|
372
|
+
editorContainer,
|
|
373
|
+
inputToolbarContainer,
|
|
374
|
+
toolbar,
|
|
375
|
+
metadataHeaderContainer,
|
|
376
|
+
metadataInfoContainer,
|
|
377
|
+
outputHeaderContainer,
|
|
378
|
+
outputInfoContainer,
|
|
379
|
+
leftBorder,
|
|
380
|
+
rightBorder,
|
|
381
|
+
topBorder,
|
|
382
|
+
bottomBorder,
|
|
383
|
+
marginOverlay,
|
|
384
|
+
elementDisposables
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
_buildSourceEditor(sourceContainer) {
|
|
388
|
+
return buildDiffEditorWidget(this.instantiationService, this.notebookEditor, sourceContainer);
|
|
389
|
+
}
|
|
390
|
+
renderElement(element, index, templateData) {
|
|
391
|
+
templateData.body.classList.remove("left", "right", "full");
|
|
392
|
+
switch (element.type) {
|
|
393
|
+
case "unchanged":
|
|
394
|
+
templateData.elementDisposables.add(
|
|
395
|
+
this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData)
|
|
396
|
+
);
|
|
397
|
+
return;
|
|
398
|
+
case "modified":
|
|
399
|
+
templateData.elementDisposables.add(
|
|
400
|
+
this.instantiationService.createInstance(ModifiedElement, this.notebookEditor, element, templateData)
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
disposeTemplate(templateData) {
|
|
406
|
+
templateData.container.innerText = "";
|
|
407
|
+
templateData.sourceEditor.dispose();
|
|
408
|
+
templateData.toolbar?.dispose();
|
|
409
|
+
templateData.elementDisposables.dispose();
|
|
410
|
+
}
|
|
411
|
+
disposeElement(element, index, templateData) {
|
|
412
|
+
if (templateData.toolbar) {
|
|
413
|
+
templateData.toolbar.context = undefined;
|
|
414
|
+
}
|
|
415
|
+
templateData.elementDisposables.clear();
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
CellDiffSideBySideRenderer = CellDiffSideBySideRenderer_1 = ( __decorate([( __param(1, IInstantiationService)), ( __param(2, IContextMenuService)), ( __param(3, IKeybindingService)), ( __param(4, IMenuService)), ( __param(5, IContextKeyService)), ( __param(6, INotificationService)), ( __param(7, IThemeService)), ( __param(8, IAccessibilityService))], CellDiffSideBySideRenderer));
|
|
419
|
+
class NotebookMouseController extends MouseController {
|
|
420
|
+
onViewPointer(e) {
|
|
421
|
+
if (isMonacoEditor(e.browserEvent.target)) {
|
|
422
|
+
const focus = typeof e.index === "undefined" ? [] : [e.index];
|
|
423
|
+
this.list.setFocus(focus, e.browserEvent);
|
|
424
|
+
} else {
|
|
425
|
+
super.onViewPointer(e);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
let NotebookTextDiffList = class NotebookTextDiffList extends WorkbenchList {
|
|
430
|
+
get rowsContainer() {
|
|
431
|
+
return this.view.containerDomNode;
|
|
432
|
+
}
|
|
433
|
+
constructor(
|
|
434
|
+
listUser,
|
|
435
|
+
container,
|
|
436
|
+
delegate,
|
|
437
|
+
renderers,
|
|
438
|
+
contextKeyService,
|
|
439
|
+
options,
|
|
440
|
+
listService,
|
|
441
|
+
configurationService,
|
|
442
|
+
instantiationService
|
|
443
|
+
) {
|
|
444
|
+
super(
|
|
445
|
+
listUser,
|
|
446
|
+
container,
|
|
447
|
+
delegate,
|
|
448
|
+
renderers,
|
|
449
|
+
options,
|
|
450
|
+
contextKeyService,
|
|
451
|
+
listService,
|
|
452
|
+
configurationService,
|
|
453
|
+
instantiationService
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
createMouseController(options) {
|
|
457
|
+
return ( new NotebookMouseController(this));
|
|
458
|
+
}
|
|
459
|
+
getCellViewScrollTop(element) {
|
|
460
|
+
const index = this.indexOf(element);
|
|
461
|
+
return this.view.elementTop(index);
|
|
462
|
+
}
|
|
463
|
+
getScrollHeight() {
|
|
464
|
+
return this.view.scrollHeight;
|
|
465
|
+
}
|
|
466
|
+
triggerScrollFromMouseWheelEvent(browserEvent) {
|
|
467
|
+
this.view.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
468
|
+
}
|
|
469
|
+
delegateVerticalScrollbarPointerDown(browserEvent) {
|
|
470
|
+
this.view.delegateVerticalScrollbarPointerDown(browserEvent);
|
|
471
|
+
}
|
|
472
|
+
clear() {
|
|
473
|
+
super.splice(0, this.length);
|
|
474
|
+
}
|
|
475
|
+
updateElementHeight2(element, size) {
|
|
476
|
+
const viewIndex = this.indexOf(element);
|
|
477
|
+
const focused = this.getFocus();
|
|
478
|
+
this.view.updateElementHeight(viewIndex, size, focused.length ? focused[0] : null);
|
|
479
|
+
}
|
|
480
|
+
style(styles) {
|
|
481
|
+
const selectorSuffix = this.view.domId;
|
|
482
|
+
if (!this.styleElement) {
|
|
483
|
+
this.styleElement = createStyleSheet(this.view.domNode);
|
|
484
|
+
}
|
|
485
|
+
const suffix = selectorSuffix && `.${selectorSuffix}`;
|
|
486
|
+
const content = [];
|
|
487
|
+
if (styles.listBackground) {
|
|
488
|
+
content.push(
|
|
489
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows { background: ${styles.listBackground}; }`
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
if (styles.listFocusBackground) {
|
|
493
|
+
content.push(
|
|
494
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listFocusBackground}; }`
|
|
495
|
+
);
|
|
496
|
+
content.push(
|
|
497
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listFocusBackground}; }`
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
if (styles.listFocusForeground) {
|
|
501
|
+
content.push(
|
|
502
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { color: ${styles.listFocusForeground}; }`
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
if (styles.listActiveSelectionBackground) {
|
|
506
|
+
content.push(
|
|
507
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listActiveSelectionBackground}; }`
|
|
508
|
+
);
|
|
509
|
+
content.push(
|
|
510
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listActiveSelectionBackground}; }`
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
if (styles.listActiveSelectionForeground) {
|
|
514
|
+
content.push(
|
|
515
|
+
`.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listActiveSelectionForeground}; }`
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
if (styles.listFocusAndSelectionBackground) {
|
|
519
|
+
content.push(`
|
|
520
|
+
.monaco-drag-image${suffix},
|
|
521
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; }
|
|
522
|
+
`);
|
|
523
|
+
}
|
|
524
|
+
if (styles.listFocusAndSelectionForeground) {
|
|
525
|
+
content.push(`
|
|
526
|
+
.monaco-drag-image${suffix},
|
|
527
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; }
|
|
528
|
+
`);
|
|
529
|
+
}
|
|
530
|
+
if (styles.listInactiveFocusBackground) {
|
|
531
|
+
content.push(
|
|
532
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { background-color: ${styles.listInactiveFocusBackground}; }`
|
|
533
|
+
);
|
|
534
|
+
content.push(
|
|
535
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused:hover { background-color: ${styles.listInactiveFocusBackground}; }`
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
if (styles.listInactiveSelectionBackground) {
|
|
539
|
+
content.push(
|
|
540
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { background-color: ${styles.listInactiveSelectionBackground}; }`
|
|
541
|
+
);
|
|
542
|
+
content.push(
|
|
543
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected:hover { background-color: ${styles.listInactiveSelectionBackground}; }`
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
if (styles.listInactiveSelectionForeground) {
|
|
547
|
+
content.push(
|
|
548
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { color: ${styles.listInactiveSelectionForeground}; }`
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
if (styles.listHoverBackground) {
|
|
552
|
+
content.push(
|
|
553
|
+
`.monaco-list${suffix}:not(.drop-target) > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${styles.listHoverBackground}; }`
|
|
554
|
+
);
|
|
555
|
+
}
|
|
556
|
+
if (styles.listHoverForeground) {
|
|
557
|
+
content.push(
|
|
558
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover:not(.selected):not(.focused) { color: ${styles.listHoverForeground}; }`
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
if (styles.listSelectionOutline) {
|
|
562
|
+
content.push(
|
|
563
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.selected { outline: 1px dotted ${styles.listSelectionOutline}; outline-offset: -1px; }`
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
if (styles.listFocusOutline) {
|
|
567
|
+
content.push(`
|
|
568
|
+
.monaco-drag-image${suffix},
|
|
569
|
+
.monaco-list${suffix}:focus > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; }
|
|
570
|
+
`);
|
|
571
|
+
}
|
|
572
|
+
if (styles.listInactiveFocusOutline) {
|
|
573
|
+
content.push(
|
|
574
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.focused { outline: 1px dotted ${styles.listInactiveFocusOutline}; outline-offset: -1px; }`
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
if (styles.listHoverOutline) {
|
|
578
|
+
content.push(
|
|
579
|
+
`.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows > .monaco-list-row:hover { outline: 1px dashed ${styles.listHoverOutline}; outline-offset: -1px; }`
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
if (styles.listDropOverBackground) {
|
|
583
|
+
content.push(`
|
|
584
|
+
.monaco-list${suffix}.drop-target,
|
|
585
|
+
.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-rows.drop-target,
|
|
586
|
+
.monaco-list${suffix} > div.monaco-scrollable-element > .monaco-list-row.drop-target { background-color: ${styles.listDropOverBackground} !important; color: inherit !important; }
|
|
587
|
+
`);
|
|
588
|
+
}
|
|
589
|
+
const newStyles = content.join("\n");
|
|
590
|
+
if (newStyles !== this.styleElement.textContent) {
|
|
591
|
+
this.styleElement.textContent = newStyles;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
NotebookTextDiffList = ( __decorate([( __param(6, IListService)), ( __param(7, IConfigurationService)), ( __param(8, IInstantiationService))], NotebookTextDiffList));
|
|
596
|
+
function buildDiffEditorWidget(instantiationService, notebookEditor, sourceContainer, options = {}) {
|
|
597
|
+
const editorContainer = append(sourceContainer, $(".editor-container"));
|
|
598
|
+
const editor = instantiationService.createInstance(DiffEditorWidget, editorContainer, {
|
|
599
|
+
...fixedDiffEditorOptions,
|
|
600
|
+
overflowWidgetsDomNode: notebookEditor.getOverflowContainerDomNode(),
|
|
601
|
+
originalEditable: false,
|
|
602
|
+
ignoreTrimWhitespace: false,
|
|
603
|
+
automaticLayout: false,
|
|
604
|
+
dimension: {
|
|
605
|
+
height: 0,
|
|
606
|
+
width: 0
|
|
607
|
+
},
|
|
608
|
+
renderSideBySide: true,
|
|
609
|
+
useInlineViewWhenSpaceIsLimited: false,
|
|
610
|
+
...options
|
|
611
|
+
}, {
|
|
612
|
+
originalEditor: getOptimizedNestedCodeEditorWidgetOptions(),
|
|
613
|
+
modifiedEditor: getOptimizedNestedCodeEditorWidgetOptions()
|
|
614
|
+
});
|
|
615
|
+
return {
|
|
616
|
+
editor,
|
|
617
|
+
editorContainer
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function buildSourceEditor(instantiationService, notebookEditor, sourceContainer, options = {}) {
|
|
621
|
+
const editorContainer = append(sourceContainer, $(".editor-container"));
|
|
622
|
+
const skipContributions = ["editor.contrib.emptyTextEditorHint"];
|
|
623
|
+
const editor = instantiationService.createInstance(CodeEditorWidget, editorContainer, {
|
|
624
|
+
...fixedEditorOptions,
|
|
625
|
+
glyphMargin: false,
|
|
626
|
+
dimension: {
|
|
627
|
+
width: (notebookEditor.getLayoutInfo().width - 2 * DIFF_CELL_MARGIN) / 2 - 18,
|
|
628
|
+
height: 0
|
|
629
|
+
},
|
|
630
|
+
automaticLayout: false,
|
|
631
|
+
overflowWidgetsDomNode: notebookEditor.getOverflowContainerDomNode(),
|
|
632
|
+
allowVariableLineHeights: false,
|
|
633
|
+
readOnly: true
|
|
634
|
+
}, {
|
|
635
|
+
contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1)
|
|
636
|
+
});
|
|
637
|
+
return {
|
|
638
|
+
editor,
|
|
639
|
+
editorContainer
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export { CellDiffPlaceholderRenderer, CellDiffSideBySideRenderer, CellDiffSingleSideRenderer, NotebookCellTextDiffListDelegate, NotebookDocumentMetadataDiffRenderer, NotebookMouseController, NotebookTextDiffList };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Themable } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService";
|
|
2
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
3
|
+
import { IDiffElementViewModelBase } from "./diffElementViewModel.js";
|
|
4
|
+
import { NotebookDiffEditorEventDispatcher } from "./eventDispatcher.js";
|
|
5
|
+
import { INotebookTextDiffEditor } from "./notebookDiffEditorBrowser.js";
|
|
6
|
+
export declare class NotebookDiffOverviewRuler extends Themable {
|
|
7
|
+
readonly notebookEditor: INotebookTextDiffEditor;
|
|
8
|
+
readonly width: number;
|
|
9
|
+
private readonly _domNode;
|
|
10
|
+
private readonly _overviewViewportDomElement;
|
|
11
|
+
private _diffElementViewModels;
|
|
12
|
+
private _lanes;
|
|
13
|
+
private _insertColor;
|
|
14
|
+
private _insertColorHex;
|
|
15
|
+
private _removeColor;
|
|
16
|
+
private _removeColorHex;
|
|
17
|
+
private readonly _disposables;
|
|
18
|
+
private _renderAnimationFrame;
|
|
19
|
+
constructor(notebookEditor: INotebookTextDiffEditor, width: number, container: HTMLElement, themeService: IThemeService);
|
|
20
|
+
private applyColors;
|
|
21
|
+
layout(): void;
|
|
22
|
+
updateViewModels(elements: readonly IDiffElementViewModelBase[], eventDispatcher: NotebookDiffEditorEventDispatcher | undefined): void;
|
|
23
|
+
private _scheduleRender;
|
|
24
|
+
private _onRenderScheduled;
|
|
25
|
+
private _layoutNow;
|
|
26
|
+
private _renderOverviewViewport;
|
|
27
|
+
private _computeOverviewViewport;
|
|
28
|
+
private _renderCanvas;
|
|
29
|
+
dispose(): void;
|
|
30
|
+
}
|