@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,652 @@
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 { renderMarkdown } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
4
+ import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
5
+ import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
6
+ import * as nls from 'monaco-editor/esm/vs/nls.js';
7
+ import { createAndFillInActionBarActions } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
8
+ import { WorkbenchToolBar } from 'monaco-editor/esm/vs/platform/actions/browser/toolbar.js';
9
+ import { MenuId, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
10
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
11
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
12
+ import { IOpenerService } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
13
+ import { IQuickInputService } from 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
14
+ import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
15
+ import { VIEWLET_ID } from '../../../../extensions/common/extensions.js';
16
+ import { JUPYTER_EXTENSION_ID } from '../../notebookBrowser.js';
17
+ import { mimetypeIcon } from '../../notebookIcons.js';
18
+ import { CellContentPart } from '../cellPart.js';
19
+ import { NotebookCellExecutionState, CellUri, isTextStreamMime, RENDERER_NOT_AVAILABLE } from '../../../common/notebookCommon.js';
20
+ import { INotebookExecutionStateService } from '../../../common/notebookExecutionStateService.js';
21
+ import { INotebookService } from '../../../common/notebookService.js';
22
+ import { IPaneCompositePartService } from '../../../../../services/panecomposite/browser/panecomposite.js';
23
+ import { COPY_OUTPUT_COMMAND_ID } from '../../controller/cellOutputActions.js';
24
+ import { CLEAR_CELL_OUTPUTS_COMMAND_ID } from '../../controller/editActions.js';
25
+ import { TEXT_BASED_MIMETYPES } from '../../contrib/clipboard/cellOutputClipboard.js';
26
+ let CellOutputElement = class CellOutputElement extends Disposable {
27
+ constructor(notebookEditor, viewCell, cellOutputContainer, outputContainer, output, notebookService, quickInputService, parentContextKeyService, menuService, paneCompositeService, instantiationService) {
28
+ super();
29
+ this.notebookEditor = notebookEditor;
30
+ this.viewCell = viewCell;
31
+ this.cellOutputContainer = cellOutputContainer;
32
+ this.outputContainer = outputContainer;
33
+ this.output = output;
34
+ this.notebookService = notebookService;
35
+ this.quickInputService = quickInputService;
36
+ this.menuService = menuService;
37
+ this.paneCompositeService = paneCompositeService;
38
+ this.instantiationService = instantiationService;
39
+ this._renderDisposableStore = this._register(( new DisposableStore()));
40
+ this._outputHeightTimer = null;
41
+ this.contextKeyService = parentContextKeyService;
42
+ this._register(this.output.model.onDidChangeData(() => {
43
+ this.rerender();
44
+ }));
45
+ this._register(this.output.onDidResetRenderer(() => {
46
+ this.rerender();
47
+ }));
48
+ }
49
+ detach() {
50
+ this.renderedOutputContainer?.parentElement?.removeChild(this.renderedOutputContainer);
51
+ let count = 0;
52
+ if (this.innerContainer) {
53
+ for (let i = 0; i < this.innerContainer.childNodes.length; i++) {
54
+ if (this.innerContainer.childNodes[i].className === 'rendered-output') {
55
+ count++;
56
+ }
57
+ if (count > 1) {
58
+ break;
59
+ }
60
+ }
61
+ if (count === 0) {
62
+ this.innerContainer.parentElement?.removeChild(this.innerContainer);
63
+ }
64
+ }
65
+ this.notebookEditor.removeInset(this.output);
66
+ }
67
+ updateDOMTop(top) {
68
+ if (this.innerContainer) {
69
+ this.innerContainer.style.top = `${top}px`;
70
+ }
71
+ }
72
+ rerender() {
73
+ if (this.notebookEditor.hasModel() &&
74
+ this.innerContainer &&
75
+ this.renderResult &&
76
+ this.renderResult.type === 1 ) {
77
+ const [mimeTypes, pick] = this.output.resolveMimeTypes(this.notebookEditor.textModel, this.notebookEditor.activeKernel?.preloadProvides);
78
+ const pickedMimeType = mimeTypes[pick];
79
+ if (pickedMimeType.mimeType === this.renderResult.mimeType && pickedMimeType.rendererId === this.renderResult.renderer.id) {
80
+ const index = this.viewCell.outputsViewModels.indexOf(this.output);
81
+ this.notebookEditor.updateOutput(this.viewCell, this.renderResult, this.viewCell.getOutputOffset(index));
82
+ return;
83
+ }
84
+ }
85
+ if (!this.innerContainer) {
86
+ const currOutputIndex = this.cellOutputContainer.renderedOutputEntries.findIndex(entry => entry.element === this);
87
+ const previousSibling = currOutputIndex > 0 && !!(this.cellOutputContainer.renderedOutputEntries[currOutputIndex - 1].element.innerContainer?.parentElement)
88
+ ? this.cellOutputContainer.renderedOutputEntries[currOutputIndex - 1].element.innerContainer
89
+ : undefined;
90
+ this.render(previousSibling);
91
+ }
92
+ else {
93
+ const nextElement = this.innerContainer.nextElementSibling;
94
+ this._renderDisposableStore.clear();
95
+ const element = this.innerContainer;
96
+ if (element) {
97
+ element.parentElement?.removeChild(element);
98
+ this.notebookEditor.removeInset(this.output);
99
+ }
100
+ this.render(nextElement);
101
+ }
102
+ this._relayoutCell();
103
+ }
104
+ _generateInnerOutputContainer(previousSibling, pickedMimeTypeRenderer) {
105
+ this.innerContainer = dom.$('.output-inner-container');
106
+ if (previousSibling && previousSibling.nextElementSibling) {
107
+ this.outputContainer.domNode.insertBefore(this.innerContainer, previousSibling.nextElementSibling);
108
+ }
109
+ else {
110
+ this.outputContainer.domNode.appendChild(this.innerContainer);
111
+ }
112
+ this.innerContainer.setAttribute('output-mime-type', pickedMimeTypeRenderer.mimeType);
113
+ return this.innerContainer;
114
+ }
115
+ render(previousSibling) {
116
+ const index = this.viewCell.outputsViewModels.indexOf(this.output);
117
+ if (this.viewCell.isOutputCollapsed || !this.notebookEditor.hasModel()) {
118
+ return undefined;
119
+ }
120
+ const notebookUri = CellUri.parse(this.viewCell.uri)?.notebook;
121
+ if (!notebookUri) {
122
+ return undefined;
123
+ }
124
+ const notebookTextModel = this.notebookEditor.textModel;
125
+ const [mimeTypes, pick] = this.output.resolveMimeTypes(notebookTextModel, this.notebookEditor.activeKernel?.preloadProvides);
126
+ if (!mimeTypes.find(mimeType => mimeType.isTrusted) || mimeTypes.length === 0) {
127
+ this.viewCell.updateOutputHeight(index, 0, 'CellOutputElement#noMimeType');
128
+ return undefined;
129
+ }
130
+ const pickedMimeTypeRenderer = mimeTypes[pick];
131
+ const innerContainer = this._generateInnerOutputContainer(previousSibling, pickedMimeTypeRenderer);
132
+ this._attachToolbar(innerContainer, notebookTextModel, this.notebookEditor.activeKernel, index, mimeTypes);
133
+ this.renderedOutputContainer = dom.append(innerContainer, dom.$('.rendered-output'));
134
+ const renderer = this.notebookService.getRendererInfo(pickedMimeTypeRenderer.rendererId);
135
+ this.renderResult = renderer
136
+ ? { type: 1 , renderer, source: this.output, mimeType: pickedMimeTypeRenderer.mimeType }
137
+ : this._renderMissingRenderer(this.output, pickedMimeTypeRenderer.mimeType);
138
+ this.output.pickedMimeType = pickedMimeTypeRenderer;
139
+ if (!this.renderResult) {
140
+ this.viewCell.updateOutputHeight(index, 0, 'CellOutputElement#renderResultUndefined');
141
+ return undefined;
142
+ }
143
+ this.notebookEditor.createOutput(this.viewCell, this.renderResult, this.viewCell.getOutputOffset(index), false);
144
+ innerContainer.classList.add('background');
145
+ return { initRenderIsSynchronous: false };
146
+ }
147
+ _renderMissingRenderer(viewModel, preferredMimeType) {
148
+ if (!viewModel.model.outputs.length) {
149
+ return this._renderMessage(viewModel, ( nls.localizeWithPath(
150
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
151
+ 'empty',
152
+ "Cell has no output"
153
+ )));
154
+ }
155
+ if (!preferredMimeType) {
156
+ const mimeTypes = ( viewModel.model.outputs.map(op => op.mime));
157
+ const mimeTypesMessage = mimeTypes.join(', ');
158
+ return this._renderMessage(viewModel, ( nls.localizeWithPath(
159
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
160
+ 'noRenderer.2',
161
+ "No renderer could be found for output. It has the following mimetypes: {0}",
162
+ mimeTypesMessage
163
+ )));
164
+ }
165
+ return this._renderSearchForMimetype(viewModel, preferredMimeType);
166
+ }
167
+ _renderSearchForMimetype(viewModel, mimeType) {
168
+ const query = `@tag:notebookRenderer ${mimeType}`;
169
+ const p = dom.$('p', undefined, `No renderer could be found for mimetype "${mimeType}", but one might be available on the Marketplace.`);
170
+ const a = dom.$('a', { href: `command:workbench.extensions.search?%22${query}%22`, class: 'monaco-button monaco-text-button', tabindex: 0, role: 'button', style: 'padding: 8px; text-decoration: none; color: rgb(255, 255, 255); background-color: rgb(14, 99, 156); max-width: 200px;' }, `Search Marketplace`);
171
+ return {
172
+ type: 0 ,
173
+ source: viewModel,
174
+ htmlContent: p.outerHTML + a.outerHTML
175
+ };
176
+ }
177
+ _renderMessage(viewModel, message) {
178
+ const el = dom.$('p', undefined, message);
179
+ return { type: 0 , source: viewModel, htmlContent: el.outerHTML };
180
+ }
181
+ shouldEnableCopy(mimeTypes) {
182
+ if (!mimeTypes.find(mimeType => TEXT_BASED_MIMETYPES.indexOf(mimeType.mimeType) || mimeType.mimeType.startsWith('image/'))) {
183
+ return false;
184
+ }
185
+ if (isTextStreamMime(mimeTypes[0].mimeType)) {
186
+ const cellViewModel = this.output.cellViewModel;
187
+ const index = cellViewModel.outputsViewModels.indexOf(this.output);
188
+ if (index > 0) {
189
+ const previousOutput = cellViewModel.model.outputs[index - 1];
190
+ return !isTextStreamMime(previousOutput.outputs[0].mime);
191
+ }
192
+ }
193
+ return true;
194
+ }
195
+ async _attachToolbar(outputItemDiv, notebookTextModel, kernel, index, mimeTypes) {
196
+ const hasMultipleMimeTypes = mimeTypes.filter(mimeType => mimeType.isTrusted).length > 1;
197
+ const isCopyEnabled = this.shouldEnableCopy(mimeTypes);
198
+ if (index > 0 && !hasMultipleMimeTypes && !isCopyEnabled) {
199
+ return;
200
+ }
201
+ if (!this.notebookEditor.hasModel()) {
202
+ return;
203
+ }
204
+ const useConsolidatedButton = this.notebookEditor.notebookOptions.getDisplayOptions().consolidatedOutputButton;
205
+ outputItemDiv.style.position = 'relative';
206
+ const mimeTypePicker = dom.$('.cell-output-toolbar');
207
+ outputItemDiv.appendChild(mimeTypePicker);
208
+ const toolbar = this._renderDisposableStore.add(this.instantiationService.createInstance(WorkbenchToolBar, mimeTypePicker, {
209
+ renderDropdownAsChildElement: false
210
+ }));
211
+ toolbar.context = {
212
+ ui: true,
213
+ cell: this.output.cellViewModel,
214
+ outputViewModel: this.output,
215
+ notebookEditor: this.notebookEditor,
216
+ $mid: 13
217
+ };
218
+ const pickAction = ( new Action('notebook.output.pickMimetype', ( nls.localizeWithPath(
219
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
220
+ 'pickMimeType',
221
+ "Change Presentation"
222
+ )), ThemeIcon.asClassName(mimetypeIcon), undefined, async (_context) => this._pickActiveMimeTypeRenderer(outputItemDiv, notebookTextModel, kernel, this.output)));
223
+ const menu = this._renderDisposableStore.add(this.menuService.createMenu(MenuId.NotebookOutputToolbar, this.contextKeyService));
224
+ const updateMenuToolbar = () => {
225
+ const primary = [];
226
+ let secondary = [];
227
+ const result = { primary, secondary };
228
+ createAndFillInActionBarActions(menu, { shouldForwardArgs: true }, result, () => false);
229
+ if (index > 0 || !useConsolidatedButton) {
230
+ secondary = secondary.filter((action) => action.id !== CLEAR_CELL_OUTPUTS_COMMAND_ID);
231
+ }
232
+ if (!isCopyEnabled) {
233
+ secondary = secondary.filter((action) => action.id !== COPY_OUTPUT_COMMAND_ID);
234
+ }
235
+ if (hasMultipleMimeTypes) {
236
+ secondary = [pickAction, ...secondary];
237
+ }
238
+ toolbar.setActions([], secondary);
239
+ };
240
+ updateMenuToolbar();
241
+ this._renderDisposableStore.add(menu.onDidChange(updateMenuToolbar));
242
+ }
243
+ async _pickActiveMimeTypeRenderer(outputItemDiv, notebookTextModel, kernel, viewModel) {
244
+ const [mimeTypes, currIndex] = viewModel.resolveMimeTypes(notebookTextModel, kernel?.preloadProvides);
245
+ const items = [];
246
+ const unsupportedItems = [];
247
+ mimeTypes.forEach((mimeType, index) => {
248
+ if (mimeType.isTrusted) {
249
+ const arr = mimeType.rendererId === RENDERER_NOT_AVAILABLE ?
250
+ unsupportedItems :
251
+ items;
252
+ arr.push({
253
+ label: mimeType.mimeType,
254
+ id: mimeType.mimeType,
255
+ index: index,
256
+ picked: index === currIndex,
257
+ detail: this._generateRendererInfo(mimeType.rendererId),
258
+ description: index === currIndex ? ( nls.localizeWithPath(
259
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
260
+ 'curruentActiveMimeType',
261
+ "Currently Active"
262
+ )) : undefined
263
+ });
264
+ }
265
+ });
266
+ if (( unsupportedItems.some(m => JUPYTER_RENDERER_MIMETYPES.includes(m.id)))) {
267
+ unsupportedItems.push({
268
+ label: ( nls.localizeWithPath(
269
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
270
+ 'installJupyterPrompt',
271
+ "Install additional renderers from the marketplace"
272
+ )),
273
+ id: 'installRenderers',
274
+ index: mimeTypes.length
275
+ });
276
+ }
277
+ const picker = this.quickInputService.createQuickPick();
278
+ picker.items = [
279
+ ...items,
280
+ { type: 'separator' },
281
+ ...unsupportedItems
282
+ ];
283
+ picker.activeItems = items.filter(item => !!item.picked);
284
+ picker.placeholder = items.length !== mimeTypes.length
285
+ ? ( nls.localizeWithPath(
286
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
287
+ 'promptChooseMimeTypeInSecure.placeHolder',
288
+ "Select mimetype to render for current output"
289
+ ))
290
+ : ( nls.localizeWithPath(
291
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
292
+ 'promptChooseMimeType.placeHolder',
293
+ "Select mimetype to render for current output"
294
+ ));
295
+ const pick = await ( new Promise(resolve => {
296
+ picker.onDidAccept(() => {
297
+ resolve(picker.selectedItems.length === 1 ? picker.selectedItems[0] : undefined);
298
+ picker.dispose();
299
+ });
300
+ picker.show();
301
+ }));
302
+ if (pick === undefined || pick.index === currIndex) {
303
+ return;
304
+ }
305
+ if (pick.id === 'installRenderers') {
306
+ this._showJupyterExtension();
307
+ return;
308
+ }
309
+ const nextElement = outputItemDiv.nextElementSibling;
310
+ this._renderDisposableStore.clear();
311
+ const element = this.innerContainer;
312
+ if (element) {
313
+ element.parentElement?.removeChild(element);
314
+ this.notebookEditor.removeInset(viewModel);
315
+ }
316
+ viewModel.pickedMimeType = mimeTypes[pick.index];
317
+ this.viewCell.updateOutputMinHeight(this.viewCell.layoutInfo.outputTotalHeight);
318
+ const { mimeType, rendererId } = mimeTypes[pick.index];
319
+ this.notebookService.updateMimePreferredRenderer(notebookTextModel.viewType, mimeType, rendererId, ( mimeTypes.map(m => m.mimeType)));
320
+ this.render(nextElement);
321
+ this._validateFinalOutputHeight(false);
322
+ this._relayoutCell();
323
+ }
324
+ async _showJupyterExtension() {
325
+ const viewlet = await this.paneCompositeService.openPaneComposite(VIEWLET_ID, 0 , true);
326
+ const view = viewlet?.getViewPaneContainer();
327
+ view?.search(`@id:${JUPYTER_EXTENSION_ID}`);
328
+ }
329
+ _generateRendererInfo(renderId) {
330
+ const renderInfo = this.notebookService.getRendererInfo(renderId);
331
+ if (renderInfo) {
332
+ const displayName = renderInfo.displayName !== '' ? renderInfo.displayName : renderInfo.id;
333
+ return `${displayName} (${renderInfo.extensionId.value})`;
334
+ }
335
+ return ( nls.localizeWithPath(
336
+ 'vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput',
337
+ 'unavailableRenderInfo',
338
+ "renderer not available"
339
+ ));
340
+ }
341
+ _validateFinalOutputHeight(synchronous) {
342
+ if (this._outputHeightTimer !== null) {
343
+ clearTimeout(this._outputHeightTimer);
344
+ }
345
+ if (synchronous) {
346
+ this.viewCell.unlockOutputHeight();
347
+ }
348
+ else {
349
+ this._outputHeightTimer = setTimeout(() => {
350
+ this.viewCell.unlockOutputHeight();
351
+ }, 1000);
352
+ }
353
+ }
354
+ _relayoutCell() {
355
+ this.notebookEditor.layoutNotebookCell(this.viewCell, this.viewCell.layoutInfo.totalHeight);
356
+ }
357
+ dispose() {
358
+ if (this._outputHeightTimer) {
359
+ this.viewCell.unlockOutputHeight();
360
+ clearTimeout(this._outputHeightTimer);
361
+ }
362
+ super.dispose();
363
+ }
364
+ };
365
+ CellOutputElement = ( __decorate([
366
+ ( __param(5, INotebookService)),
367
+ ( __param(6, IQuickInputService)),
368
+ ( __param(7, IContextKeyService)),
369
+ ( __param(8, IMenuService)),
370
+ ( __param(9, IPaneCompositePartService)),
371
+ ( __param(10, IInstantiationService))
372
+ ], CellOutputElement));
373
+ class OutputEntryViewHandler {
374
+ constructor(model, element) {
375
+ this.model = model;
376
+ this.element = element;
377
+ }
378
+ }
379
+ let CellOutputContainer = class CellOutputContainer extends CellContentPart {
380
+ get renderedOutputEntries() {
381
+ return this._outputEntries;
382
+ }
383
+ constructor(notebookEditor, viewCell, templateData, options, openerService, _notebookExecutionStateService, instantiationService) {
384
+ super();
385
+ this.notebookEditor = notebookEditor;
386
+ this.viewCell = viewCell;
387
+ this.templateData = templateData;
388
+ this.options = options;
389
+ this.openerService = openerService;
390
+ this._notebookExecutionStateService = _notebookExecutionStateService;
391
+ this.instantiationService = instantiationService;
392
+ this._outputEntries = [];
393
+ this._outputHeightTimer = null;
394
+ this._register(viewCell.onDidStartExecution(() => {
395
+ viewCell.updateOutputMinHeight(viewCell.layoutInfo.outputTotalHeight);
396
+ }));
397
+ this._register(viewCell.onDidStopExecution(() => {
398
+ this._validateFinalOutputHeight(false);
399
+ }));
400
+ this._register(viewCell.onDidChangeOutputs(splice => {
401
+ const executionState = this._notebookExecutionStateService.getCellExecution(viewCell.uri);
402
+ const context = executionState ? 1 : 2 ;
403
+ this._updateOutputs(splice, context);
404
+ }));
405
+ this._register(viewCell.onDidChangeLayout(() => {
406
+ this.updateInternalLayoutNow(viewCell);
407
+ }));
408
+ }
409
+ updateInternalLayoutNow(viewCell) {
410
+ this.templateData.outputContainer.setTop(viewCell.layoutInfo.outputContainerOffset);
411
+ this.templateData.outputShowMoreContainer.setTop(viewCell.layoutInfo.outputShowMoreContainerOffset);
412
+ this._outputEntries.forEach(entry => {
413
+ const index = this.viewCell.outputsViewModels.indexOf(entry.model);
414
+ if (index >= 0) {
415
+ const top = this.viewCell.getOutputOffsetInContainer(index);
416
+ entry.element.updateDOMTop(top);
417
+ }
418
+ });
419
+ }
420
+ render() {
421
+ try {
422
+ this._doRender();
423
+ }
424
+ finally {
425
+ this._relayoutCell();
426
+ }
427
+ }
428
+ _doRender() {
429
+ if (this.viewCell.outputsViewModels.length > 0) {
430
+ if (this.viewCell.layoutInfo.outputTotalHeight !== 0) {
431
+ this.viewCell.updateOutputMinHeight(this.viewCell.layoutInfo.outputTotalHeight);
432
+ }
433
+ dom.show(this.templateData.outputContainer.domNode);
434
+ for (let index = 0; index < Math.min(this.options.limit, this.viewCell.outputsViewModels.length); index++) {
435
+ const currOutput = this.viewCell.outputsViewModels[index];
436
+ const entry = this.instantiationService.createInstance(CellOutputElement, this.notebookEditor, this.viewCell, this, this.templateData.outputContainer, currOutput);
437
+ this._outputEntries.push(( new OutputEntryViewHandler(currOutput, entry)));
438
+ entry.render(undefined);
439
+ }
440
+ if (this.viewCell.outputsViewModels.length > this.options.limit) {
441
+ dom.show(this.templateData.outputShowMoreContainer.domNode);
442
+ this.viewCell.updateOutputShowMoreContainerHeight(46);
443
+ }
444
+ this._validateFinalOutputHeight(false);
445
+ }
446
+ else {
447
+ dom.hide(this.templateData.outputContainer.domNode);
448
+ }
449
+ this.templateData.outputShowMoreContainer.domNode.innerText = '';
450
+ if (this.viewCell.outputsViewModels.length > this.options.limit) {
451
+ this.templateData.outputShowMoreContainer.domNode.appendChild(this._generateShowMoreElement(this.templateData.templateDisposables));
452
+ }
453
+ else {
454
+ dom.hide(this.templateData.outputShowMoreContainer.domNode);
455
+ this.viewCell.updateOutputShowMoreContainerHeight(0);
456
+ }
457
+ }
458
+ viewUpdateShowOutputs(initRendering) {
459
+ for (let index = 0; index < this._outputEntries.length; index++) {
460
+ const viewHandler = this._outputEntries[index];
461
+ const outputEntry = viewHandler.element;
462
+ if (outputEntry.renderResult) {
463
+ this.notebookEditor.createOutput(this.viewCell, outputEntry.renderResult, this.viewCell.getOutputOffset(index), false);
464
+ }
465
+ else {
466
+ outputEntry.render(undefined);
467
+ }
468
+ }
469
+ this._relayoutCell();
470
+ }
471
+ viewUpdateHideOuputs() {
472
+ for (let index = 0; index < this._outputEntries.length; index++) {
473
+ this.notebookEditor.hideInset(this._outputEntries[index].model);
474
+ }
475
+ }
476
+ _validateFinalOutputHeight(synchronous) {
477
+ if (this._outputHeightTimer !== null) {
478
+ clearTimeout(this._outputHeightTimer);
479
+ }
480
+ const executionState = this._notebookExecutionStateService.getCellExecution(this.viewCell.uri);
481
+ if (synchronous) {
482
+ this.viewCell.unlockOutputHeight();
483
+ }
484
+ else if (executionState?.state !== NotebookCellExecutionState.Executing) {
485
+ this._outputHeightTimer = setTimeout(() => {
486
+ this.viewCell.unlockOutputHeight();
487
+ }, 200);
488
+ }
489
+ }
490
+ _updateOutputs(splice, context = 2 ) {
491
+ const previousOutputHeight = this.viewCell.layoutInfo.outputTotalHeight;
492
+ this.viewCell.updateOutputMinHeight(previousOutputHeight);
493
+ if (this.viewCell.outputsViewModels.length) {
494
+ dom.show(this.templateData.outputContainer.domNode);
495
+ }
496
+ else {
497
+ dom.hide(this.templateData.outputContainer.domNode);
498
+ }
499
+ this.viewCell.spliceOutputHeights(splice.start, splice.deleteCount, ( splice.newOutputs.map(_ => 0)));
500
+ this._renderNow(splice, context);
501
+ }
502
+ _renderNow(splice, context) {
503
+ if (splice.start >= this.options.limit) {
504
+ return;
505
+ }
506
+ const firstGroupEntries = this._outputEntries.slice(0, splice.start);
507
+ const deletedEntries = this._outputEntries.slice(splice.start, splice.start + splice.deleteCount);
508
+ const secondGroupEntries = this._outputEntries.slice(splice.start + splice.deleteCount);
509
+ let newlyInserted = this.viewCell.outputsViewModels.slice(splice.start, splice.start + splice.newOutputs.length);
510
+ if (firstGroupEntries.length + newlyInserted.length + secondGroupEntries.length > this.options.limit) {
511
+ if (firstGroupEntries.length + newlyInserted.length > this.options.limit) {
512
+ [...deletedEntries, ...secondGroupEntries].forEach(entry => {
513
+ entry.element.detach();
514
+ entry.element.dispose();
515
+ });
516
+ newlyInserted = newlyInserted.slice(0, this.options.limit - firstGroupEntries.length);
517
+ const newlyInsertedEntries = ( newlyInserted.map(insert => {
518
+ return ( new OutputEntryViewHandler(
519
+ insert,
520
+ this.instantiationService.createInstance(CellOutputElement, this.notebookEditor, this.viewCell, this, this.templateData.outputContainer, insert)
521
+ ));
522
+ }));
523
+ this._outputEntries = [...firstGroupEntries, ...newlyInsertedEntries];
524
+ for (let i = firstGroupEntries.length; i < this._outputEntries.length; i++) {
525
+ this._outputEntries[i].element.render(undefined);
526
+ }
527
+ }
528
+ else {
529
+ const elementsPushedOutOfView = secondGroupEntries.slice(this.options.limit - firstGroupEntries.length - newlyInserted.length);
530
+ [...deletedEntries, ...elementsPushedOutOfView].forEach(entry => {
531
+ entry.element.detach();
532
+ entry.element.dispose();
533
+ });
534
+ const reRenderRightBoundary = firstGroupEntries.length + newlyInserted.length;
535
+ const newlyInsertedEntries = ( newlyInserted.map(insert => {
536
+ return ( new OutputEntryViewHandler(
537
+ insert,
538
+ this.instantiationService.createInstance(CellOutputElement, this.notebookEditor, this.viewCell, this, this.templateData.outputContainer, insert)
539
+ ));
540
+ }));
541
+ this._outputEntries = [...firstGroupEntries, ...newlyInsertedEntries, ...secondGroupEntries.slice(0, this.options.limit - firstGroupEntries.length - newlyInserted.length)];
542
+ for (let i = firstGroupEntries.length; i < reRenderRightBoundary; i++) {
543
+ const previousSibling = i - 1 >= 0 && this._outputEntries[i - 1] && !!(this._outputEntries[i - 1].element.innerContainer?.parentElement) ? this._outputEntries[i - 1].element.innerContainer : undefined;
544
+ this._outputEntries[i].element.render(previousSibling);
545
+ }
546
+ }
547
+ }
548
+ else {
549
+ deletedEntries.forEach(entry => {
550
+ entry.element.detach();
551
+ entry.element.dispose();
552
+ });
553
+ const reRenderRightBoundary = firstGroupEntries.length + newlyInserted.length;
554
+ const newlyInsertedEntries = ( newlyInserted.map(insert => {
555
+ return ( new OutputEntryViewHandler(
556
+ insert,
557
+ this.instantiationService.createInstance(CellOutputElement, this.notebookEditor, this.viewCell, this, this.templateData.outputContainer, insert)
558
+ ));
559
+ }));
560
+ let outputsNewlyAvailable = [];
561
+ if (firstGroupEntries.length + newlyInsertedEntries.length + secondGroupEntries.length < this.viewCell.outputsViewModels.length) {
562
+ const last = Math.min(this.options.limit, this.viewCell.outputsViewModels.length);
563
+ outputsNewlyAvailable = ( this.viewCell.outputsViewModels.slice(firstGroupEntries.length + newlyInsertedEntries.length + secondGroupEntries.length, last).map(output => {
564
+ return ( new OutputEntryViewHandler(
565
+ output,
566
+ this.instantiationService.createInstance(CellOutputElement, this.notebookEditor, this.viewCell, this, this.templateData.outputContainer, output)
567
+ ));
568
+ }));
569
+ }
570
+ this._outputEntries = [...firstGroupEntries, ...newlyInsertedEntries, ...secondGroupEntries, ...outputsNewlyAvailable];
571
+ for (let i = firstGroupEntries.length; i < reRenderRightBoundary; i++) {
572
+ const previousSibling = i - 1 >= 0 && this._outputEntries[i - 1] && !!(this._outputEntries[i - 1].element.innerContainer?.parentElement) ? this._outputEntries[i - 1].element.innerContainer : undefined;
573
+ this._outputEntries[i].element.render(previousSibling);
574
+ }
575
+ for (let i = 0; i < outputsNewlyAvailable.length; i++) {
576
+ this._outputEntries[firstGroupEntries.length + newlyInserted.length + secondGroupEntries.length + i].element.render(undefined);
577
+ }
578
+ }
579
+ if (this.viewCell.outputsViewModels.length > this.options.limit) {
580
+ dom.show(this.templateData.outputShowMoreContainer.domNode);
581
+ if (!this.templateData.outputShowMoreContainer.domNode.hasChildNodes()) {
582
+ this.templateData.outputShowMoreContainer.domNode.appendChild(this._generateShowMoreElement(this.templateData.templateDisposables));
583
+ }
584
+ this.viewCell.updateOutputShowMoreContainerHeight(46);
585
+ }
586
+ else {
587
+ dom.hide(this.templateData.outputShowMoreContainer.domNode);
588
+ }
589
+ this._relayoutCell();
590
+ this._validateFinalOutputHeight(context === 2 && this.viewCell.outputsViewModels.length === 0);
591
+ }
592
+ _generateShowMoreElement(disposables) {
593
+ const md = {
594
+ value: `There are more than ${this.options.limit} outputs, [show more (open the raw output data in a text editor) ...](command:workbench.action.openLargeOutput)`,
595
+ isTrusted: true,
596
+ supportThemeIcons: true
597
+ };
598
+ const rendered = renderMarkdown(md, {
599
+ actionHandler: {
600
+ callback: (content) => {
601
+ if (content === 'command:workbench.action.openLargeOutput') {
602
+ this.openerService.open(CellUri.generateCellOutputUri(this.notebookEditor.textModel.uri));
603
+ }
604
+ return;
605
+ },
606
+ disposables
607
+ }
608
+ });
609
+ disposables.add(rendered);
610
+ rendered.element.classList.add('output-show-more');
611
+ return rendered.element;
612
+ }
613
+ _relayoutCell() {
614
+ this.notebookEditor.layoutNotebookCell(this.viewCell, this.viewCell.layoutInfo.totalHeight);
615
+ }
616
+ dispose() {
617
+ this.viewCell.updateOutputMinHeight(0);
618
+ if (this._outputHeightTimer) {
619
+ clearTimeout(this._outputHeightTimer);
620
+ }
621
+ this._outputEntries.forEach(entry => {
622
+ entry.element.dispose();
623
+ });
624
+ super.dispose();
625
+ }
626
+ };
627
+ CellOutputContainer = ( __decorate([
628
+ ( __param(4, IOpenerService)),
629
+ ( __param(5, INotebookExecutionStateService)),
630
+ ( __param(6, IInstantiationService))
631
+ ], CellOutputContainer));
632
+ const JUPYTER_RENDERER_MIMETYPES = [
633
+ 'application/geo+json',
634
+ 'application/vdom.v1+json',
635
+ 'application/vnd.dataresource+json',
636
+ 'application/vnd.plotly.v1+json',
637
+ 'application/vnd.vega.v2+json',
638
+ 'application/vnd.vega.v3+json',
639
+ 'application/vnd.vega.v4+json',
640
+ 'application/vnd.vega.v5+json',
641
+ 'application/vnd.vegalite.v1+json',
642
+ 'application/vnd.vegalite.v2+json',
643
+ 'application/vnd.vegalite.v3+json',
644
+ 'application/vnd.vegalite.v4+json',
645
+ 'application/x-nteract-model-debug+json',
646
+ 'image/svg+xml',
647
+ 'text/latex',
648
+ 'text/vnd.plotly.v1+html',
649
+ 'application/vnd.jupyter.widget-view+json',
650
+ 'application/vnd.code.notebook.error'
651
+ ];
652
+ export { CellOutputContainer };