@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.
Files changed (239) hide show
  1. package/README.md +19 -10
  2. package/contributions.js +1 -0
  3. package/missing-services.js +91 -5
  4. package/monaco-editor-treemending.patch +2540 -2533
  5. package/package.json +6 -6
  6. package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
  9. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
  10. package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
  11. package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
  31. package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
  34. package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
  37. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
  38. package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
  39. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
  40. package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
  41. package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
  42. package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
  43. package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
  44. package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
  45. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
  46. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
  47. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
  48. package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
  49. package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
  50. package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
  51. package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
  52. package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
  53. package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
  54. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
  55. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
  56. package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
  57. package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
  58. package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
  59. package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
  60. package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
  61. package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
  62. package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
  63. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
  64. package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
  65. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
  66. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
  67. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
  68. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
  69. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
  70. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
  71. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
  72. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
  73. package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
  74. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
  75. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
  76. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
  77. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
  78. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
  79. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
  80. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
  81. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
  82. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
  83. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
  84. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
  85. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
  86. package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
  87. package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
  95. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
  96. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
  97. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
  98. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
  99. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
  100. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
  101. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
  102. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
  103. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
  104. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
  105. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
  106. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
  107. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
  108. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
  109. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
  110. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
  111. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
  112. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
  113. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
  114. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
  115. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
  116. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
  117. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
  118. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
  119. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
  120. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
  121. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
  122. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
  123. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
  175. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
  176. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
  177. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
  178. package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
  179. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
  180. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
  181. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
  182. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
  183. package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
  184. package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
  185. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
  186. package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
  187. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
  188. package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
  189. package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
  190. package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
  191. package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
  192. package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
  193. package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
  194. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
  195. package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
  196. package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
  197. package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
  198. package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
  199. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
  200. package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
  201. package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
  202. package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
  203. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
  204. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
  205. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
  206. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
  207. package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
  208. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
  209. package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
  210. package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
  211. package/assets/break.mp3 +0 -0
  212. package/assets/chatRequestSent.mp3 +0 -0
  213. package/assets/chatResponsePending.mp3 +0 -0
  214. package/assets/chatResponseReceived1.mp3 +0 -0
  215. package/assets/chatResponseReceived2.mp3 +0 -0
  216. package/assets/chatResponseReceived3.mp3 +0 -0
  217. package/assets/chatResponseReceived4.mp3 +0 -0
  218. package/assets/clear.mp3 +0 -0
  219. package/assets/defaultIcon.png +0 -0
  220. package/assets/diffLineDeleted.mp3 +0 -0
  221. package/assets/diffLineInserted.mp3 +0 -0
  222. package/assets/diffLineModified.mp3 +0 -0
  223. package/assets/error.mp3 +0 -0
  224. package/assets/fake.html +0 -10
  225. package/assets/foldedAreas.mp3 +0 -0
  226. package/assets/format.mp3 +0 -0
  227. package/assets/index-no-csp.html +0 -1226
  228. package/assets/index.html +0 -1227
  229. package/assets/quickFixes.mp3 +0 -0
  230. package/assets/save.mp3 +0 -0
  231. package/assets/service-worker.js +0 -457
  232. package/assets/taskCompleted.mp3 +0 -0
  233. package/assets/taskFailed.mp3 +0 -0
  234. package/assets/terminalBell.mp3 +0 -0
  235. package/assets/warning.mp3 +0 -0
  236. package/assets/webWorkerExtensionHostIframe.html +0 -123
  237. package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
  238. package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
  239. package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
@@ -0,0 +1,377 @@
1
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
2
+ import { Delayer } from 'monaco-editor/esm/vs/base/common/async.js';
3
+ import { Disposable, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
4
+ import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
5
+ import { expandCellRangesWithHiddenCells } from '../../notebookBrowser.js';
6
+ import { CellContentPart } from '../cellPart.js';
7
+ import { cloneNotebookCellTextModel } from '../../../common/model/notebookCellTextModel.js';
8
+ import { SelectionStateType } from '../../../common/notebookCommon.js';
9
+ import { cellRangesToIndexes } from '../../../common/notebookRange.js';
10
+ const $ = dom.$;
11
+ const DRAGGING_CLASS = 'cell-dragging';
12
+ const GLOBAL_DRAG_CLASS = 'global-drag-active';
13
+ class CellDragAndDropPart extends CellContentPart {
14
+ constructor(container) {
15
+ super();
16
+ this.container = container;
17
+ }
18
+ didRenderCell(element) {
19
+ this.update(element);
20
+ }
21
+ updateState(element, e) {
22
+ if (e.dragStateChanged) {
23
+ this.update(element);
24
+ }
25
+ }
26
+ update(element) {
27
+ this.container.classList.toggle(DRAGGING_CLASS, element.dragging);
28
+ }
29
+ }
30
+ class CellDragAndDropController extends Disposable {
31
+ constructor(notebookEditor, notebookListContainer) {
32
+ super();
33
+ this.notebookEditor = notebookEditor;
34
+ this.notebookListContainer = notebookListContainer;
35
+ this.draggedCells = [];
36
+ this.isScrolling = false;
37
+ this.listOnWillScrollListener = this._register(( new MutableDisposable()));
38
+ this.listInsertionIndicator = dom.append(notebookListContainer, $('.cell-list-insertion-indicator'));
39
+ this._register(dom.addDisposableListener(notebookListContainer.ownerDocument.body, dom.EventType.DRAG_START, this.onGlobalDragStart.bind(this), true));
40
+ this._register(dom.addDisposableListener(notebookListContainer.ownerDocument.body, dom.EventType.DRAG_END, this.onGlobalDragEnd.bind(this), true));
41
+ const addCellDragListener = (eventType, handler, useCapture = false) => {
42
+ this._register(dom.addDisposableListener(notebookEditor.getDomNode(), eventType, e => {
43
+ const cellDragEvent = this.toCellDragEvent(e);
44
+ if (cellDragEvent) {
45
+ handler(cellDragEvent);
46
+ }
47
+ }, useCapture));
48
+ };
49
+ addCellDragListener(dom.EventType.DRAG_OVER, event => {
50
+ if (!this.currentDraggedCell) {
51
+ return;
52
+ }
53
+ event.browserEvent.preventDefault();
54
+ this.onCellDragover(event);
55
+ }, true);
56
+ addCellDragListener(dom.EventType.DROP, event => {
57
+ if (!this.currentDraggedCell) {
58
+ return;
59
+ }
60
+ event.browserEvent.preventDefault();
61
+ this.onCellDrop(event);
62
+ });
63
+ addCellDragListener(dom.EventType.DRAG_LEAVE, event => {
64
+ event.browserEvent.preventDefault();
65
+ this.onCellDragLeave(event);
66
+ });
67
+ this.scrollingDelayer = this._register(( new Delayer(200)));
68
+ }
69
+ setList(value) {
70
+ this.list = value;
71
+ this.listOnWillScrollListener.value = this.list.onWillScroll(e => {
72
+ if (!e.scrollTopChanged) {
73
+ return;
74
+ }
75
+ this.setInsertIndicatorVisibility(false);
76
+ this.isScrolling = true;
77
+ this.scrollingDelayer.trigger(() => {
78
+ this.isScrolling = false;
79
+ });
80
+ });
81
+ }
82
+ setInsertIndicatorVisibility(visible) {
83
+ this.listInsertionIndicator.style.opacity = visible ? '1' : '0';
84
+ }
85
+ toCellDragEvent(event) {
86
+ const targetTop = this.notebookListContainer.getBoundingClientRect().top;
87
+ const dragOffset = this.list.scrollTop + event.clientY - targetTop;
88
+ const draggedOverCell = this.list.elementAt(dragOffset);
89
+ if (!draggedOverCell) {
90
+ return undefined;
91
+ }
92
+ const cellTop = this.list.getCellViewScrollTop(draggedOverCell);
93
+ const cellHeight = this.list.elementHeight(draggedOverCell);
94
+ const dragPosInElement = dragOffset - cellTop;
95
+ const dragPosRatio = dragPosInElement / cellHeight;
96
+ return {
97
+ browserEvent: event,
98
+ draggedOverCell,
99
+ cellTop,
100
+ cellHeight,
101
+ dragPosRatio
102
+ };
103
+ }
104
+ clearGlobalDragState() {
105
+ this.notebookEditor.getDomNode().classList.remove(GLOBAL_DRAG_CLASS);
106
+ }
107
+ onGlobalDragStart() {
108
+ this.notebookEditor.getDomNode().classList.add(GLOBAL_DRAG_CLASS);
109
+ }
110
+ onGlobalDragEnd() {
111
+ this.notebookEditor.getDomNode().classList.remove(GLOBAL_DRAG_CLASS);
112
+ }
113
+ onCellDragover(event) {
114
+ if (!event.browserEvent.dataTransfer) {
115
+ return;
116
+ }
117
+ if (!this.currentDraggedCell) {
118
+ event.browserEvent.dataTransfer.dropEffect = 'none';
119
+ return;
120
+ }
121
+ if (this.isScrolling || this.currentDraggedCell === event.draggedOverCell) {
122
+ this.setInsertIndicatorVisibility(false);
123
+ return;
124
+ }
125
+ const dropDirection = this.getDropInsertDirection(event.dragPosRatio);
126
+ const insertionIndicatorAbsolutePos = dropDirection === 'above' ? event.cellTop : event.cellTop + event.cellHeight;
127
+ this.updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos);
128
+ }
129
+ updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos) {
130
+ const { bottomToolbarGap } = this.notebookEditor.notebookOptions.computeBottomToolbarDimensions(this.notebookEditor.textModel?.viewType);
131
+ const insertionIndicatorTop = insertionIndicatorAbsolutePos - this.list.scrollTop + bottomToolbarGap / 2;
132
+ if (insertionIndicatorTop >= 0) {
133
+ this.listInsertionIndicator.style.top = `${insertionIndicatorTop}px`;
134
+ this.setInsertIndicatorVisibility(true);
135
+ }
136
+ else {
137
+ this.setInsertIndicatorVisibility(false);
138
+ }
139
+ }
140
+ getDropInsertDirection(dragPosRatio) {
141
+ return dragPosRatio < 0.5 ? 'above' : 'below';
142
+ }
143
+ onCellDrop(event) {
144
+ const draggedCell = this.currentDraggedCell;
145
+ if (this.isScrolling || this.currentDraggedCell === event.draggedOverCell) {
146
+ return;
147
+ }
148
+ this.dragCleanup();
149
+ const dropDirection = this.getDropInsertDirection(event.dragPosRatio);
150
+ this._dropImpl(draggedCell, dropDirection, event.browserEvent, event.draggedOverCell);
151
+ }
152
+ getCellRangeAroundDragTarget(draggedCellIndex) {
153
+ const selections = this.notebookEditor.getSelections();
154
+ const modelRanges = expandCellRangesWithHiddenCells(this.notebookEditor, selections);
155
+ const nearestRange = modelRanges.find(range => range.start <= draggedCellIndex && draggedCellIndex < range.end);
156
+ if (nearestRange) {
157
+ return nearestRange;
158
+ }
159
+ else {
160
+ return { start: draggedCellIndex, end: draggedCellIndex + 1 };
161
+ }
162
+ }
163
+ _dropImpl(draggedCell, dropDirection, ctx, draggedOverCell) {
164
+ const cellTop = this.list.getCellViewScrollTop(draggedOverCell);
165
+ const cellHeight = this.list.elementHeight(draggedOverCell);
166
+ const insertionIndicatorAbsolutePos = dropDirection === 'above' ? cellTop : cellTop + cellHeight;
167
+ const { bottomToolbarGap } = this.notebookEditor.notebookOptions.computeBottomToolbarDimensions(this.notebookEditor.textModel?.viewType);
168
+ const insertionIndicatorTop = insertionIndicatorAbsolutePos - this.list.scrollTop + bottomToolbarGap / 2;
169
+ const editorHeight = this.notebookEditor.getDomNode().getBoundingClientRect().height;
170
+ if (insertionIndicatorTop < 0 || insertionIndicatorTop > editorHeight) {
171
+ return;
172
+ }
173
+ const isCopy = (ctx.ctrlKey && !platform.isMacintosh) || (ctx.altKey && platform.isMacintosh);
174
+ if (!this.notebookEditor.hasModel()) {
175
+ return;
176
+ }
177
+ const textModel = this.notebookEditor.textModel;
178
+ if (isCopy) {
179
+ const draggedCellIndex = this.notebookEditor.getCellIndex(draggedCell);
180
+ const range = this.getCellRangeAroundDragTarget(draggedCellIndex);
181
+ let originalToIdx = this.notebookEditor.getCellIndex(draggedOverCell);
182
+ if (dropDirection === 'below') {
183
+ const relativeToIndex = this.notebookEditor.getCellIndex(draggedOverCell);
184
+ const newIdx = this.notebookEditor.getNextVisibleCellIndex(relativeToIndex);
185
+ originalToIdx = newIdx;
186
+ }
187
+ let finalSelection;
188
+ let finalFocus;
189
+ if (originalToIdx <= range.start) {
190
+ finalSelection = { start: originalToIdx, end: originalToIdx + range.end - range.start };
191
+ finalFocus = { start: originalToIdx + draggedCellIndex - range.start, end: originalToIdx + draggedCellIndex - range.start + 1 };
192
+ }
193
+ else {
194
+ const delta = (originalToIdx - range.start);
195
+ finalSelection = { start: range.start + delta, end: range.end + delta };
196
+ finalFocus = { start: draggedCellIndex + delta, end: draggedCellIndex + delta + 1 };
197
+ }
198
+ textModel.applyEdits([
199
+ {
200
+ editType: 1 ,
201
+ index: originalToIdx,
202
+ count: 0,
203
+ cells: ( cellRangesToIndexes([range]).map(
204
+ index => cloneNotebookCellTextModel(this.notebookEditor.cellAt(index).model)
205
+ ))
206
+ }
207
+ ], true, { kind: SelectionStateType.Index, focus: this.notebookEditor.getFocus(), selections: this.notebookEditor.getSelections() }, () => ({ kind: SelectionStateType.Index, focus: finalFocus, selections: [finalSelection] }), undefined, true);
208
+ this.notebookEditor.revealCellRangeInView(finalSelection);
209
+ }
210
+ else {
211
+ performCellDropEdits(this.notebookEditor, draggedCell, dropDirection, draggedOverCell);
212
+ }
213
+ }
214
+ onCellDragLeave(event) {
215
+ if (!event.browserEvent.relatedTarget || !dom.isAncestor(event.browserEvent.relatedTarget, this.notebookEditor.getDomNode())) {
216
+ this.setInsertIndicatorVisibility(false);
217
+ }
218
+ }
219
+ dragCleanup() {
220
+ if (this.currentDraggedCell) {
221
+ this.draggedCells.forEach(cell => cell.dragging = false);
222
+ this.currentDraggedCell = undefined;
223
+ this.draggedCells = [];
224
+ }
225
+ this.setInsertIndicatorVisibility(false);
226
+ }
227
+ registerDragHandle(templateData, cellRoot, dragHandles, dragImageProvider) {
228
+ const container = templateData.container;
229
+ for (const dragHandle of dragHandles) {
230
+ dragHandle.setAttribute('draggable', 'true');
231
+ }
232
+ const onDragEnd = () => {
233
+ if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
234
+ return;
235
+ }
236
+ container.classList.remove(DRAGGING_CLASS);
237
+ this.dragCleanup();
238
+ };
239
+ for (const dragHandle of dragHandles) {
240
+ templateData.templateDisposables.add(dom.addDisposableListener(dragHandle, dom.EventType.DRAG_END, onDragEnd));
241
+ }
242
+ const onDragStart = (event) => {
243
+ if (!event.dataTransfer) {
244
+ return;
245
+ }
246
+ if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
247
+ return;
248
+ }
249
+ this.currentDraggedCell = templateData.currentRenderedCell;
250
+ this.draggedCells = ( this.notebookEditor.getSelections().map(range => this.notebookEditor.getCellsInRange(range))).flat();
251
+ this.draggedCells.forEach(cell => cell.dragging = true);
252
+ const dragImage = dragImageProvider();
253
+ cellRoot.parentElement.appendChild(dragImage);
254
+ event.dataTransfer.setDragImage(dragImage, 0, 0);
255
+ setTimeout(() => cellRoot.parentElement.removeChild(dragImage), 0);
256
+ };
257
+ for (const dragHandle of dragHandles) {
258
+ templateData.templateDisposables.add(dom.addDisposableListener(dragHandle, dom.EventType.DRAG_START, onDragStart));
259
+ }
260
+ }
261
+ startExplicitDrag(cell, _dragOffsetY) {
262
+ if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
263
+ return;
264
+ }
265
+ this.currentDraggedCell = cell;
266
+ this.setInsertIndicatorVisibility(true);
267
+ }
268
+ explicitDrag(cell, dragOffsetY) {
269
+ if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
270
+ return;
271
+ }
272
+ const target = this.list.elementAt(dragOffsetY);
273
+ if (target && target !== cell) {
274
+ const cellTop = this.list.getCellViewScrollTop(target);
275
+ const cellHeight = this.list.elementHeight(target);
276
+ const dropDirection = this.getExplicitDragDropDirection(dragOffsetY, cellTop, cellHeight);
277
+ const insertionIndicatorAbsolutePos = dropDirection === 'above' ? cellTop : cellTop + cellHeight;
278
+ this.updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos);
279
+ }
280
+ if (this.currentDraggedCell !== cell) {
281
+ return;
282
+ }
283
+ const notebookViewRect = this.notebookEditor.getDomNode().getBoundingClientRect();
284
+ const eventPositionInView = dragOffsetY - this.list.scrollTop;
285
+ const notebookViewScrollMargins = 0.2;
286
+ const maxScrollDeltaPerFrame = 20;
287
+ const eventPositionRatio = eventPositionInView / notebookViewRect.height;
288
+ if (eventPositionRatio < notebookViewScrollMargins) {
289
+ this.list.scrollTop -= maxScrollDeltaPerFrame * (1 - eventPositionRatio / notebookViewScrollMargins);
290
+ }
291
+ else if (eventPositionRatio > 1 - notebookViewScrollMargins) {
292
+ this.list.scrollTop += maxScrollDeltaPerFrame * (1 - ((1 - eventPositionRatio) / notebookViewScrollMargins));
293
+ }
294
+ }
295
+ endExplicitDrag(_cell) {
296
+ this.setInsertIndicatorVisibility(false);
297
+ }
298
+ explicitDrop(cell, ctx) {
299
+ this.currentDraggedCell = undefined;
300
+ this.setInsertIndicatorVisibility(false);
301
+ const target = this.list.elementAt(ctx.dragOffsetY);
302
+ if (!target || target === cell) {
303
+ return;
304
+ }
305
+ const cellTop = this.list.getCellViewScrollTop(target);
306
+ const cellHeight = this.list.elementHeight(target);
307
+ const dropDirection = this.getExplicitDragDropDirection(ctx.dragOffsetY, cellTop, cellHeight);
308
+ this._dropImpl(cell, dropDirection, ctx, target);
309
+ }
310
+ getExplicitDragDropDirection(clientY, cellTop, cellHeight) {
311
+ const dragPosInElement = clientY - cellTop;
312
+ const dragPosRatio = dragPosInElement / cellHeight;
313
+ return this.getDropInsertDirection(dragPosRatio);
314
+ }
315
+ dispose() {
316
+ this.notebookEditor = null;
317
+ super.dispose();
318
+ }
319
+ }
320
+ function performCellDropEdits(editor, draggedCell, dropDirection, draggedOverCell) {
321
+ const draggedCellIndex = editor.getCellIndex(draggedCell);
322
+ let originalToIdx = editor.getCellIndex(draggedOverCell);
323
+ if (typeof draggedCellIndex !== 'number' || typeof originalToIdx !== 'number') {
324
+ return;
325
+ }
326
+ if (dropDirection === 'below') {
327
+ const newIdx = editor.getNextVisibleCellIndex(originalToIdx) ?? originalToIdx;
328
+ originalToIdx = newIdx;
329
+ }
330
+ let selections = editor.getSelections();
331
+ if (!selections.length) {
332
+ selections = [editor.getFocus()];
333
+ }
334
+ let originalFocusIdx = editor.getFocus().start;
335
+ if (!( selections.some(s => s.start <= draggedCellIndex && s.end > draggedCellIndex))) {
336
+ selections = [{ start: draggedCellIndex, end: draggedCellIndex + 1 }];
337
+ originalFocusIdx = draggedCellIndex;
338
+ }
339
+ const droppedInSelection = selections.find(range => range.start <= originalToIdx && range.end > originalToIdx);
340
+ if (droppedInSelection) {
341
+ originalToIdx = droppedInSelection.start;
342
+ }
343
+ let numCells = 0;
344
+ let focusNewIdx = originalToIdx;
345
+ let newInsertionIdx = originalToIdx;
346
+ selections.sort((a, b) => b.start - a.start);
347
+ const edits = ( selections.map(range => {
348
+ const length = range.end - range.start;
349
+ let toIndexDelta = 0;
350
+ if (range.end <= newInsertionIdx) {
351
+ toIndexDelta = -length;
352
+ }
353
+ const newIdx = newInsertionIdx + toIndexDelta;
354
+ if (originalFocusIdx >= range.start && originalFocusIdx <= range.end) {
355
+ const offset = originalFocusIdx - range.start;
356
+ focusNewIdx = newIdx + offset;
357
+ }
358
+ const fromIndexDelta = range.start >= originalToIdx ? numCells : 0;
359
+ const edit = {
360
+ editType: 6 ,
361
+ index: range.start + fromIndexDelta,
362
+ length,
363
+ newIdx
364
+ };
365
+ numCells += length;
366
+ if (range.end < newInsertionIdx) {
367
+ newInsertionIdx -= length;
368
+ }
369
+ return edit;
370
+ }));
371
+ const lastEdit = edits[edits.length - 1];
372
+ const finalSelection = { start: lastEdit.newIdx, end: lastEdit.newIdx + numCells };
373
+ const finalFocus = { start: focusNewIdx, end: focusNewIdx + 1 };
374
+ editor.textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => ({ kind: SelectionStateType.Index, focus: finalFocus, selections: [finalSelection] }), undefined, true);
375
+ editor.revealCellRangeInView(finalSelection);
376
+ }
377
+ export { CellDragAndDropController, CellDragAndDropPart, performCellDropEdits };
@@ -0,0 +1,97 @@
1
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
2
+ import { createTrustedTypesPolicy } from 'monaco-editor/esm/vs/base/browser/trustedTypes.js';
3
+ import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
4
+ import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
5
+ import { Range } from 'monaco-editor/esm/vs/editor/common/core/range.js';
6
+ import * as languages from 'monaco-editor/esm/vs/editor/common/languages.js';
7
+ import { tokenizeLineToHTML } from 'monaco-editor/esm/vs/editor/common/languages/textToHtmlTokenizer.js';
8
+ class EditorTextRenderer {
9
+ static { this._ttPolicy = createTrustedTypesPolicy('cellRendererEditorText', {
10
+ createHTML(input) { return input; }
11
+ }); }
12
+ getRichText(editor, modelRange) {
13
+ const model = editor.getModel();
14
+ if (!model) {
15
+ return null;
16
+ }
17
+ const colorMap = this.getDefaultColorMap();
18
+ const fontInfo = editor.getOptions().get(50 );
19
+ const fontFamilyVar = '--notebook-editor-font-family';
20
+ const fontSizeVar = '--notebook-editor-font-size';
21
+ const fontWeightVar = '--notebook-editor-font-weight';
22
+ const style = ``
23
+ + `color: ${colorMap[1 ]};`
24
+ + `background-color: ${colorMap[2 ]};`
25
+ + `font-family: var(${fontFamilyVar});`
26
+ + `font-weight: var(${fontWeightVar});`
27
+ + `font-size: var(${fontSizeVar});`
28
+ + `line-height: ${fontInfo.lineHeight}px;`
29
+ + `white-space: pre;`;
30
+ const element = dom.$('div', { style });
31
+ const fontSize = fontInfo.fontSize;
32
+ const fontWeight = fontInfo.fontWeight;
33
+ element.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
34
+ element.style.setProperty(fontSizeVar, `${fontSize}px`);
35
+ element.style.setProperty(fontWeightVar, fontWeight);
36
+ const linesHtml = this.getRichTextLinesAsHtml(model, modelRange, colorMap);
37
+ element.innerHTML = linesHtml;
38
+ return element;
39
+ }
40
+ getRichTextLinesAsHtml(model, modelRange, colorMap) {
41
+ const startLineNumber = modelRange.startLineNumber;
42
+ const startColumn = modelRange.startColumn;
43
+ const endLineNumber = modelRange.endLineNumber;
44
+ const endColumn = modelRange.endColumn;
45
+ const tabSize = model.getOptions().tabSize;
46
+ let result = '';
47
+ for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
48
+ const lineTokens = model.tokenization.getLineTokens(lineNumber);
49
+ const lineContent = lineTokens.getLineContent();
50
+ const startOffset = (lineNumber === startLineNumber ? startColumn - 1 : 0);
51
+ const endOffset = (lineNumber === endLineNumber ? endColumn - 1 : lineContent.length);
52
+ if (lineContent === '') {
53
+ result += '<br>';
54
+ }
55
+ else {
56
+ result += tokenizeLineToHTML(lineContent, lineTokens.inflate(), colorMap, startOffset, endOffset, tabSize, platform.isWindows);
57
+ }
58
+ }
59
+ return EditorTextRenderer._ttPolicy?.createHTML(result) ?? result;
60
+ }
61
+ getDefaultColorMap() {
62
+ const colorMap = languages.TokenizationRegistry.getColorMap();
63
+ const result = ['#000000'];
64
+ if (colorMap) {
65
+ for (let i = 1, len = colorMap.length; i < len; i++) {
66
+ result[i] = Color.Format.CSS.formatHex(colorMap[i]);
67
+ }
68
+ }
69
+ return result;
70
+ }
71
+ }
72
+ class CodeCellDragImageRenderer {
73
+ getDragImage(templateData, editor, type) {
74
+ let dragImage = this.getDragImageImpl(templateData, editor, type);
75
+ if (!dragImage) {
76
+ dragImage = document.createElement('div');
77
+ dragImage.textContent = '1 cell';
78
+ }
79
+ return dragImage;
80
+ }
81
+ getDragImageImpl(templateData, editor, type) {
82
+ const dragImageContainer = templateData.container.cloneNode(true);
83
+ dragImageContainer.classList.forEach(c => dragImageContainer.classList.remove(c));
84
+ dragImageContainer.classList.add('cell-drag-image', 'monaco-list-row', 'focused', `${type}-cell-row`);
85
+ const editorContainer = dragImageContainer.querySelector('.cell-editor-container');
86
+ if (!editorContainer) {
87
+ return null;
88
+ }
89
+ const richEditorText = ( new EditorTextRenderer()).getRichText(editor, ( new Range(1, 1, 1, 1000)));
90
+ if (!richEditorText) {
91
+ return null;
92
+ }
93
+ dom.reset(editorContainer, richEditorText);
94
+ return dragImageContainer;
95
+ }
96
+ }
97
+ export { CodeCellDragImageRenderer };
@@ -0,0 +1,194 @@
1
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
2
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
3
+ import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
4
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
5
+ import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
6
+ import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
7
+ import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
8
+ import { ActiveEditorContext } from '../../../../../common/contextkeys.js';
9
+ import { NOTEBOOK_ACTIONS_CATEGORY, NotebookMultiCellAction } from '../../controller/coreActions.js';
10
+ import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_LINE_NUMBERS } from '../../../common/notebookContextKeys.js';
11
+ import { CellContentPart } from '../cellPart.js';
12
+ import { NOTEBOOK_EDITOR_ID } from '../../../common/notebookCommon.js';
13
+ class CellEditorOptions extends CellContentPart {
14
+ constructor(base, notebookOptions, configurationService) {
15
+ super();
16
+ this.base = base;
17
+ this.notebookOptions = notebookOptions;
18
+ this.configurationService = configurationService;
19
+ this._lineNumbers = 'inherit';
20
+ this._onDidChange = this._register(( new Emitter()));
21
+ this.onDidChange = this._onDidChange.event;
22
+ this._register(base.onDidChange(() => {
23
+ this._recomputeOptions();
24
+ }));
25
+ this._value = this._computeEditorOptions();
26
+ }
27
+ updateState(element, e) {
28
+ if (e.cellLineNumberChanged) {
29
+ this.setLineNumbers(element.lineNumbers);
30
+ }
31
+ }
32
+ _recomputeOptions() {
33
+ this._value = this._computeEditorOptions();
34
+ this._onDidChange.fire();
35
+ }
36
+ _computeEditorOptions() {
37
+ const value = this.base.value;
38
+ let cellRenderLineNumber = value.lineNumbers;
39
+ switch (this._lineNumbers) {
40
+ case 'inherit':
41
+ if (this.configurationService.getValue('notebook.lineNumbers') === 'on') {
42
+ if (value.lineNumbers === 'off') {
43
+ cellRenderLineNumber = 'on';
44
+ }
45
+ }
46
+ else {
47
+ cellRenderLineNumber = 'off';
48
+ }
49
+ break;
50
+ case 'on':
51
+ if (value.lineNumbers === 'off') {
52
+ cellRenderLineNumber = 'on';
53
+ }
54
+ break;
55
+ case 'off':
56
+ cellRenderLineNumber = 'off';
57
+ break;
58
+ }
59
+ if (value.lineNumbers !== cellRenderLineNumber) {
60
+ return {
61
+ ...value,
62
+ ...{ lineNumbers: cellRenderLineNumber }
63
+ };
64
+ }
65
+ else {
66
+ return Object.assign({}, value);
67
+ }
68
+ }
69
+ getUpdatedValue(internalMetadata, cellUri) {
70
+ const options = this.getValue(internalMetadata, cellUri);
71
+ delete options.hover;
72
+ return options;
73
+ }
74
+ getValue(internalMetadata, cellUri) {
75
+ return {
76
+ ...this._value,
77
+ ...{
78
+ padding: this.notebookOptions.computeEditorPadding(internalMetadata, cellUri)
79
+ }
80
+ };
81
+ }
82
+ getDefaultValue() {
83
+ return {
84
+ ...this._value,
85
+ ...{
86
+ padding: { top: 12, bottom: 12 }
87
+ }
88
+ };
89
+ }
90
+ setLineNumbers(lineNumbers) {
91
+ this._lineNumbers = lineNumbers;
92
+ this._recomputeOptions();
93
+ }
94
+ }
95
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
96
+ id: 'notebook',
97
+ order: 100,
98
+ type: 'object',
99
+ 'properties': {
100
+ 'notebook.lineNumbers': {
101
+ type: 'string',
102
+ enum: ['off', 'on'],
103
+ default: 'off',
104
+ markdownDescription: ( localizeWithPath(
105
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions',
106
+ 'notebook.lineNumbers',
107
+ "Controls the display of line numbers in the cell editor."
108
+ ))
109
+ }
110
+ }
111
+ });
112
+ registerAction2(class ToggleLineNumberAction extends Action2 {
113
+ constructor() {
114
+ super({
115
+ id: 'notebook.toggleLineNumbers',
116
+ title: { value: ( localizeWithPath(
117
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions',
118
+ 'notebook.toggleLineNumbers',
119
+ "Toggle Notebook Line Numbers"
120
+ )), original: 'Toggle Notebook Line Numbers' },
121
+ precondition: NOTEBOOK_EDITOR_FOCUSED,
122
+ menu: [
123
+ {
124
+ id: MenuId.NotebookToolbar,
125
+ group: 'notebookLayout',
126
+ order: 2,
127
+ when: ( ContextKeyExpr.equals('config.notebook.globalToolbar', true))
128
+ }
129
+ ],
130
+ category: NOTEBOOK_ACTIONS_CATEGORY,
131
+ f1: true,
132
+ toggled: {
133
+ condition: ( ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off')),
134
+ title: ( localizeWithPath(
135
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions',
136
+ 'notebook.showLineNumbers',
137
+ "Notebook Line Numbers"
138
+ )),
139
+ }
140
+ });
141
+ }
142
+ async run(accessor) {
143
+ const configurationService = accessor.get(IConfigurationService);
144
+ const renderLiNumbers = configurationService.getValue('notebook.lineNumbers') === 'on';
145
+ if (renderLiNumbers) {
146
+ configurationService.updateValue('notebook.lineNumbers', 'off');
147
+ }
148
+ else {
149
+ configurationService.updateValue('notebook.lineNumbers', 'on');
150
+ }
151
+ }
152
+ });
153
+ registerAction2(class ToggleActiveLineNumberAction extends NotebookMultiCellAction {
154
+ constructor() {
155
+ super({
156
+ id: 'notebook.cell.toggleLineNumbers',
157
+ title: ( localizeWithPath(
158
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions',
159
+ 'notebook.cell.toggleLineNumbers.title',
160
+ "Show Cell Line Numbers"
161
+ )),
162
+ precondition: ( ActiveEditorContext.isEqualTo(NOTEBOOK_EDITOR_ID)),
163
+ menu: [{
164
+ id: MenuId.NotebookCellTitle,
165
+ group: 'View',
166
+ order: 1
167
+ }],
168
+ toggled: ( ContextKeyExpr.or(( NOTEBOOK_CELL_LINE_NUMBERS.isEqualTo('on')), ( ContextKeyExpr.and(( NOTEBOOK_CELL_LINE_NUMBERS.isEqualTo('inherit')), ( ContextKeyExpr.equals('config.notebook.lineNumbers', 'on'))))))
169
+ });
170
+ }
171
+ async runWithContext(accessor, context) {
172
+ if (context.ui) {
173
+ this.updateCell(accessor.get(IConfigurationService), context.cell);
174
+ }
175
+ else {
176
+ const configurationService = accessor.get(IConfigurationService);
177
+ context.selectedCells.forEach(cell => {
178
+ this.updateCell(configurationService, cell);
179
+ });
180
+ }
181
+ }
182
+ updateCell(configurationService, cell) {
183
+ const renderLineNumbers = configurationService.getValue('notebook.lineNumbers') === 'on';
184
+ const cellLineNumbers = cell.lineNumbers;
185
+ const currentLineNumberIsOn = cellLineNumbers === 'on' || (cellLineNumbers === 'inherit' && renderLineNumbers);
186
+ if (currentLineNumberIsOn) {
187
+ cell.lineNumbers = 'off';
188
+ }
189
+ else {
190
+ cell.lineNumbers = 'on';
191
+ }
192
+ }
193
+ });
194
+ export { CellEditorOptions };