@codingame/monaco-vscode-api 1.85.0-next.2 → 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 +2540 -2533
- 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,564 @@
|
|
|
1
|
+
import { PixelRatio } from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { FontMeasurements } from 'monaco-editor/esm/vs/editor/browser/config/fontMeasurements.js';
|
|
5
|
+
import { BareFontInfo } from 'monaco-editor/esm/vs/editor/common/config/fontInfo.js';
|
|
6
|
+
import { NotebookSetting } from '../common/notebookCommon.js';
|
|
7
|
+
const SCROLLABLE_ELEMENT_PADDING_TOP = 18;
|
|
8
|
+
let EDITOR_TOP_PADDING = 12;
|
|
9
|
+
const editorTopPaddingChangeEmitter = ( new Emitter());
|
|
10
|
+
const EditorTopPaddingChangeEvent = editorTopPaddingChangeEmitter.event;
|
|
11
|
+
function updateEditorTopPadding(top) {
|
|
12
|
+
EDITOR_TOP_PADDING = top;
|
|
13
|
+
editorTopPaddingChangeEmitter.fire();
|
|
14
|
+
}
|
|
15
|
+
function getEditorTopPadding() {
|
|
16
|
+
return EDITOR_TOP_PADDING;
|
|
17
|
+
}
|
|
18
|
+
const OutputInnerContainerTopPadding = 4;
|
|
19
|
+
const defaultConfigConstants = ( Object.freeze({
|
|
20
|
+
codeCellLeftMargin: 28,
|
|
21
|
+
cellRunGutter: 32,
|
|
22
|
+
markdownCellTopMargin: 8,
|
|
23
|
+
markdownCellBottomMargin: 8,
|
|
24
|
+
markdownCellLeftMargin: 0,
|
|
25
|
+
markdownCellGutter: 32,
|
|
26
|
+
focusIndicatorLeftMargin: 4
|
|
27
|
+
}));
|
|
28
|
+
const compactConfigConstants = ( Object.freeze({
|
|
29
|
+
codeCellLeftMargin: 8,
|
|
30
|
+
cellRunGutter: 36,
|
|
31
|
+
markdownCellTopMargin: 6,
|
|
32
|
+
markdownCellBottomMargin: 6,
|
|
33
|
+
markdownCellLeftMargin: 8,
|
|
34
|
+
markdownCellGutter: 36,
|
|
35
|
+
focusIndicatorLeftMargin: 4
|
|
36
|
+
}));
|
|
37
|
+
class NotebookOptions extends Disposable {
|
|
38
|
+
constructor(configurationService, notebookExecutionStateService, isReadonly, overrides) {
|
|
39
|
+
super();
|
|
40
|
+
this.configurationService = configurationService;
|
|
41
|
+
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
42
|
+
this.isReadonly = isReadonly;
|
|
43
|
+
this.overrides = overrides;
|
|
44
|
+
this._onDidChangeOptions = this._register(( new Emitter()));
|
|
45
|
+
this.onDidChangeOptions = this._onDidChangeOptions.event;
|
|
46
|
+
const showCellStatusBar = this.configurationService.getValue(NotebookSetting.showCellStatusBar);
|
|
47
|
+
const globalToolbar = overrides?.globalToolbar ?? this.configurationService.getValue(NotebookSetting.globalToolbar) ?? true;
|
|
48
|
+
const stickyScroll = overrides?.stickyScroll ?? this.configurationService.getValue(NotebookSetting.stickyScroll) ?? false;
|
|
49
|
+
const consolidatedOutputButton = this.configurationService.getValue(NotebookSetting.consolidatedOutputButton) ?? true;
|
|
50
|
+
const consolidatedRunButton = this.configurationService.getValue(NotebookSetting.consolidatedRunButton) ?? false;
|
|
51
|
+
const dragAndDropEnabled = overrides?.dragAndDropEnabled ?? this.configurationService.getValue(NotebookSetting.dragAndDropEnabled) ?? true;
|
|
52
|
+
const cellToolbarLocation = this.configurationService.getValue(NotebookSetting.cellToolbarLocation) ?? { 'default': 'right' };
|
|
53
|
+
const cellToolbarInteraction = overrides?.cellToolbarInteraction ?? this.configurationService.getValue(NotebookSetting.cellToolbarVisibility);
|
|
54
|
+
const compactView = this.configurationService.getValue(NotebookSetting.compactView) ?? true;
|
|
55
|
+
const focusIndicator = this._computeFocusIndicatorOption();
|
|
56
|
+
const insertToolbarPosition = this._computeInsertToolbarPositionOption(this.isReadonly);
|
|
57
|
+
const insertToolbarAlignment = this._computeInsertToolbarAlignmentOption();
|
|
58
|
+
const showFoldingControls = this._computeShowFoldingControlsOption();
|
|
59
|
+
const fontSize = this.configurationService.getValue('editor.fontSize');
|
|
60
|
+
const markupFontSize = this.configurationService.getValue(NotebookSetting.markupFontSize);
|
|
61
|
+
const editorOptionsCustomizations = this.configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
|
|
62
|
+
const interactiveWindowCollapseCodeCells = this.configurationService.getValue(NotebookSetting.interactiveWindowCollapseCodeCells);
|
|
63
|
+
let outputLineHeightSettingValue;
|
|
64
|
+
const deprecatedOutputLineHeightSetting = this.configurationService.getValue(NotebookSetting.outputLineHeightDeprecated);
|
|
65
|
+
if (deprecatedOutputLineHeightSetting !== undefined) {
|
|
66
|
+
this._migrateDeprecatedSetting(NotebookSetting.outputLineHeightDeprecated, NotebookSetting.outputLineHeight);
|
|
67
|
+
outputLineHeightSettingValue = deprecatedOutputLineHeightSetting;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
outputLineHeightSettingValue = this.configurationService.getValue(NotebookSetting.outputLineHeight);
|
|
71
|
+
}
|
|
72
|
+
let outputFontSize;
|
|
73
|
+
const deprecatedOutputFontSizeSetting = this.configurationService.getValue(NotebookSetting.outputFontSizeDeprecated);
|
|
74
|
+
if (deprecatedOutputFontSizeSetting !== undefined) {
|
|
75
|
+
this._migrateDeprecatedSetting(NotebookSetting.outputFontSizeDeprecated, NotebookSetting.outputFontSize);
|
|
76
|
+
outputFontSize = deprecatedOutputFontSizeSetting;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
outputFontSize = this.configurationService.getValue(NotebookSetting.outputFontSize) || fontSize;
|
|
80
|
+
}
|
|
81
|
+
let outputFontFamily;
|
|
82
|
+
const deprecatedOutputFontFamilySetting = this.configurationService.getValue(NotebookSetting.outputFontFamilyDeprecated);
|
|
83
|
+
if (deprecatedOutputFontFamilySetting !== undefined) {
|
|
84
|
+
this._migrateDeprecatedSetting(NotebookSetting.outputFontFamilyDeprecated, NotebookSetting.outputFontFamily);
|
|
85
|
+
outputFontFamily = deprecatedOutputFontFamilySetting;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
outputFontFamily = this.configurationService.getValue(NotebookSetting.outputFontFamily);
|
|
89
|
+
}
|
|
90
|
+
let outputScrolling;
|
|
91
|
+
const deprecatedOutputScrollingSetting = this.configurationService.getValue(NotebookSetting.outputScrollingDeprecated);
|
|
92
|
+
if (deprecatedOutputScrollingSetting !== undefined) {
|
|
93
|
+
this._migrateDeprecatedSetting(NotebookSetting.outputScrollingDeprecated, NotebookSetting.outputScrolling);
|
|
94
|
+
outputScrolling = deprecatedOutputScrollingSetting;
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
outputScrolling = this.configurationService.getValue(NotebookSetting.outputScrolling);
|
|
98
|
+
}
|
|
99
|
+
const outputLineHeight = this._computeOutputLineHeight(outputLineHeightSettingValue, outputFontSize);
|
|
100
|
+
const outputWordWrap = this.configurationService.getValue(NotebookSetting.outputWordWrap);
|
|
101
|
+
const outputLineLimit = this.configurationService.getValue(NotebookSetting.textOutputLineLimit) ?? 30;
|
|
102
|
+
this._layoutConfiguration = {
|
|
103
|
+
...(compactView ? compactConfigConstants : defaultConfigConstants),
|
|
104
|
+
cellTopMargin: 6,
|
|
105
|
+
cellBottomMargin: 6,
|
|
106
|
+
cellRightMargin: 16,
|
|
107
|
+
cellStatusBarHeight: 22,
|
|
108
|
+
cellOutputPadding: 8,
|
|
109
|
+
markdownPreviewPadding: 8,
|
|
110
|
+
editorToolbarHeight: 0,
|
|
111
|
+
editorTopPadding: EDITOR_TOP_PADDING,
|
|
112
|
+
editorBottomPadding: 4,
|
|
113
|
+
editorBottomPaddingWithoutStatusBar: 12,
|
|
114
|
+
collapsedIndicatorHeight: 28,
|
|
115
|
+
showCellStatusBar,
|
|
116
|
+
globalToolbar,
|
|
117
|
+
stickyScroll,
|
|
118
|
+
consolidatedOutputButton,
|
|
119
|
+
consolidatedRunButton,
|
|
120
|
+
dragAndDropEnabled,
|
|
121
|
+
cellToolbarLocation,
|
|
122
|
+
cellToolbarInteraction,
|
|
123
|
+
compactView,
|
|
124
|
+
focusIndicator,
|
|
125
|
+
insertToolbarPosition,
|
|
126
|
+
insertToolbarAlignment,
|
|
127
|
+
showFoldingControls,
|
|
128
|
+
fontSize,
|
|
129
|
+
outputFontSize,
|
|
130
|
+
outputFontFamily,
|
|
131
|
+
outputLineHeight,
|
|
132
|
+
markupFontSize,
|
|
133
|
+
editorOptionsCustomizations,
|
|
134
|
+
focusIndicatorGap: 3,
|
|
135
|
+
interactiveWindowCollapseCodeCells,
|
|
136
|
+
markdownFoldHintHeight: 22,
|
|
137
|
+
outputScrolling: outputScrolling,
|
|
138
|
+
outputWordWrap: outputWordWrap,
|
|
139
|
+
outputLineLimit: outputLineLimit
|
|
140
|
+
};
|
|
141
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
142
|
+
this._updateConfiguration(e);
|
|
143
|
+
}));
|
|
144
|
+
this._register(EditorTopPaddingChangeEvent(() => {
|
|
145
|
+
const configuration = Object.assign({}, this._layoutConfiguration);
|
|
146
|
+
configuration.editorTopPadding = getEditorTopPadding();
|
|
147
|
+
this._layoutConfiguration = configuration;
|
|
148
|
+
this._onDidChangeOptions.fire({ editorTopPadding: true });
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
updateOptions(isReadonly) {
|
|
152
|
+
if (this.isReadonly !== isReadonly) {
|
|
153
|
+
this.isReadonly = isReadonly;
|
|
154
|
+
this._updateConfiguration({
|
|
155
|
+
affectsConfiguration(configuration) {
|
|
156
|
+
return configuration === NotebookSetting.insertToolbarLocation;
|
|
157
|
+
},
|
|
158
|
+
source: 7 ,
|
|
159
|
+
affectedKeys: ( new Set([NotebookSetting.insertToolbarLocation])),
|
|
160
|
+
change: { keys: [NotebookSetting.insertToolbarLocation], overrides: [] },
|
|
161
|
+
sourceConfig: undefined
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
_migrateDeprecatedSetting(deprecatedKey, key) {
|
|
166
|
+
const deprecatedSetting = this.configurationService.inspect(deprecatedKey);
|
|
167
|
+
if (deprecatedSetting.application !== undefined) {
|
|
168
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 1 );
|
|
169
|
+
this.configurationService.updateValue(key, deprecatedSetting.application.value, 1 );
|
|
170
|
+
}
|
|
171
|
+
if (deprecatedSetting.user !== undefined) {
|
|
172
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 2 );
|
|
173
|
+
this.configurationService.updateValue(key, deprecatedSetting.user.value, 2 );
|
|
174
|
+
}
|
|
175
|
+
if (deprecatedSetting.userLocal !== undefined) {
|
|
176
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 3 );
|
|
177
|
+
this.configurationService.updateValue(key, deprecatedSetting.userLocal.value, 3 );
|
|
178
|
+
}
|
|
179
|
+
if (deprecatedSetting.userRemote !== undefined) {
|
|
180
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 4 );
|
|
181
|
+
this.configurationService.updateValue(key, deprecatedSetting.userRemote.value, 4 );
|
|
182
|
+
}
|
|
183
|
+
if (deprecatedSetting.workspace !== undefined) {
|
|
184
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 5 );
|
|
185
|
+
this.configurationService.updateValue(key, deprecatedSetting.workspace.value, 5 );
|
|
186
|
+
}
|
|
187
|
+
if (deprecatedSetting.workspaceFolder !== undefined) {
|
|
188
|
+
this.configurationService.updateValue(deprecatedKey, undefined, 6 );
|
|
189
|
+
this.configurationService.updateValue(key, deprecatedSetting.workspaceFolder.value, 6 );
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
_computeOutputLineHeight(lineHeight, outputFontSize) {
|
|
193
|
+
const minimumLineHeight = 8;
|
|
194
|
+
if (lineHeight === 0) {
|
|
195
|
+
const editorOptions = this.configurationService.getValue('editor');
|
|
196
|
+
const fontInfo = FontMeasurements.readFontInfo(BareFontInfo.createFromRawSettings(editorOptions, PixelRatio.value));
|
|
197
|
+
lineHeight = fontInfo.lineHeight;
|
|
198
|
+
}
|
|
199
|
+
else if (lineHeight < minimumLineHeight) {
|
|
200
|
+
let fontSize = outputFontSize;
|
|
201
|
+
if (fontSize === 0) {
|
|
202
|
+
fontSize = this.configurationService.getValue('editor.fontSize');
|
|
203
|
+
}
|
|
204
|
+
lineHeight = lineHeight * fontSize;
|
|
205
|
+
}
|
|
206
|
+
lineHeight = Math.round(lineHeight);
|
|
207
|
+
if (lineHeight < minimumLineHeight) {
|
|
208
|
+
lineHeight = minimumLineHeight;
|
|
209
|
+
}
|
|
210
|
+
return lineHeight;
|
|
211
|
+
}
|
|
212
|
+
_updateConfiguration(e) {
|
|
213
|
+
const cellStatusBarVisibility = e.affectsConfiguration(NotebookSetting.showCellStatusBar);
|
|
214
|
+
const cellToolbarLocation = e.affectsConfiguration(NotebookSetting.cellToolbarLocation);
|
|
215
|
+
const cellToolbarInteraction = e.affectsConfiguration(NotebookSetting.cellToolbarVisibility);
|
|
216
|
+
const compactView = e.affectsConfiguration(NotebookSetting.compactView);
|
|
217
|
+
const focusIndicator = e.affectsConfiguration(NotebookSetting.focusIndicator);
|
|
218
|
+
const insertToolbarPosition = e.affectsConfiguration(NotebookSetting.insertToolbarLocation);
|
|
219
|
+
const insertToolbarAlignment = e.affectsConfiguration(NotebookSetting.experimentalInsertToolbarAlignment);
|
|
220
|
+
const globalToolbar = e.affectsConfiguration(NotebookSetting.globalToolbar);
|
|
221
|
+
const stickyScroll = e.affectsConfiguration(NotebookSetting.stickyScroll);
|
|
222
|
+
const consolidatedOutputButton = e.affectsConfiguration(NotebookSetting.consolidatedOutputButton);
|
|
223
|
+
const consolidatedRunButton = e.affectsConfiguration(NotebookSetting.consolidatedRunButton);
|
|
224
|
+
const showFoldingControls = e.affectsConfiguration(NotebookSetting.showFoldingControls);
|
|
225
|
+
const dragAndDropEnabled = e.affectsConfiguration(NotebookSetting.dragAndDropEnabled);
|
|
226
|
+
const fontSize = e.affectsConfiguration('editor.fontSize');
|
|
227
|
+
const outputFontSize = e.affectsConfiguration(NotebookSetting.outputFontSize);
|
|
228
|
+
const markupFontSize = e.affectsConfiguration(NotebookSetting.markupFontSize);
|
|
229
|
+
const fontFamily = e.affectsConfiguration('editor.fontFamily');
|
|
230
|
+
const outputFontFamily = e.affectsConfiguration(NotebookSetting.outputFontFamily);
|
|
231
|
+
const editorOptionsCustomizations = e.affectsConfiguration(NotebookSetting.cellEditorOptionsCustomizations);
|
|
232
|
+
const interactiveWindowCollapseCodeCells = e.affectsConfiguration(NotebookSetting.interactiveWindowCollapseCodeCells);
|
|
233
|
+
const outputLineHeight = e.affectsConfiguration(NotebookSetting.outputLineHeight);
|
|
234
|
+
const outputScrolling = e.affectsConfiguration(NotebookSetting.outputScrolling);
|
|
235
|
+
const outputWordWrap = e.affectsConfiguration(NotebookSetting.outputWordWrap);
|
|
236
|
+
if (!cellStatusBarVisibility
|
|
237
|
+
&& !cellToolbarLocation
|
|
238
|
+
&& !cellToolbarInteraction
|
|
239
|
+
&& !compactView
|
|
240
|
+
&& !focusIndicator
|
|
241
|
+
&& !insertToolbarPosition
|
|
242
|
+
&& !insertToolbarAlignment
|
|
243
|
+
&& !globalToolbar
|
|
244
|
+
&& !stickyScroll
|
|
245
|
+
&& !consolidatedOutputButton
|
|
246
|
+
&& !consolidatedRunButton
|
|
247
|
+
&& !showFoldingControls
|
|
248
|
+
&& !dragAndDropEnabled
|
|
249
|
+
&& !fontSize
|
|
250
|
+
&& !outputFontSize
|
|
251
|
+
&& !markupFontSize
|
|
252
|
+
&& !fontFamily
|
|
253
|
+
&& !outputFontFamily
|
|
254
|
+
&& !editorOptionsCustomizations
|
|
255
|
+
&& !interactiveWindowCollapseCodeCells
|
|
256
|
+
&& !outputLineHeight
|
|
257
|
+
&& !outputScrolling
|
|
258
|
+
&& !outputWordWrap) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
let configuration = Object.assign({}, this._layoutConfiguration);
|
|
262
|
+
if (cellStatusBarVisibility) {
|
|
263
|
+
configuration.showCellStatusBar = this.configurationService.getValue(NotebookSetting.showCellStatusBar);
|
|
264
|
+
}
|
|
265
|
+
if (cellToolbarLocation) {
|
|
266
|
+
configuration.cellToolbarLocation = this.configurationService.getValue(NotebookSetting.cellToolbarLocation) ?? { 'default': 'right' };
|
|
267
|
+
}
|
|
268
|
+
if (cellToolbarInteraction && !this.overrides?.cellToolbarInteraction) {
|
|
269
|
+
configuration.cellToolbarInteraction = this.configurationService.getValue(NotebookSetting.cellToolbarVisibility);
|
|
270
|
+
}
|
|
271
|
+
if (focusIndicator) {
|
|
272
|
+
configuration.focusIndicator = this._computeFocusIndicatorOption();
|
|
273
|
+
}
|
|
274
|
+
if (compactView) {
|
|
275
|
+
const compactViewValue = this.configurationService.getValue(NotebookSetting.compactView) ?? true;
|
|
276
|
+
configuration = Object.assign(configuration, {
|
|
277
|
+
...(compactViewValue ? compactConfigConstants : defaultConfigConstants),
|
|
278
|
+
});
|
|
279
|
+
configuration.compactView = compactViewValue;
|
|
280
|
+
}
|
|
281
|
+
if (insertToolbarAlignment) {
|
|
282
|
+
configuration.insertToolbarAlignment = this._computeInsertToolbarAlignmentOption();
|
|
283
|
+
}
|
|
284
|
+
if (insertToolbarPosition) {
|
|
285
|
+
configuration.insertToolbarPosition = this._computeInsertToolbarPositionOption(this.isReadonly);
|
|
286
|
+
}
|
|
287
|
+
if (globalToolbar && this.overrides?.globalToolbar === undefined) {
|
|
288
|
+
configuration.globalToolbar = this.configurationService.getValue(NotebookSetting.globalToolbar) ?? true;
|
|
289
|
+
}
|
|
290
|
+
if (stickyScroll && this.overrides?.stickyScroll === undefined) {
|
|
291
|
+
configuration.stickyScroll = this.configurationService.getValue(NotebookSetting.stickyScroll) ?? false;
|
|
292
|
+
}
|
|
293
|
+
if (consolidatedOutputButton) {
|
|
294
|
+
configuration.consolidatedOutputButton = this.configurationService.getValue(NotebookSetting.consolidatedOutputButton) ?? true;
|
|
295
|
+
}
|
|
296
|
+
if (consolidatedRunButton) {
|
|
297
|
+
configuration.consolidatedRunButton = this.configurationService.getValue(NotebookSetting.consolidatedRunButton) ?? true;
|
|
298
|
+
}
|
|
299
|
+
if (showFoldingControls) {
|
|
300
|
+
configuration.showFoldingControls = this._computeShowFoldingControlsOption();
|
|
301
|
+
}
|
|
302
|
+
if (dragAndDropEnabled) {
|
|
303
|
+
configuration.dragAndDropEnabled = this.configurationService.getValue(NotebookSetting.dragAndDropEnabled) ?? true;
|
|
304
|
+
}
|
|
305
|
+
if (fontSize) {
|
|
306
|
+
configuration.fontSize = this.configurationService.getValue('editor.fontSize');
|
|
307
|
+
}
|
|
308
|
+
if (outputFontSize || fontSize) {
|
|
309
|
+
configuration.outputFontSize = this.configurationService.getValue(NotebookSetting.outputFontSize) || configuration.fontSize;
|
|
310
|
+
}
|
|
311
|
+
if (markupFontSize) {
|
|
312
|
+
configuration.markupFontSize = this.configurationService.getValue(NotebookSetting.markupFontSize);
|
|
313
|
+
}
|
|
314
|
+
if (outputFontFamily) {
|
|
315
|
+
configuration.outputFontFamily = this.configurationService.getValue(NotebookSetting.outputFontFamily);
|
|
316
|
+
}
|
|
317
|
+
if (editorOptionsCustomizations) {
|
|
318
|
+
configuration.editorOptionsCustomizations = this.configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
|
|
319
|
+
}
|
|
320
|
+
if (interactiveWindowCollapseCodeCells) {
|
|
321
|
+
configuration.interactiveWindowCollapseCodeCells = this.configurationService.getValue(NotebookSetting.interactiveWindowCollapseCodeCells);
|
|
322
|
+
}
|
|
323
|
+
if (outputLineHeight || fontSize || outputFontSize) {
|
|
324
|
+
const lineHeight = this.configurationService.getValue(NotebookSetting.outputLineHeight);
|
|
325
|
+
configuration.outputLineHeight = this._computeOutputLineHeight(lineHeight, configuration.outputFontSize);
|
|
326
|
+
}
|
|
327
|
+
if (outputWordWrap) {
|
|
328
|
+
configuration.outputWordWrap = this.configurationService.getValue(NotebookSetting.outputWordWrap);
|
|
329
|
+
}
|
|
330
|
+
if (outputScrolling) {
|
|
331
|
+
configuration.outputScrolling = this.configurationService.getValue(NotebookSetting.outputScrolling);
|
|
332
|
+
}
|
|
333
|
+
this._layoutConfiguration = ( Object.freeze(configuration));
|
|
334
|
+
this._onDidChangeOptions.fire({
|
|
335
|
+
cellStatusBarVisibility,
|
|
336
|
+
cellToolbarLocation,
|
|
337
|
+
cellToolbarInteraction,
|
|
338
|
+
compactView,
|
|
339
|
+
focusIndicator,
|
|
340
|
+
insertToolbarPosition,
|
|
341
|
+
insertToolbarAlignment,
|
|
342
|
+
globalToolbar,
|
|
343
|
+
stickyScroll,
|
|
344
|
+
showFoldingControls,
|
|
345
|
+
consolidatedOutputButton,
|
|
346
|
+
consolidatedRunButton,
|
|
347
|
+
dragAndDropEnabled,
|
|
348
|
+
fontSize,
|
|
349
|
+
outputFontSize,
|
|
350
|
+
markupFontSize,
|
|
351
|
+
fontFamily,
|
|
352
|
+
outputFontFamily,
|
|
353
|
+
editorOptionsCustomizations,
|
|
354
|
+
interactiveWindowCollapseCodeCells,
|
|
355
|
+
outputLineHeight,
|
|
356
|
+
outputScrolling,
|
|
357
|
+
outputWordWrap
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
_computeInsertToolbarPositionOption(isReadOnly) {
|
|
361
|
+
return isReadOnly ? 'hidden' : this.configurationService.getValue(NotebookSetting.insertToolbarLocation) ?? 'both';
|
|
362
|
+
}
|
|
363
|
+
_computeInsertToolbarAlignmentOption() {
|
|
364
|
+
return this.configurationService.getValue(NotebookSetting.experimentalInsertToolbarAlignment) ?? 'center';
|
|
365
|
+
}
|
|
366
|
+
_computeShowFoldingControlsOption() {
|
|
367
|
+
return this.configurationService.getValue(NotebookSetting.showFoldingControls) ?? 'mouseover';
|
|
368
|
+
}
|
|
369
|
+
_computeFocusIndicatorOption() {
|
|
370
|
+
return this.configurationService.getValue(NotebookSetting.focusIndicator) ?? 'gutter';
|
|
371
|
+
}
|
|
372
|
+
getCellCollapseDefault() {
|
|
373
|
+
return this._layoutConfiguration.interactiveWindowCollapseCodeCells === 'never' ?
|
|
374
|
+
{
|
|
375
|
+
codeCell: {
|
|
376
|
+
inputCollapsed: false
|
|
377
|
+
}
|
|
378
|
+
} : {
|
|
379
|
+
codeCell: {
|
|
380
|
+
inputCollapsed: true
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
getLayoutConfiguration() {
|
|
385
|
+
return this._layoutConfiguration;
|
|
386
|
+
}
|
|
387
|
+
getDisplayOptions() {
|
|
388
|
+
return this._layoutConfiguration;
|
|
389
|
+
}
|
|
390
|
+
getCellEditorContainerLeftMargin() {
|
|
391
|
+
const { codeCellLeftMargin, cellRunGutter } = this._layoutConfiguration;
|
|
392
|
+
return codeCellLeftMargin + cellRunGutter;
|
|
393
|
+
}
|
|
394
|
+
computeCollapsedMarkdownCellHeight(viewType) {
|
|
395
|
+
const { bottomToolbarGap } = this.computeBottomToolbarDimensions(viewType);
|
|
396
|
+
return this._layoutConfiguration.markdownCellTopMargin
|
|
397
|
+
+ this._layoutConfiguration.collapsedIndicatorHeight
|
|
398
|
+
+ bottomToolbarGap
|
|
399
|
+
+ this._layoutConfiguration.markdownCellBottomMargin;
|
|
400
|
+
}
|
|
401
|
+
computeBottomToolbarOffset(totalHeight, viewType) {
|
|
402
|
+
const { bottomToolbarGap, bottomToolbarHeight } = this.computeBottomToolbarDimensions(viewType);
|
|
403
|
+
return totalHeight
|
|
404
|
+
- bottomToolbarGap
|
|
405
|
+
- bottomToolbarHeight / 2;
|
|
406
|
+
}
|
|
407
|
+
computeCodeCellEditorWidth(outerWidth) {
|
|
408
|
+
return outerWidth - (this._layoutConfiguration.codeCellLeftMargin
|
|
409
|
+
+ this._layoutConfiguration.cellRunGutter
|
|
410
|
+
+ this._layoutConfiguration.cellRightMargin);
|
|
411
|
+
}
|
|
412
|
+
computeMarkdownCellEditorWidth(outerWidth) {
|
|
413
|
+
return outerWidth
|
|
414
|
+
- this._layoutConfiguration.markdownCellGutter
|
|
415
|
+
- this._layoutConfiguration.markdownCellLeftMargin
|
|
416
|
+
- this._layoutConfiguration.cellRightMargin;
|
|
417
|
+
}
|
|
418
|
+
computeStatusBarHeight() {
|
|
419
|
+
return this._layoutConfiguration.cellStatusBarHeight;
|
|
420
|
+
}
|
|
421
|
+
_computeBottomToolbarDimensions(compactView, insertToolbarPosition, insertToolbarAlignment, cellToolbar) {
|
|
422
|
+
if (insertToolbarAlignment === 'left' || cellToolbar !== 'hidden') {
|
|
423
|
+
return {
|
|
424
|
+
bottomToolbarGap: 18,
|
|
425
|
+
bottomToolbarHeight: 18
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
if (insertToolbarPosition === 'betweenCells' || insertToolbarPosition === 'both') {
|
|
429
|
+
return compactView ? {
|
|
430
|
+
bottomToolbarGap: 12,
|
|
431
|
+
bottomToolbarHeight: 20
|
|
432
|
+
} : {
|
|
433
|
+
bottomToolbarGap: 20,
|
|
434
|
+
bottomToolbarHeight: 20
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
return {
|
|
439
|
+
bottomToolbarGap: 0,
|
|
440
|
+
bottomToolbarHeight: 0
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
computeBottomToolbarDimensions(viewType) {
|
|
445
|
+
const configuration = this._layoutConfiguration;
|
|
446
|
+
const cellToolbarPosition = this.computeCellToolbarLocation(viewType);
|
|
447
|
+
const { bottomToolbarGap, bottomToolbarHeight } = this._computeBottomToolbarDimensions(configuration.compactView, configuration.insertToolbarPosition, configuration.insertToolbarAlignment, cellToolbarPosition);
|
|
448
|
+
return {
|
|
449
|
+
bottomToolbarGap,
|
|
450
|
+
bottomToolbarHeight
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
computeCellToolbarLocation(viewType) {
|
|
454
|
+
const cellToolbarLocation = this._layoutConfiguration.cellToolbarLocation;
|
|
455
|
+
if (typeof cellToolbarLocation === 'string') {
|
|
456
|
+
if (cellToolbarLocation === 'left' || cellToolbarLocation === 'right' || cellToolbarLocation === 'hidden') {
|
|
457
|
+
return cellToolbarLocation;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
if (viewType) {
|
|
462
|
+
const notebookSpecificSetting = cellToolbarLocation[viewType] ?? cellToolbarLocation['default'];
|
|
463
|
+
let cellToolbarLocationForCurrentView = 'right';
|
|
464
|
+
switch (notebookSpecificSetting) {
|
|
465
|
+
case 'left':
|
|
466
|
+
cellToolbarLocationForCurrentView = 'left';
|
|
467
|
+
break;
|
|
468
|
+
case 'right':
|
|
469
|
+
cellToolbarLocationForCurrentView = 'right';
|
|
470
|
+
break;
|
|
471
|
+
case 'hidden':
|
|
472
|
+
cellToolbarLocationForCurrentView = 'hidden';
|
|
473
|
+
break;
|
|
474
|
+
default:
|
|
475
|
+
cellToolbarLocationForCurrentView = 'right';
|
|
476
|
+
break;
|
|
477
|
+
}
|
|
478
|
+
return cellToolbarLocationForCurrentView;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
return 'right';
|
|
482
|
+
}
|
|
483
|
+
computeTopInsertToolbarHeight(viewType) {
|
|
484
|
+
if (this._layoutConfiguration.insertToolbarPosition === 'betweenCells' || this._layoutConfiguration.insertToolbarPosition === 'both') {
|
|
485
|
+
return SCROLLABLE_ELEMENT_PADDING_TOP;
|
|
486
|
+
}
|
|
487
|
+
const cellToolbarLocation = this.computeCellToolbarLocation(viewType);
|
|
488
|
+
if (cellToolbarLocation === 'left' || cellToolbarLocation === 'right') {
|
|
489
|
+
return SCROLLABLE_ELEMENT_PADDING_TOP;
|
|
490
|
+
}
|
|
491
|
+
return 0;
|
|
492
|
+
}
|
|
493
|
+
computeEditorPadding(internalMetadata, cellUri) {
|
|
494
|
+
return {
|
|
495
|
+
top: getEditorTopPadding(),
|
|
496
|
+
bottom: this.statusBarIsVisible(internalMetadata, cellUri)
|
|
497
|
+
? this._layoutConfiguration.editorBottomPadding
|
|
498
|
+
: this._layoutConfiguration.editorBottomPaddingWithoutStatusBar
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
computeEditorStatusbarHeight(internalMetadata, cellUri) {
|
|
502
|
+
return this.statusBarIsVisible(internalMetadata, cellUri) ? this.computeStatusBarHeight() : 0;
|
|
503
|
+
}
|
|
504
|
+
statusBarIsVisible(internalMetadata, cellUri) {
|
|
505
|
+
const exe = this.notebookExecutionStateService.getCellExecution(cellUri);
|
|
506
|
+
if (this._layoutConfiguration.showCellStatusBar === 'visible') {
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
else if (this._layoutConfiguration.showCellStatusBar === 'visibleAfterExecute') {
|
|
510
|
+
return typeof internalMetadata.lastRunSuccess === 'boolean' || exe !== undefined;
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
computeWebviewOptions() {
|
|
517
|
+
return {
|
|
518
|
+
outputNodePadding: this._layoutConfiguration.cellOutputPadding,
|
|
519
|
+
outputNodeLeftPadding: this._layoutConfiguration.cellOutputPadding,
|
|
520
|
+
previewNodePadding: this._layoutConfiguration.markdownPreviewPadding,
|
|
521
|
+
markdownLeftMargin: this._layoutConfiguration.markdownCellGutter + this._layoutConfiguration.markdownCellLeftMargin,
|
|
522
|
+
leftMargin: this._layoutConfiguration.codeCellLeftMargin,
|
|
523
|
+
rightMargin: this._layoutConfiguration.cellRightMargin,
|
|
524
|
+
runGutter: this._layoutConfiguration.cellRunGutter,
|
|
525
|
+
dragAndDropEnabled: this._layoutConfiguration.dragAndDropEnabled,
|
|
526
|
+
fontSize: this._layoutConfiguration.fontSize,
|
|
527
|
+
outputFontSize: this._layoutConfiguration.outputFontSize,
|
|
528
|
+
outputFontFamily: this._layoutConfiguration.outputFontFamily,
|
|
529
|
+
markupFontSize: this._layoutConfiguration.markupFontSize,
|
|
530
|
+
outputLineHeight: this._layoutConfiguration.outputLineHeight,
|
|
531
|
+
outputScrolling: this._layoutConfiguration.outputScrolling,
|
|
532
|
+
outputWordWrap: this._layoutConfiguration.outputWordWrap,
|
|
533
|
+
outputLineLimit: this._layoutConfiguration.outputLineLimit,
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
computeDiffWebviewOptions() {
|
|
537
|
+
return {
|
|
538
|
+
outputNodePadding: this._layoutConfiguration.cellOutputPadding,
|
|
539
|
+
outputNodeLeftPadding: 0,
|
|
540
|
+
previewNodePadding: this._layoutConfiguration.markdownPreviewPadding,
|
|
541
|
+
markdownLeftMargin: 0,
|
|
542
|
+
leftMargin: 32,
|
|
543
|
+
rightMargin: 0,
|
|
544
|
+
runGutter: 0,
|
|
545
|
+
dragAndDropEnabled: false,
|
|
546
|
+
fontSize: this._layoutConfiguration.fontSize,
|
|
547
|
+
outputFontSize: this._layoutConfiguration.outputFontSize,
|
|
548
|
+
outputFontFamily: this._layoutConfiguration.outputFontFamily,
|
|
549
|
+
markupFontSize: this._layoutConfiguration.markupFontSize,
|
|
550
|
+
outputLineHeight: this._layoutConfiguration.outputLineHeight,
|
|
551
|
+
outputScrolling: this._layoutConfiguration.outputScrolling,
|
|
552
|
+
outputWordWrap: this._layoutConfiguration.outputWordWrap,
|
|
553
|
+
outputLineLimit: this._layoutConfiguration.outputLineLimit,
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
computeIndicatorPosition(totalHeight, foldHintHeight, viewType) {
|
|
557
|
+
const { bottomToolbarGap } = this.computeBottomToolbarDimensions(viewType);
|
|
558
|
+
return {
|
|
559
|
+
bottomIndicatorTop: totalHeight - bottomToolbarGap - this._layoutConfiguration.cellBottomMargin - foldHintHeight,
|
|
560
|
+
verticalIndicatorHeight: totalHeight - bottomToolbarGap - foldHintHeight
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
export { NotebookOptions, OutputInnerContainerTopPadding, getEditorTopPadding, updateEditorTopPadding };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var NotebookViewEventType;
|
|
2
|
+
( (function(NotebookViewEventType) {
|
|
3
|
+
NotebookViewEventType[NotebookViewEventType["LayoutChanged"] = 1] = "LayoutChanged";
|
|
4
|
+
NotebookViewEventType[NotebookViewEventType["MetadataChanged"] = 2] = "MetadataChanged";
|
|
5
|
+
NotebookViewEventType[NotebookViewEventType["CellStateChanged"] = 3] = "CellStateChanged";
|
|
6
|
+
})(NotebookViewEventType || (NotebookViewEventType = {})));
|
|
7
|
+
class NotebookLayoutChangedEvent {
|
|
8
|
+
constructor(source, value) {
|
|
9
|
+
this.source = source;
|
|
10
|
+
this.value = value;
|
|
11
|
+
this.type = NotebookViewEventType.LayoutChanged;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class NotebookMetadataChangedEvent {
|
|
15
|
+
constructor(source) {
|
|
16
|
+
this.source = source;
|
|
17
|
+
this.type = NotebookViewEventType.MetadataChanged;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class NotebookCellStateChangedEvent {
|
|
21
|
+
constructor(source, cell) {
|
|
22
|
+
this.source = source;
|
|
23
|
+
this.cell = cell;
|
|
24
|
+
this.type = NotebookViewEventType.CellStateChanged;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export { NotebookCellStateChangedEvent, NotebookLayoutChangedEvent, NotebookMetadataChangedEvent, NotebookViewEventType };
|