@codingame/monaco-vscode-api 1.85.0 → 1.85.1
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/README.md +19 -10
- package/contributions.js +1 -0
- package/missing-services.js +91 -5
- package/monaco-editor-treemending.patch +957 -950
- package/package.json +6 -6
- package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
- package/assets/break.mp3 +0 -0
- package/assets/chatRequestSent.mp3 +0 -0
- package/assets/chatResponsePending.mp3 +0 -0
- package/assets/chatResponseReceived1.mp3 +0 -0
- package/assets/chatResponseReceived2.mp3 +0 -0
- package/assets/chatResponseReceived3.mp3 +0 -0
- package/assets/chatResponseReceived4.mp3 +0 -0
- package/assets/clear.mp3 +0 -0
- package/assets/defaultIcon.png +0 -0
- package/assets/diffLineDeleted.mp3 +0 -0
- package/assets/diffLineInserted.mp3 +0 -0
- package/assets/diffLineModified.mp3 +0 -0
- package/assets/error.mp3 +0 -0
- package/assets/fake.html +0 -10
- package/assets/foldedAreas.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/index-no-csp.html +0 -1226
- package/assets/index.html +0 -1227
- package/assets/quickFixes.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/assets/service-worker.js +0 -457
- package/assets/taskCompleted.mp3 +0 -0
- package/assets/taskFailed.mp3 +0 -0
- package/assets/terminalBell.mp3 +0 -0
- package/assets/warning.mp3 +0 -0
- package/assets/webWorkerExtensionHostIframe.html +0 -123
- package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import { Disposable, MutableDisposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
class CellContentPart extends Disposable {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.cellDisposables = ( new DisposableStore());
|
|
7
|
+
}
|
|
8
|
+
prepareRenderCell(element) { }
|
|
9
|
+
renderCell(element) {
|
|
10
|
+
this.currentCell = element;
|
|
11
|
+
this.didRenderCell(element);
|
|
12
|
+
}
|
|
13
|
+
didRenderCell(element) { }
|
|
14
|
+
unrenderCell(element) {
|
|
15
|
+
this.currentCell = undefined;
|
|
16
|
+
this.cellDisposables.clear();
|
|
17
|
+
}
|
|
18
|
+
prepareLayout() { }
|
|
19
|
+
updateInternalLayoutNow(element) { }
|
|
20
|
+
updateState(element, e) { }
|
|
21
|
+
updateForExecutionState(element, e) { }
|
|
22
|
+
}
|
|
23
|
+
class CellOverlayPart extends Disposable {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.cellDisposables = this._register(( new DisposableStore()));
|
|
27
|
+
}
|
|
28
|
+
prepareRenderCell(element) { }
|
|
29
|
+
renderCell(element) {
|
|
30
|
+
this.currentCell = element;
|
|
31
|
+
this.didRenderCell(element);
|
|
32
|
+
}
|
|
33
|
+
didRenderCell(element) { }
|
|
34
|
+
unrenderCell(element) {
|
|
35
|
+
this.currentCell = undefined;
|
|
36
|
+
this.cellDisposables.clear();
|
|
37
|
+
}
|
|
38
|
+
updateInternalLayoutNow(element) { }
|
|
39
|
+
updateState(element, e) { }
|
|
40
|
+
updateForExecutionState(element, e) { }
|
|
41
|
+
}
|
|
42
|
+
class CellPartsCollection extends Disposable {
|
|
43
|
+
constructor(targetWindow, contentParts, overlayParts) {
|
|
44
|
+
super();
|
|
45
|
+
this.targetWindow = targetWindow;
|
|
46
|
+
this.contentParts = contentParts;
|
|
47
|
+
this.overlayParts = overlayParts;
|
|
48
|
+
this._scheduledOverlayRendering = this._register(( new MutableDisposable()));
|
|
49
|
+
this._scheduledOverlayUpdateState = this._register(( new MutableDisposable()));
|
|
50
|
+
this._scheduledOverlayUpdateExecutionState = this._register(( new MutableDisposable()));
|
|
51
|
+
}
|
|
52
|
+
concatContentPart(other, targetWindow) {
|
|
53
|
+
return ( new CellPartsCollection(targetWindow, this.contentParts.concat(other), this.overlayParts));
|
|
54
|
+
}
|
|
55
|
+
concatOverlayPart(other, targetWindow) {
|
|
56
|
+
return ( new CellPartsCollection(targetWindow, this.contentParts, this.overlayParts.concat(other)));
|
|
57
|
+
}
|
|
58
|
+
scheduleRenderCell(element) {
|
|
59
|
+
for (const part of this.contentParts) {
|
|
60
|
+
part.prepareRenderCell(element);
|
|
61
|
+
}
|
|
62
|
+
for (const part of this.overlayParts) {
|
|
63
|
+
part.prepareRenderCell(element);
|
|
64
|
+
}
|
|
65
|
+
for (const part of this.contentParts) {
|
|
66
|
+
part.renderCell(element);
|
|
67
|
+
}
|
|
68
|
+
this._scheduledOverlayRendering.value = dom.modify(this.targetWindow, () => {
|
|
69
|
+
for (const part of this.overlayParts) {
|
|
70
|
+
part.renderCell(element);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
unrenderCell(element) {
|
|
75
|
+
for (const part of this.contentParts) {
|
|
76
|
+
part.unrenderCell(element);
|
|
77
|
+
}
|
|
78
|
+
this._scheduledOverlayRendering.value = undefined;
|
|
79
|
+
this._scheduledOverlayUpdateState.value = undefined;
|
|
80
|
+
this._scheduledOverlayUpdateExecutionState.value = undefined;
|
|
81
|
+
for (const part of this.overlayParts) {
|
|
82
|
+
part.unrenderCell(element);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
updateInternalLayoutNow(viewCell) {
|
|
86
|
+
for (const part of this.contentParts) {
|
|
87
|
+
part.updateInternalLayoutNow(viewCell);
|
|
88
|
+
}
|
|
89
|
+
for (const part of this.overlayParts) {
|
|
90
|
+
part.updateInternalLayoutNow(viewCell);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
prepareLayout() {
|
|
94
|
+
for (const part of this.contentParts) {
|
|
95
|
+
part.prepareLayout();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
updateState(viewCell, e) {
|
|
99
|
+
for (const part of this.contentParts) {
|
|
100
|
+
part.updateState(viewCell, e);
|
|
101
|
+
}
|
|
102
|
+
this._scheduledOverlayUpdateState.value = dom.modify(this.targetWindow, () => {
|
|
103
|
+
for (const part of this.overlayParts) {
|
|
104
|
+
part.updateState(viewCell, e);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
updateForExecutionState(viewCell, e) {
|
|
109
|
+
for (const part of this.contentParts) {
|
|
110
|
+
part.updateForExecutionState(viewCell, e);
|
|
111
|
+
}
|
|
112
|
+
this._scheduledOverlayUpdateExecutionState.value = dom.modify(this.targetWindow, () => {
|
|
113
|
+
for (const part of this.overlayParts) {
|
|
114
|
+
part.updateForExecutionState(viewCell, e);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export { CellContentPart, CellOverlayPart, CellPartsCollection };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { renderLabelWithIcons } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { MenuEntryActionViewItem } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
|
|
4
|
+
class CodiconActionViewItem extends MenuEntryActionViewItem {
|
|
5
|
+
updateLabel() {
|
|
6
|
+
if (this.options.label && this.label) {
|
|
7
|
+
dom.reset(this.label, ...renderLabelWithIcons(this._commandAction.label ?? ''));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class ActionViewWithLabel extends MenuEntryActionViewItem {
|
|
12
|
+
render(container) {
|
|
13
|
+
super.render(container);
|
|
14
|
+
container.classList.add('notebook-action-view-item');
|
|
15
|
+
this._actionLabel = document.createElement('a');
|
|
16
|
+
container.appendChild(this._actionLabel);
|
|
17
|
+
this.updateLabel();
|
|
18
|
+
}
|
|
19
|
+
updateLabel() {
|
|
20
|
+
if (this._actionLabel) {
|
|
21
|
+
this._actionLabel.classList.add('notebook-label');
|
|
22
|
+
this._actionLabel.innerText = this._action.label;
|
|
23
|
+
this._actionLabel.title = this._action.tooltip.length ? this._action.tooltip : this._action.label;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export { ActionViewWithLabel, CodiconActionViewItem };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
3
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { EDITOR_FONT_DEFAULTS } from 'monaco-editor/esm/vs/editor/common/config/editorOptions.js';
|
|
5
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
6
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
7
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
9
|
+
import { ICommentService } from '../../../../comments/browser/commentService.js';
|
|
10
|
+
import { CommentThreadWidget } from '../../../../comments/browser/commentThreadWidget.js';
|
|
11
|
+
import { CellContentPart } from '../cellPart.js';
|
|
12
|
+
import { CellKind } from '../../../common/notebookCommon.js';
|
|
13
|
+
let CellComments = class CellComments extends CellContentPart {
|
|
14
|
+
constructor(notebookEditor, container, contextKeyService, themeService, commentService, configurationService, instantiationService) {
|
|
15
|
+
super();
|
|
16
|
+
this.notebookEditor = notebookEditor;
|
|
17
|
+
this.container = container;
|
|
18
|
+
this.contextKeyService = contextKeyService;
|
|
19
|
+
this.themeService = themeService;
|
|
20
|
+
this.commentService = commentService;
|
|
21
|
+
this.configurationService = configurationService;
|
|
22
|
+
this.instantiationService = instantiationService;
|
|
23
|
+
this._initialized = false;
|
|
24
|
+
this._commentThreadWidget = null;
|
|
25
|
+
this.commentTheadDisposables = this._register(( new DisposableStore()));
|
|
26
|
+
this.container.classList.add('review-widget');
|
|
27
|
+
this._register(this.themeService.onDidColorThemeChange(this._applyTheme, this));
|
|
28
|
+
this._applyTheme();
|
|
29
|
+
}
|
|
30
|
+
async initialize(element) {
|
|
31
|
+
if (this._initialized) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this._initialized = true;
|
|
35
|
+
const info = await this._getCommentThreadForCell(element);
|
|
36
|
+
if (info) {
|
|
37
|
+
this._createCommentTheadWidget(info.owner, info.thread);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
_createCommentTheadWidget(owner, commentThread) {
|
|
41
|
+
this._commentThreadWidget?.dispose();
|
|
42
|
+
this.commentTheadDisposables.clear();
|
|
43
|
+
this._commentThreadWidget = this.instantiationService.createInstance(CommentThreadWidget, this.container, this.notebookEditor, owner, this.notebookEditor.textModel.uri, this.contextKeyService, this.instantiationService, commentThread, undefined, undefined, {
|
|
44
|
+
codeBlockFontFamily: this.configurationService.getValue('editor').fontFamily || EDITOR_FONT_DEFAULTS.fontFamily
|
|
45
|
+
}, undefined, {
|
|
46
|
+
actionRunner: () => {
|
|
47
|
+
},
|
|
48
|
+
collapse: () => { }
|
|
49
|
+
});
|
|
50
|
+
const layoutInfo = this.notebookEditor.getLayoutInfo();
|
|
51
|
+
this._commentThreadWidget.display(layoutInfo.fontInfo.lineHeight);
|
|
52
|
+
this._applyTheme();
|
|
53
|
+
this.commentTheadDisposables.add(this._commentThreadWidget.onDidResize(() => {
|
|
54
|
+
if (this.currentElement?.cellKind === CellKind.Code && this._commentThreadWidget) {
|
|
55
|
+
this.currentElement.commentHeight = this._calculateCommentThreadHeight(this._commentThreadWidget.getDimensions().height);
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
_bindListeners() {
|
|
60
|
+
this.cellDisposables.add(this.commentService.onDidUpdateCommentThreads(async () => {
|
|
61
|
+
if (this.currentElement) {
|
|
62
|
+
const info = await this._getCommentThreadForCell(this.currentElement);
|
|
63
|
+
if (!this._commentThreadWidget && info) {
|
|
64
|
+
this._createCommentTheadWidget(info.owner, info.thread);
|
|
65
|
+
const layoutInfo = this.currentElement.layoutInfo;
|
|
66
|
+
this.container.style.top = `${layoutInfo.outputContainerOffset + layoutInfo.outputTotalHeight}px`;
|
|
67
|
+
this.currentElement.commentHeight = this._calculateCommentThreadHeight(this._commentThreadWidget.getDimensions().height);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (this._commentThreadWidget) {
|
|
71
|
+
if (!info) {
|
|
72
|
+
this._commentThreadWidget.dispose();
|
|
73
|
+
this.currentElement.commentHeight = 0;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (this._commentThreadWidget.commentThread === info.thread) {
|
|
77
|
+
this.currentElement.commentHeight = this._calculateCommentThreadHeight(this._commentThreadWidget.getDimensions().height);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this._commentThreadWidget.updateCommentThread(info.thread);
|
|
81
|
+
this.currentElement.commentHeight = this._calculateCommentThreadHeight(this._commentThreadWidget.getDimensions().height);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
_calculateCommentThreadHeight(bodyHeight) {
|
|
87
|
+
const layoutInfo = this.notebookEditor.getLayoutInfo();
|
|
88
|
+
const headHeight = Math.ceil(layoutInfo.fontInfo.lineHeight * 1.2);
|
|
89
|
+
const lineHeight = layoutInfo.fontInfo.lineHeight;
|
|
90
|
+
const arrowHeight = Math.round(lineHeight / 3);
|
|
91
|
+
const frameThickness = Math.round(lineHeight / 9) * 2;
|
|
92
|
+
const computedHeight = headHeight + bodyHeight + arrowHeight + frameThickness + 8 ;
|
|
93
|
+
return computedHeight;
|
|
94
|
+
}
|
|
95
|
+
async _getCommentThreadForCell(element) {
|
|
96
|
+
if (this.notebookEditor.hasModel()) {
|
|
97
|
+
const commentInfos = coalesce(await this.commentService.getNotebookComments(element.uri));
|
|
98
|
+
if (commentInfos.length && commentInfos[0].threads.length) {
|
|
99
|
+
return { owner: commentInfos[0].owner, thread: commentInfos[0].threads[0] };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
_applyTheme() {
|
|
105
|
+
const theme = this.themeService.getColorTheme();
|
|
106
|
+
const fontInfo = this.notebookEditor.getLayoutInfo().fontInfo;
|
|
107
|
+
this._commentThreadWidget?.applyTheme(theme, fontInfo);
|
|
108
|
+
}
|
|
109
|
+
didRenderCell(element) {
|
|
110
|
+
if (element.cellKind === CellKind.Code) {
|
|
111
|
+
this.currentElement = element;
|
|
112
|
+
this.initialize(element);
|
|
113
|
+
this._bindListeners();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
prepareLayout() {
|
|
117
|
+
if (this.currentElement?.cellKind === CellKind.Code && this._commentThreadWidget) {
|
|
118
|
+
this.currentElement.commentHeight = this._calculateCommentThreadHeight(this._commentThreadWidget.getDimensions().height);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
updateInternalLayoutNow(element) {
|
|
122
|
+
if (this.currentElement?.cellKind === CellKind.Code && this._commentThreadWidget) {
|
|
123
|
+
const layoutInfo = element.layoutInfo;
|
|
124
|
+
this.container.style.top = `${layoutInfo.outputContainerOffset + layoutInfo.outputTotalHeight}px`;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
CellComments = ( __decorate([
|
|
129
|
+
( __param(2, IContextKeyService)),
|
|
130
|
+
( __param(3, IThemeService)),
|
|
131
|
+
( __param(4, ICommentService)),
|
|
132
|
+
( __param(5, IConfigurationService)),
|
|
133
|
+
( __param(6, IInstantiationService))
|
|
134
|
+
], CellComments));
|
|
135
|
+
export { CellComments };
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
4
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
+
import { CellFocusMode, CellEditState } from '../../notebookBrowser.js';
|
|
6
|
+
import { CellContentPart } from '../cellPart.js';
|
|
7
|
+
import { CodeCellViewModel } from '../../viewModel/codeCellViewModel.js';
|
|
8
|
+
import { MarkupCellViewModel } from '../../viewModel/markupCellViewModel.js';
|
|
9
|
+
import { NotebookCellExecutionState } from '../../../common/notebookCommon.js';
|
|
10
|
+
import { NOTEBOOK_CELL_TYPE, NOTEBOOK_CELL_EDITABLE, NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CELL_EXECUTION_STATE, NOTEBOOK_CELL_EXECUTING, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_INPUT_COLLAPSED, NOTEBOOK_CELL_OUTPUT_COLLAPSED, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_CELL_RESOURCE } from '../../../common/notebookContextKeys.js';
|
|
11
|
+
import { NotebookExecutionType, INotebookExecutionStateService } from '../../../common/notebookExecutionStateService.js';
|
|
12
|
+
let CellContextKeyPart = class CellContextKeyPart extends CellContentPart {
|
|
13
|
+
constructor(notebookEditor, instantiationService) {
|
|
14
|
+
super();
|
|
15
|
+
this.instantiationService = instantiationService;
|
|
16
|
+
this.cellContextKeyManager = this._register(this.instantiationService.createInstance(CellContextKeyManager, notebookEditor, undefined));
|
|
17
|
+
}
|
|
18
|
+
didRenderCell(element) {
|
|
19
|
+
this.cellContextKeyManager.updateForElement(element);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
CellContextKeyPart = ( __decorate([
|
|
23
|
+
( __param(1, IInstantiationService))
|
|
24
|
+
], CellContextKeyPart));
|
|
25
|
+
let CellContextKeyManager = class CellContextKeyManager extends Disposable {
|
|
26
|
+
constructor(notebookEditor, element, _contextKeyService, _notebookExecutionStateService) {
|
|
27
|
+
super();
|
|
28
|
+
this.notebookEditor = notebookEditor;
|
|
29
|
+
this.element = element;
|
|
30
|
+
this._contextKeyService = _contextKeyService;
|
|
31
|
+
this._notebookExecutionStateService = _notebookExecutionStateService;
|
|
32
|
+
this.elementDisposables = this._register(( new DisposableStore()));
|
|
33
|
+
this._contextKeyService.bufferChangeEvents(() => {
|
|
34
|
+
this.cellType = NOTEBOOK_CELL_TYPE.bindTo(this._contextKeyService);
|
|
35
|
+
this.cellEditable = NOTEBOOK_CELL_EDITABLE.bindTo(this._contextKeyService);
|
|
36
|
+
this.cellFocused = NOTEBOOK_CELL_FOCUSED.bindTo(this._contextKeyService);
|
|
37
|
+
this.cellEditorFocused = NOTEBOOK_CELL_EDITOR_FOCUSED.bindTo(this._contextKeyService);
|
|
38
|
+
this.markdownEditMode = NOTEBOOK_CELL_MARKDOWN_EDIT_MODE.bindTo(this._contextKeyService);
|
|
39
|
+
this.cellRunState = NOTEBOOK_CELL_EXECUTION_STATE.bindTo(this._contextKeyService);
|
|
40
|
+
this.cellExecuting = NOTEBOOK_CELL_EXECUTING.bindTo(this._contextKeyService);
|
|
41
|
+
this.cellHasOutputs = NOTEBOOK_CELL_HAS_OUTPUTS.bindTo(this._contextKeyService);
|
|
42
|
+
this.cellContentCollapsed = NOTEBOOK_CELL_INPUT_COLLAPSED.bindTo(this._contextKeyService);
|
|
43
|
+
this.cellOutputCollapsed = NOTEBOOK_CELL_OUTPUT_COLLAPSED.bindTo(this._contextKeyService);
|
|
44
|
+
this.cellLineNumbers = NOTEBOOK_CELL_LINE_NUMBERS.bindTo(this._contextKeyService);
|
|
45
|
+
this.cellResource = NOTEBOOK_CELL_RESOURCE.bindTo(this._contextKeyService);
|
|
46
|
+
if (element) {
|
|
47
|
+
this.updateForElement(element);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
this._register(this._notebookExecutionStateService.onDidChangeExecution(e => {
|
|
51
|
+
if (e.type === NotebookExecutionType.cell && this.element && e.affectsCell(this.element.uri)) {
|
|
52
|
+
this.updateForExecutionState();
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
updateForElement(element) {
|
|
57
|
+
this.elementDisposables.clear();
|
|
58
|
+
this.element = element;
|
|
59
|
+
if (!element) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.elementDisposables.add(element.onDidChangeState(e => this.onDidChangeState(e)));
|
|
63
|
+
if (element instanceof CodeCellViewModel) {
|
|
64
|
+
this.elementDisposables.add(element.onDidChangeOutputs(() => this.updateForOutputs()));
|
|
65
|
+
}
|
|
66
|
+
this.elementDisposables.add(this.notebookEditor.onDidChangeActiveCell(() => this.updateForFocusState()));
|
|
67
|
+
if (this.element instanceof MarkupCellViewModel) {
|
|
68
|
+
this.cellType.set('markup');
|
|
69
|
+
}
|
|
70
|
+
else if (this.element instanceof CodeCellViewModel) {
|
|
71
|
+
this.cellType.set('code');
|
|
72
|
+
}
|
|
73
|
+
this._contextKeyService.bufferChangeEvents(() => {
|
|
74
|
+
this.updateForFocusState();
|
|
75
|
+
this.updateForExecutionState();
|
|
76
|
+
this.updateForEditState();
|
|
77
|
+
this.updateForCollapseState();
|
|
78
|
+
this.updateForOutputs();
|
|
79
|
+
this.cellLineNumbers.set(this.element.lineNumbers);
|
|
80
|
+
this.cellResource.set(( this.element.uri.toString()));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
onDidChangeState(e) {
|
|
84
|
+
this._contextKeyService.bufferChangeEvents(() => {
|
|
85
|
+
if (e.internalMetadataChanged) {
|
|
86
|
+
this.updateForExecutionState();
|
|
87
|
+
}
|
|
88
|
+
if (e.editStateChanged) {
|
|
89
|
+
this.updateForEditState();
|
|
90
|
+
}
|
|
91
|
+
if (e.focusModeChanged) {
|
|
92
|
+
this.updateForFocusState();
|
|
93
|
+
}
|
|
94
|
+
if (e.cellLineNumberChanged) {
|
|
95
|
+
this.cellLineNumbers.set(this.element.lineNumbers);
|
|
96
|
+
}
|
|
97
|
+
if (e.inputCollapsedChanged || e.outputCollapsedChanged) {
|
|
98
|
+
this.updateForCollapseState();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
updateForFocusState() {
|
|
103
|
+
if (!this.element) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const activeCell = this.notebookEditor.getActiveCell();
|
|
107
|
+
this.cellFocused.set(this.notebookEditor.getActiveCell() === this.element);
|
|
108
|
+
if (activeCell === this.element) {
|
|
109
|
+
this.cellEditorFocused.set(this.element.focusMode === CellFocusMode.Editor);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.cellEditorFocused.set(false);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
updateForExecutionState() {
|
|
116
|
+
if (!this.element) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const internalMetadata = this.element.internalMetadata;
|
|
120
|
+
this.cellEditable.set(!this.notebookEditor.isReadOnly);
|
|
121
|
+
const exeState = this._notebookExecutionStateService.getCellExecution(this.element.uri);
|
|
122
|
+
if (this.element instanceof MarkupCellViewModel) {
|
|
123
|
+
this.cellRunState.reset();
|
|
124
|
+
this.cellExecuting.reset();
|
|
125
|
+
}
|
|
126
|
+
else if (exeState?.state === NotebookCellExecutionState.Executing) {
|
|
127
|
+
this.cellRunState.set('executing');
|
|
128
|
+
this.cellExecuting.set(true);
|
|
129
|
+
}
|
|
130
|
+
else if (exeState?.state === NotebookCellExecutionState.Pending || exeState?.state === NotebookCellExecutionState.Unconfirmed) {
|
|
131
|
+
this.cellRunState.set('pending');
|
|
132
|
+
this.cellExecuting.set(true);
|
|
133
|
+
}
|
|
134
|
+
else if (internalMetadata.lastRunSuccess === true) {
|
|
135
|
+
this.cellRunState.set('succeeded');
|
|
136
|
+
this.cellExecuting.set(false);
|
|
137
|
+
}
|
|
138
|
+
else if (internalMetadata.lastRunSuccess === false) {
|
|
139
|
+
this.cellRunState.set('failed');
|
|
140
|
+
this.cellExecuting.set(false);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.cellRunState.set('idle');
|
|
144
|
+
this.cellExecuting.set(false);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
updateForEditState() {
|
|
148
|
+
if (!this.element) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (this.element instanceof MarkupCellViewModel) {
|
|
152
|
+
this.markdownEditMode.set(this.element.getEditState() === CellEditState.Editing);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.markdownEditMode.set(false);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
updateForCollapseState() {
|
|
159
|
+
if (!this.element) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.cellContentCollapsed.set(!!this.element.isInputCollapsed);
|
|
163
|
+
this.cellOutputCollapsed.set(!!this.element.isOutputCollapsed);
|
|
164
|
+
}
|
|
165
|
+
updateForOutputs() {
|
|
166
|
+
if (this.element instanceof CodeCellViewModel) {
|
|
167
|
+
this.cellHasOutputs.set(this.element.outputsViewModels.length > 0);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
this.cellHasOutputs.set(false);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
CellContextKeyManager = ( __decorate([
|
|
175
|
+
( __param(2, IContextKeyService)),
|
|
176
|
+
( __param(3, INotebookExecutionStateService))
|
|
177
|
+
], CellContextKeyManager));
|
|
178
|
+
export { CellContextKeyManager, CellContextKeyPart };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
2
|
+
import { CellContentPart } from '../cellPart.js';
|
|
3
|
+
class CellDecorations extends CellContentPart {
|
|
4
|
+
constructor(rootContainer, decorationContainer) {
|
|
5
|
+
super();
|
|
6
|
+
this.rootContainer = rootContainer;
|
|
7
|
+
this.decorationContainer = decorationContainer;
|
|
8
|
+
}
|
|
9
|
+
didRenderCell(element) {
|
|
10
|
+
const removedClassNames = [];
|
|
11
|
+
this.rootContainer.classList.forEach(className => {
|
|
12
|
+
if (/^nb\-.*$/.test(className)) {
|
|
13
|
+
removedClassNames.push(className);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
removedClassNames.forEach(className => {
|
|
17
|
+
this.rootContainer.classList.remove(className);
|
|
18
|
+
});
|
|
19
|
+
this.decorationContainer.innerText = '';
|
|
20
|
+
const generateCellTopDecorations = () => {
|
|
21
|
+
this.decorationContainer.innerText = '';
|
|
22
|
+
element.getCellDecorations().filter(options => options.topClassName !== undefined).forEach(options => {
|
|
23
|
+
this.decorationContainer.append(dom.$(`.${options.topClassName}`));
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
this.cellDisposables.add(element.onCellDecorationsChanged((e) => {
|
|
27
|
+
const modified = e.added.find(e => e.topClassName) || e.removed.find(e => e.topClassName);
|
|
28
|
+
if (modified) {
|
|
29
|
+
generateCellTopDecorations();
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
generateCellTopDecorations();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export { CellDecorations };
|