@codingame/monaco-vscode-api 1.85.0 → 1.85.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +957 -950
  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,59 @@
1
+ import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
3
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
4
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
5
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
6
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
7
+ import { EXPAND_CELL_OUTPUT_COMMAND_ID } from '../../notebookBrowser.js';
8
+ import { CellContentPart } from '../cellPart.js';
9
+ const $ = dom.$;
10
+ let CollapsedCellOutput = class CollapsedCellOutput extends CellContentPart {
11
+ constructor(notebookEditor, cellOutputCollapseContainer, keybindingService) {
12
+ super();
13
+ this.notebookEditor = notebookEditor;
14
+ const placeholder = dom.append(cellOutputCollapseContainer, $('span.expandOutputPlaceholder'));
15
+ placeholder.textContent = ( localizeWithPath(
16
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput',
17
+ 'cellOutputsCollapsedMsg',
18
+ "Outputs are collapsed"
19
+ ));
20
+ const expandIcon = dom.append(cellOutputCollapseContainer, $('span.expandOutputIcon'));
21
+ expandIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.more));
22
+ const keybinding = keybindingService.lookupKeybinding(EXPAND_CELL_OUTPUT_COMMAND_ID);
23
+ if (keybinding) {
24
+ placeholder.title = ( localizeWithPath(
25
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput',
26
+ 'cellExpandOutputButtonLabelWithDoubleClick',
27
+ "Double-click to expand cell output ({0})",
28
+ keybinding.getLabel()
29
+ ));
30
+ cellOutputCollapseContainer.title = ( localizeWithPath(
31
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput',
32
+ 'cellExpandOutputButtonLabel',
33
+ "Expand Cell Output (${0})",
34
+ keybinding.getLabel()
35
+ ));
36
+ }
37
+ dom.hide(cellOutputCollapseContainer);
38
+ this._register(dom.addDisposableListener(expandIcon, dom.EventType.CLICK, () => this.expand()));
39
+ this._register(dom.addDisposableListener(cellOutputCollapseContainer, dom.EventType.DBLCLICK, () => this.expand()));
40
+ }
41
+ expand() {
42
+ if (!this.currentCell) {
43
+ return;
44
+ }
45
+ if (!this.currentCell) {
46
+ return;
47
+ }
48
+ const textModel = this.notebookEditor.textModel;
49
+ const index = textModel.cells.indexOf(this.currentCell.model);
50
+ if (index < 0) {
51
+ return;
52
+ }
53
+ this.currentCell.isOutputCollapsed = !this.currentCell.isOutputCollapsed;
54
+ }
55
+ };
56
+ CollapsedCellOutput = ( __decorate([
57
+ ( __param(2, IKeybindingService))
58
+ ], CollapsedCellOutput));
59
+ export { CollapsedCellOutput };
@@ -0,0 +1,67 @@
1
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
2
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
3
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
4
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
5
+ import { FoldingController } from '../../controller/foldingController.js';
6
+ import { CellEditState } from '../../notebookBrowser.js';
7
+ import { CellContentPart } from '../cellPart.js';
8
+ class FoldedCellHint extends CellContentPart {
9
+ constructor(_notebookEditor, _container) {
10
+ super();
11
+ this._notebookEditor = _notebookEditor;
12
+ this._container = _container;
13
+ }
14
+ didRenderCell(element) {
15
+ this.update(element);
16
+ }
17
+ update(element) {
18
+ if (!this._notebookEditor.hasModel()) {
19
+ return;
20
+ }
21
+ if (element.isInputCollapsed || element.getEditState() === CellEditState.Editing) {
22
+ dom.hide(this._container);
23
+ }
24
+ else if (element.foldingState === 2 ) {
25
+ const idx = this._notebookEditor.getViewModel().getCellIndex(element);
26
+ const length = this._notebookEditor.getViewModel().getFoldedLength(idx);
27
+ dom.reset(this._container, this.getHiddenCellsLabel(length), this.getHiddenCellHintButton(element));
28
+ dom.show(this._container);
29
+ const foldHintTop = element.layoutInfo.previewHeight;
30
+ this._container.style.top = `${foldHintTop}px`;
31
+ }
32
+ else {
33
+ dom.hide(this._container);
34
+ }
35
+ }
36
+ getHiddenCellsLabel(num) {
37
+ const label = num === 1 ?
38
+ ( localizeWithPath(
39
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint',
40
+ 'hiddenCellsLabel',
41
+ "1 cell hidden"
42
+ )) :
43
+ ( localizeWithPath(
44
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint',
45
+ 'hiddenCellsLabelPlural',
46
+ "{0} cells hidden",
47
+ num
48
+ ));
49
+ return dom.$('span.notebook-folded-hint-label', undefined, label);
50
+ }
51
+ getHiddenCellHintButton(element) {
52
+ const expandIcon = dom.$('span.cell-expand-part-button');
53
+ expandIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.more));
54
+ this._register(dom.addDisposableListener(expandIcon, dom.EventType.CLICK, () => {
55
+ const controller = this._notebookEditor.getContribution(FoldingController.id);
56
+ const idx = this._notebookEditor.getCellIndex(element);
57
+ if (typeof idx === 'number') {
58
+ controller.setFoldingStateDown(idx, 1 , 1);
59
+ }
60
+ }));
61
+ return expandIcon;
62
+ }
63
+ updateInternalLayoutNow(element) {
64
+ this.update(element);
65
+ }
66
+ }
67
+ export { FoldedCellHint };
@@ -0,0 +1,430 @@
1
+ import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
2
+ import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
3
+ import { renderIcon } from 'monaco-editor/esm/vs/base/browser/ui/iconLabel/iconLabels.js';
4
+ import { raceCancellation, disposableTimeout } from 'monaco-editor/esm/vs/base/common/async.js';
5
+ import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
6
+ import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
7
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
8
+ import { Disposable, DisposableStore, MutableDisposable, toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
9
+ import { CodeEditorWidget } from 'monaco-editor/esm/vs/editor/browser/widget/codeEditorWidget.js';
10
+ import { EditorContextKeys } from 'monaco-editor/esm/vs/editor/common/editorContextKeys.js';
11
+ import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
12
+ import { tokenizeToStringSync } from 'monaco-editor/esm/vs/editor/common/languages/textToHtmlTokenizer.js';
13
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
14
+ import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
15
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
16
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
17
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
18
+ import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
19
+ import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
20
+ import { CellEditState, CellFocusMode, EXPAND_CELL_INPUT_COMMAND_ID } from '../../notebookBrowser.js';
21
+ import { expandedIcon, collapsedIcon } from '../../notebookIcons.js';
22
+ import { CellEditorOptions } from './cellEditorOptions.js';
23
+ import { WordHighlighterContribution } from 'monaco-editor/esm/vs/editor/contrib/wordHighlighter/browser/wordHighlighter.js';
24
+ let MarkupCell = class MarkupCell extends Disposable {
25
+ constructor(notebookEditor, viewCell, templateData, renderedEditors, accessibilityService, contextKeyService, instantiationService, languageService, configurationService, keybindingService) {
26
+ super();
27
+ this.notebookEditor = notebookEditor;
28
+ this.viewCell = viewCell;
29
+ this.templateData = templateData;
30
+ this.renderedEditors = renderedEditors;
31
+ this.accessibilityService = accessibilityService;
32
+ this.contextKeyService = contextKeyService;
33
+ this.instantiationService = instantiationService;
34
+ this.languageService = languageService;
35
+ this.configurationService = configurationService;
36
+ this.keybindingService = keybindingService;
37
+ this.editor = null;
38
+ this.localDisposables = this._register(( new DisposableStore()));
39
+ this.focusSwitchDisposable = this._register(( new MutableDisposable()));
40
+ this.editorDisposables = this._register(( new DisposableStore()));
41
+ this.constructDOM();
42
+ this.editorPart = templateData.editorPart;
43
+ this.cellEditorOptions = this._register(( new CellEditorOptions(
44
+ this.notebookEditor.getBaseCellEditorOptions(viewCell.language),
45
+ this.notebookEditor.notebookOptions,
46
+ this.configurationService
47
+ )));
48
+ this.cellEditorOptions.setLineNumbers(this.viewCell.lineNumbers);
49
+ this.editorOptions = this.cellEditorOptions.getValue(this.viewCell.internalMetadata, this.viewCell.uri);
50
+ this._register(toDisposable(() => renderedEditors.delete(this.viewCell)));
51
+ this.registerListeners();
52
+ this.templateData.cellParts.scheduleRenderCell(this.viewCell);
53
+ this._register(toDisposable(() => {
54
+ this.templateData.cellParts.unrenderCell(this.viewCell);
55
+ }));
56
+ this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => {
57
+ this.viewUpdate();
58
+ }));
59
+ this.updateForHover();
60
+ this.updateForFocusModeChange();
61
+ this.foldingState = viewCell.foldingState;
62
+ this.layoutFoldingIndicator();
63
+ this.updateFoldingIconShowClass();
64
+ if (this.viewCell.layoutInfo.totalHeight > 0) {
65
+ this.relayoutCell();
66
+ }
67
+ this.applyDecorations();
68
+ this.viewUpdate();
69
+ this.layoutCellParts();
70
+ this._register(this.viewCell.onDidChangeLayout(() => {
71
+ this.layoutCellParts();
72
+ }));
73
+ }
74
+ layoutCellParts() {
75
+ this.templateData.cellParts.updateInternalLayoutNow(this.viewCell);
76
+ }
77
+ constructDOM() {
78
+ const id = `aria-markup-cell-${this.viewCell.id}`;
79
+ this.markdownAccessibilityContainer = this.templateData.cellContainer;
80
+ this.markdownAccessibilityContainer.id = id;
81
+ this.markdownAccessibilityContainer.style.height = '1px';
82
+ this.markdownAccessibilityContainer.style.overflow = 'hidden';
83
+ this.markdownAccessibilityContainer.style.position = 'absolute';
84
+ this.markdownAccessibilityContainer.style.top = '100000px';
85
+ this.markdownAccessibilityContainer.style.left = '10000px';
86
+ this.markdownAccessibilityContainer.ariaHidden = 'false';
87
+ this.templateData.rootContainer.setAttribute('aria-describedby', id);
88
+ this.templateData.container.classList.toggle('webview-backed-markdown-cell', true);
89
+ }
90
+ registerListeners() {
91
+ this._register(this.viewCell.onDidChangeState(e => {
92
+ this.templateData.cellParts.updateState(this.viewCell, e);
93
+ }));
94
+ this._register(this.viewCell.model.onDidChangeMetadata(() => {
95
+ this.viewUpdate();
96
+ }));
97
+ this._register(this.viewCell.onDidChangeState((e) => {
98
+ if (e.editStateChanged || e.contentChanged) {
99
+ this.viewUpdate();
100
+ }
101
+ if (e.focusModeChanged) {
102
+ this.updateForFocusModeChange();
103
+ }
104
+ if (e.foldingStateChanged) {
105
+ const foldingState = this.viewCell.foldingState;
106
+ if (foldingState !== this.foldingState) {
107
+ this.foldingState = foldingState;
108
+ this.layoutFoldingIndicator();
109
+ }
110
+ }
111
+ if (e.cellIsHoveredChanged) {
112
+ this.updateForHover();
113
+ }
114
+ if (e.inputCollapsedChanged) {
115
+ this.updateCollapsedState();
116
+ this.viewUpdate();
117
+ }
118
+ if (e.cellLineNumberChanged) {
119
+ this.cellEditorOptions.setLineNumbers(this.viewCell.lineNumbers);
120
+ }
121
+ }));
122
+ this._register(this.notebookEditor.notebookOptions.onDidChangeOptions(e => {
123
+ if (e.showFoldingControls) {
124
+ this.updateFoldingIconShowClass();
125
+ }
126
+ }));
127
+ this._register(this.viewCell.onDidChangeLayout((e) => {
128
+ const layoutInfo = this.editor?.getLayoutInfo();
129
+ if (e.outerWidth && this.viewCell.getEditState() === CellEditState.Editing && layoutInfo && layoutInfo.width !== this.viewCell.layoutInfo.editorWidth) {
130
+ this.onCellEditorWidthChange();
131
+ }
132
+ }));
133
+ this._register(this.cellEditorOptions.onDidChange(() => {
134
+ this.updateEditorOptions(this.cellEditorOptions.getUpdatedValue(this.viewCell.internalMetadata, this.viewCell.uri));
135
+ }));
136
+ }
137
+ updateCollapsedState() {
138
+ if (this.viewCell.isInputCollapsed) {
139
+ this.notebookEditor.hideMarkupPreviews([this.viewCell]);
140
+ }
141
+ else {
142
+ this.notebookEditor.unhideMarkupPreviews([this.viewCell]);
143
+ }
144
+ }
145
+ updateForHover() {
146
+ this.templateData.container.classList.toggle('markdown-cell-hover', this.viewCell.cellIsHovered);
147
+ }
148
+ updateForFocusModeChange() {
149
+ if (this.viewCell.focusMode === CellFocusMode.Editor) {
150
+ this.focusEditorIfNeeded();
151
+ }
152
+ this.templateData.container.classList.toggle('cell-editor-focus', this.viewCell.focusMode === CellFocusMode.Editor);
153
+ }
154
+ applyDecorations() {
155
+ this._register(this.viewCell.onCellDecorationsChanged((e) => {
156
+ e.added.forEach(options => {
157
+ if (options.className) {
158
+ this.notebookEditor.deltaCellContainerClassNames(this.viewCell.id, [options.className], []);
159
+ }
160
+ });
161
+ e.removed.forEach(options => {
162
+ if (options.className) {
163
+ this.notebookEditor.deltaCellContainerClassNames(this.viewCell.id, [], [options.className]);
164
+ }
165
+ });
166
+ }));
167
+ this.viewCell.getCellDecorations().forEach(options => {
168
+ if (options.className) {
169
+ this.notebookEditor.deltaCellContainerClassNames(this.viewCell.id, [options.className], []);
170
+ }
171
+ });
172
+ }
173
+ dispose() {
174
+ if (this.notebookEditor.getActiveCell() === this.viewCell && this.viewCell.focusMode === CellFocusMode.Editor && (this.notebookEditor.hasEditorFocus() || this.notebookEditor.getDomNode().ownerDocument.activeElement === this.notebookEditor.getDomNode().ownerDocument.body)) {
175
+ this.notebookEditor.focusContainer();
176
+ }
177
+ this.viewCell.detachTextEditor();
178
+ super.dispose();
179
+ }
180
+ updateFoldingIconShowClass() {
181
+ const showFoldingIcon = this.notebookEditor.notebookOptions.getDisplayOptions().showFoldingControls;
182
+ this.templateData.foldingIndicator.classList.remove('mouseover', 'always');
183
+ this.templateData.foldingIndicator.classList.add(showFoldingIcon);
184
+ }
185
+ viewUpdate() {
186
+ if (this.viewCell.isInputCollapsed) {
187
+ this.viewUpdateCollapsed();
188
+ }
189
+ else if (this.viewCell.getEditState() === CellEditState.Editing) {
190
+ this.viewUpdateEditing();
191
+ }
192
+ else {
193
+ this.viewUpdatePreview();
194
+ }
195
+ }
196
+ viewUpdateCollapsed() {
197
+ dom.show(this.templateData.cellInputCollapsedContainer);
198
+ dom.hide(this.editorPart);
199
+ this.templateData.cellInputCollapsedContainer.innerText = '';
200
+ const markdownIcon = dom.append(this.templateData.cellInputCollapsedContainer, dom.$('span'));
201
+ markdownIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.markdown));
202
+ const element = dom.$('div');
203
+ element.classList.add('cell-collapse-preview');
204
+ const richEditorText = this.getRichText(this.viewCell.textBuffer, this.viewCell.language);
205
+ dom.safeInnerHtml(element, richEditorText);
206
+ this.templateData.cellInputCollapsedContainer.appendChild(element);
207
+ const expandIcon = dom.append(element, dom.$('span.expandInputIcon'));
208
+ expandIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.more));
209
+ const keybinding = this.keybindingService.lookupKeybinding(EXPAND_CELL_INPUT_COMMAND_ID);
210
+ if (keybinding) {
211
+ element.title = ( localizeWithPath(
212
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/markupCell',
213
+ 'cellExpandInputButtonLabelWithDoubleClick',
214
+ "Double-click to expand cell input ({0})",
215
+ keybinding.getLabel()
216
+ ));
217
+ expandIcon.title = ( localizeWithPath(
218
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/markupCell',
219
+ 'cellExpandInputButtonLabel',
220
+ "Expand Cell Input ({0})",
221
+ keybinding.getLabel()
222
+ ));
223
+ }
224
+ this.markdownAccessibilityContainer.ariaHidden = 'true';
225
+ this.templateData.container.classList.toggle('input-collapsed', true);
226
+ this.viewCell.renderedMarkdownHeight = 0;
227
+ this.viewCell.layoutChange({});
228
+ }
229
+ getRichText(buffer, language) {
230
+ return tokenizeToStringSync(this.languageService, buffer.getLineContent(1), language);
231
+ }
232
+ viewUpdateEditing() {
233
+ let editorHeight;
234
+ dom.show(this.editorPart);
235
+ this.markdownAccessibilityContainer.ariaHidden = 'true';
236
+ dom.hide(this.templateData.cellInputCollapsedContainer);
237
+ this.notebookEditor.hideMarkupPreviews([this.viewCell]);
238
+ this.templateData.container.classList.toggle('input-collapsed', false);
239
+ this.templateData.container.classList.toggle('markdown-cell-edit-mode', true);
240
+ if (this.editor && this.editor.hasModel()) {
241
+ editorHeight = this.editor.getContentHeight();
242
+ this.viewCell.attachTextEditor(this.editor);
243
+ this.focusEditorIfNeeded();
244
+ this.bindEditorListeners(this.editor);
245
+ this.editor.layout({
246
+ width: this.viewCell.layoutInfo.editorWidth,
247
+ height: editorHeight
248
+ });
249
+ }
250
+ else {
251
+ this.editorDisposables.clear();
252
+ const width = this.notebookEditor.notebookOptions.computeMarkdownCellEditorWidth(this.notebookEditor.getLayoutInfo().width);
253
+ const lineNum = this.viewCell.lineCount;
254
+ const lineHeight = this.viewCell.layoutInfo.fontInfo?.lineHeight || 17;
255
+ const editorPadding = this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata, this.viewCell.uri);
256
+ editorHeight = Math.max(lineNum, 1) * lineHeight + editorPadding.top + editorPadding.bottom;
257
+ this.templateData.editorContainer.innerText = '';
258
+ const editorContextKeyService = this.contextKeyService.createScoped(this.templateData.editorPart);
259
+ EditorContextKeys.inCompositeEditor.bindTo(editorContextKeyService).set(true);
260
+ const editorInstaService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, editorContextKeyService])));
261
+ this.editorDisposables.add(editorContextKeyService);
262
+ this.editor = this.editorDisposables.add(editorInstaService.createInstance(CodeEditorWidget, this.templateData.editorContainer, {
263
+ ...this.editorOptions,
264
+ dimension: {
265
+ width: width,
266
+ height: editorHeight
267
+ },
268
+ }, {
269
+ contributions: this.notebookEditor.creationOptions.cellEditorContributions
270
+ }));
271
+ this.templateData.currentEditor = this.editor;
272
+ this.editorDisposables.add(this.editor.onDidBlurEditorWidget(() => {
273
+ if (this.editor) {
274
+ WordHighlighterContribution.get(this.editor)?.stopHighlighting();
275
+ }
276
+ }));
277
+ this.editorDisposables.add(this.editor.onDidFocusEditorWidget(() => {
278
+ if (this.editor) {
279
+ WordHighlighterContribution.get(this.editor)?.restoreViewState(true);
280
+ }
281
+ }));
282
+ const cts = ( new CancellationTokenSource());
283
+ this.editorDisposables.add({ dispose() { cts.dispose(true); } });
284
+ raceCancellation(this.viewCell.resolveTextModel(), cts.token).then(model => {
285
+ if (!model) {
286
+ return;
287
+ }
288
+ this.editor.setModel(model);
289
+ const realContentHeight = this.editor.getContentHeight();
290
+ if (realContentHeight !== editorHeight) {
291
+ this.editor.layout({
292
+ width: width,
293
+ height: realContentHeight
294
+ });
295
+ editorHeight = realContentHeight;
296
+ }
297
+ this.viewCell.attachTextEditor(this.editor);
298
+ if (this.viewCell.getEditState() === CellEditState.Editing) {
299
+ this.focusEditorIfNeeded();
300
+ }
301
+ this.bindEditorListeners(this.editor);
302
+ this.viewCell.editorHeight = editorHeight;
303
+ });
304
+ }
305
+ this.viewCell.editorHeight = editorHeight;
306
+ this.focusEditorIfNeeded();
307
+ this.renderedEditors.set(this.viewCell, this.editor);
308
+ }
309
+ viewUpdatePreview() {
310
+ this.viewCell.detachTextEditor();
311
+ dom.hide(this.editorPart);
312
+ dom.hide(this.templateData.cellInputCollapsedContainer);
313
+ this.markdownAccessibilityContainer.ariaHidden = 'false';
314
+ this.templateData.container.classList.toggle('input-collapsed', false);
315
+ this.templateData.container.classList.toggle('markdown-cell-edit-mode', false);
316
+ this.renderedEditors.delete(this.viewCell);
317
+ this.markdownAccessibilityContainer.innerText = '';
318
+ if (this.viewCell.renderedHtml) {
319
+ if (this.accessibilityService.isScreenReaderOptimized()) {
320
+ dom.safeInnerHtml(this.markdownAccessibilityContainer, this.viewCell.renderedHtml);
321
+ }
322
+ else {
323
+ dom.clearNode(this.markdownAccessibilityContainer);
324
+ }
325
+ }
326
+ this.notebookEditor.createMarkupPreview(this.viewCell);
327
+ }
328
+ focusEditorIfNeeded() {
329
+ if (this.viewCell.focusMode === CellFocusMode.Editor &&
330
+ (this.notebookEditor.hasEditorFocus() || this.notebookEditor.getDomNode().ownerDocument.activeElement === this.notebookEditor.getDomNode().ownerDocument.body)) {
331
+ if (!this.editor) {
332
+ return;
333
+ }
334
+ this.editor.focus();
335
+ const primarySelection = this.editor.getSelection();
336
+ if (!primarySelection) {
337
+ return;
338
+ }
339
+ this.notebookEditor.revealRangeInViewAsync(this.viewCell, primarySelection);
340
+ }
341
+ }
342
+ layoutEditor(dimension) {
343
+ this.editor?.layout(dimension);
344
+ }
345
+ onCellEditorWidthChange() {
346
+ const realContentHeight = this.editor.getContentHeight();
347
+ this.layoutEditor({
348
+ width: this.viewCell.layoutInfo.editorWidth,
349
+ height: realContentHeight
350
+ });
351
+ }
352
+ relayoutCell() {
353
+ this.notebookEditor.layoutNotebookCell(this.viewCell, this.viewCell.layoutInfo.totalHeight);
354
+ this.layoutFoldingIndicator();
355
+ }
356
+ updateEditorOptions(newValue) {
357
+ this.editorOptions = newValue;
358
+ this.editor?.updateOptions(this.editorOptions);
359
+ }
360
+ layoutFoldingIndicator() {
361
+ switch (this.foldingState) {
362
+ case 0 :
363
+ this.templateData.foldingIndicator.style.display = 'none';
364
+ this.templateData.foldingIndicator.innerText = '';
365
+ break;
366
+ case 2 :
367
+ this.templateData.foldingIndicator.style.display = '';
368
+ dom.reset(this.templateData.foldingIndicator, renderIcon(collapsedIcon));
369
+ break;
370
+ case 1 :
371
+ this.templateData.foldingIndicator.style.display = '';
372
+ dom.reset(this.templateData.foldingIndicator, renderIcon(expandedIcon));
373
+ break;
374
+ }
375
+ }
376
+ bindEditorListeners(editor) {
377
+ this.localDisposables.clear();
378
+ this.focusSwitchDisposable.clear();
379
+ this.localDisposables.add(editor.onDidContentSizeChange(e => {
380
+ if (e.contentHeightChanged) {
381
+ this.onCellEditorHeightChange(editor, e.contentHeight);
382
+ }
383
+ }));
384
+ this.localDisposables.add(editor.onDidChangeCursorSelection((e) => {
385
+ if (e.source === 'restoreState') {
386
+ return;
387
+ }
388
+ const selections = editor.getSelections();
389
+ if (selections?.length) {
390
+ const contentHeight = editor.getContentHeight();
391
+ const layoutContentHeight = this.viewCell.layoutInfo.editorHeight;
392
+ if (contentHeight !== layoutContentHeight) {
393
+ this.onCellEditorHeightChange(editor, contentHeight);
394
+ }
395
+ const lastSelection = selections[selections.length - 1];
396
+ this.notebookEditor.revealRangeInViewAsync(this.viewCell, lastSelection);
397
+ }
398
+ }));
399
+ const updateFocusMode = () => this.viewCell.focusMode = editor.hasWidgetFocus() ? CellFocusMode.Editor : CellFocusMode.Container;
400
+ this.localDisposables.add(editor.onDidFocusEditorWidget(() => {
401
+ updateFocusMode();
402
+ }));
403
+ this.localDisposables.add(editor.onDidBlurEditorWidget(() => {
404
+ if (this.templateData.container.ownerDocument.activeElement?.contains(this.templateData.container)) {
405
+ this.focusSwitchDisposable.value = disposableTimeout(() => updateFocusMode(), 300);
406
+ }
407
+ else {
408
+ updateFocusMode();
409
+ }
410
+ }));
411
+ updateFocusMode();
412
+ }
413
+ onCellEditorHeightChange(editor, newHeight) {
414
+ const viewLayout = editor.getLayoutInfo();
415
+ this.viewCell.editorHeight = newHeight;
416
+ editor.layout({
417
+ width: viewLayout.width,
418
+ height: newHeight
419
+ });
420
+ }
421
+ };
422
+ MarkupCell = ( __decorate([
423
+ ( __param(4, IAccessibilityService)),
424
+ ( __param(5, IContextKeyService)),
425
+ ( __param(6, IInstantiationService)),
426
+ ( __param(7, ILanguageService)),
427
+ ( __param(8, IConfigurationService)),
428
+ ( __param(9, IKeybindingService))
429
+ ], MarkupCell));
430
+ export { MarkupCell };
@@ -0,0 +1,54 @@
1
+ import { CellFocusMode } from '../notebookBrowser.js';
2
+ import { NotebookSetting, CellKind, NotebookCellExecutionState } from '../../common/notebookCommon.js';
3
+ class NotebookCellAnchor {
4
+ constructor(notebookExecutionStateService, configurationService, scrollEvent) {
5
+ this.notebookExecutionStateService = notebookExecutionStateService;
6
+ this.configurationService = configurationService;
7
+ this.scrollEvent = scrollEvent;
8
+ this.stopAnchoring = false;
9
+ }
10
+ shouldAnchor(cellListView, focusedIndex, heightDelta, executingCellUri) {
11
+ if (cellListView.element(focusedIndex).focusMode === CellFocusMode.Editor) {
12
+ return true;
13
+ }
14
+ if (this.stopAnchoring) {
15
+ return false;
16
+ }
17
+ const newFocusBottom = cellListView.elementTop(focusedIndex) + cellListView.elementHeight(focusedIndex) + heightDelta;
18
+ const viewBottom = cellListView.renderHeight + cellListView.getScrollTop();
19
+ const focusStillVisible = viewBottom > newFocusBottom;
20
+ const anchorFocusedSetting = this.configurationService.getValue(NotebookSetting.anchorToFocusedCell);
21
+ const allowScrolling = this.configurationService.getValue(NotebookSetting.scrollToRevealCell) !== 'none';
22
+ const growing = heightDelta > 0;
23
+ const autoAnchor = allowScrolling && growing && !focusStillVisible && anchorFocusedSetting !== 'off';
24
+ if (autoAnchor || anchorFocusedSetting === 'on') {
25
+ this.watchAchorDuringExecution(executingCellUri);
26
+ return true;
27
+ }
28
+ return false;
29
+ }
30
+ watchAchorDuringExecution(executingCell) {
31
+ if (!this.executionWatcher && executingCell.cellKind === CellKind.Code) {
32
+ const executionState = this.notebookExecutionStateService.getCellExecution(executingCell.uri);
33
+ if (executionState && executionState.state === NotebookCellExecutionState.Executing) {
34
+ this.executionWatcher = executingCell.onDidStopExecution(() => {
35
+ this.executionWatcher?.dispose();
36
+ this.executionWatcher = undefined;
37
+ this.scrollWatcher?.dispose();
38
+ this.stopAnchoring = false;
39
+ });
40
+ this.scrollWatcher = this.scrollEvent((scrollEvent) => {
41
+ if (scrollEvent.scrollTop < scrollEvent.oldScrollTop) {
42
+ this.stopAnchoring = true;
43
+ this.scrollWatcher?.dispose();
44
+ }
45
+ });
46
+ }
47
+ }
48
+ }
49
+ dispose() {
50
+ this.executionWatcher?.dispose();
51
+ this.scrollWatcher?.dispose();
52
+ }
53
+ }
54
+ export { NotebookCellAnchor };