@codingame/monaco-vscode-api 37.1.0 → 37.2.0

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 (313) hide show
  1. package/missing-services.js +6 -26
  2. package/package.json +8 -8
  3. package/services.d.ts +1 -1
  4. package/services.js +3 -3
  5. package/tools.d.ts +4 -0
  6. package/tools.js +24 -1
  7. package/vscode/src/vs/platform/product/common/product.js +1 -1
  8. package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
  9. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
  10. package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
  11. package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
  12. package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
  13. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  14. package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
  25. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
  27. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
  28. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
  30. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
  31. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
  32. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
  33. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
  35. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
  36. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
  39. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
  40. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
  41. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
  44. package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
  45. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
  46. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
  47. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
  48. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
  49. package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
  50. package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
  51. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
  52. package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
  53. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
  55. package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
  56. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
  57. package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
  58. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
  59. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
  60. package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
  61. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
  62. package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
  63. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
  64. package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
  65. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
  66. package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
  67. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
  68. package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
  71. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
  72. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
  73. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
  74. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
  85. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
  86. package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
  87. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
  88. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
  89. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
  90. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
  91. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
  92. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
  93. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
  94. package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
  95. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
  96. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
  97. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
  98. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
  99. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  100. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  101. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
  102. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
  103. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
  104. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
  105. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  106. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  107. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
  108. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
  109. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
  110. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
  111. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  112. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
  113. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  114. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  115. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  116. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  117. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
  118. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
  119. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
  120. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
  121. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
  122. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
  123. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
  124. package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
  125. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
  126. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
  127. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
  128. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
  129. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
  130. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
  131. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
  132. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
  133. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
  134. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
  135. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
  136. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
  137. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
  138. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
  139. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
  140. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
  141. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
  142. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
  143. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
  144. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
  145. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
  146. package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
  147. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
  148. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
  149. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
  150. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
  151. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
  152. package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
  171. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
  172. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
  173. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
  174. package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
  175. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
  176. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
  177. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
  178. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
  179. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
  180. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
  181. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
  182. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
  183. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
  184. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
  185. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
  186. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
  187. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
  188. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
  189. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
  193. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
  194. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
  195. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
  196. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
  197. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
  198. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
  199. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
  200. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
  201. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
  202. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
  203. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
  204. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
  205. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
  258. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
  259. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
  260. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
  261. package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
  262. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
  263. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
  264. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
  265. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
  266. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
  267. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
  268. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
  269. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
  270. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
  271. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
  272. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
  273. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
  274. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
  275. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
  276. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
  277. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
  278. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
  279. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
  280. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
  281. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
  282. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
  283. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
  284. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
  285. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
  286. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
  287. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
  288. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
  297. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
  298. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
  299. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
  300. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
  301. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
  302. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
  303. package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
  304. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
  305. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
  306. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
  307. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
  308. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
  309. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
  310. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
  311. package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
  312. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
  313. package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
@@ -1,429 +0,0 @@
1
-
2
- import { $ as $$1, append, addDisposableListener, EventType, isAncestor } from '../../../../../../base/browser/dom.js';
3
- import { Delayer } from '../../../../../../base/common/async.js';
4
- import { Disposable, MutableDisposable } from '../../../../../../base/common/lifecycle.js';
5
- import { isMacintosh } from '../../../../../../base/common/platform.js';
6
- import { expandCellRangesWithHiddenCells } from '../../notebookBrowser.js';
7
- import { CellContentPart } from '../cellPart.js';
8
- import { cloneNotebookCellTextModel } from '../../../common/model/notebookCellTextModel.js';
9
- import { CellEditType, SelectionStateType } from '../../../common/notebookCommon.js';
10
- import { cellRangesToIndexes } from '../../../common/notebookRange.js';
11
-
12
- const $ = $$1;
13
- const DRAGGING_CLASS = "cell-dragging";
14
- const GLOBAL_DRAG_CLASS = "global-drag-active";
15
- class CellDragAndDropPart extends CellContentPart {
16
- constructor(container) {
17
- super();
18
- this.container = container;
19
- }
20
- didRenderCell(element) {
21
- this.update(element);
22
- }
23
- updateState(element, e) {
24
- if (e.dragStateChanged) {
25
- this.update(element);
26
- }
27
- }
28
- update(element) {
29
- this.container.classList.toggle(DRAGGING_CLASS, element.dragging);
30
- }
31
- }
32
- class CellDragAndDropController extends Disposable {
33
- constructor(notebookEditor, notebookListContainer) {
34
- super();
35
- this.notebookEditor = notebookEditor;
36
- this.notebookListContainer = notebookListContainer;
37
- this.draggedCells = [];
38
- this.isScrolling = false;
39
- this.listOnWillScrollListener = this._register(( new MutableDisposable()));
40
- this.listInsertionIndicator = append(notebookListContainer, $(".cell-list-insertion-indicator"));
41
- this._register(addDisposableListener(
42
- notebookListContainer.ownerDocument.body,
43
- EventType.DRAG_START,
44
- this.onGlobalDragStart.bind(this),
45
- true
46
- ));
47
- this._register(addDisposableListener(
48
- notebookListContainer.ownerDocument.body,
49
- EventType.DRAG_END,
50
- this.onGlobalDragEnd.bind(this),
51
- true
52
- ));
53
- const addCellDragListener = (eventType, handler, useCapture = false) => {
54
- this._register(addDisposableListener(notebookEditor.getDomNode(), eventType, e => {
55
- const cellDragEvent = this.toCellDragEvent(e);
56
- if (cellDragEvent) {
57
- handler(cellDragEvent);
58
- }
59
- }, useCapture));
60
- };
61
- addCellDragListener(EventType.DRAG_OVER, event => {
62
- if (!this.currentDraggedCell) {
63
- return;
64
- }
65
- event.browserEvent.preventDefault();
66
- this.onCellDragover(event);
67
- }, true);
68
- addCellDragListener(EventType.DROP, event => {
69
- if (!this.currentDraggedCell) {
70
- return;
71
- }
72
- event.browserEvent.preventDefault();
73
- this.onCellDrop(event);
74
- });
75
- addCellDragListener(EventType.DRAG_LEAVE, event => {
76
- event.browserEvent.preventDefault();
77
- this.onCellDragLeave(event);
78
- });
79
- this.scrollingDelayer = this._register(( new Delayer(200)));
80
- }
81
- setList(value) {
82
- this.list = value;
83
- this.listOnWillScrollListener.value = this.list.onWillScroll(e => {
84
- if (!e.scrollTopChanged) {
85
- return;
86
- }
87
- this.setInsertIndicatorVisibility(false);
88
- this.isScrolling = true;
89
- this.scrollingDelayer.trigger(() => {
90
- this.isScrolling = false;
91
- });
92
- });
93
- }
94
- setInsertIndicatorVisibility(visible) {
95
- this.listInsertionIndicator.style.opacity = visible ? "1" : "0";
96
- }
97
- toCellDragEvent(event) {
98
- const targetTop = this.notebookListContainer.getBoundingClientRect().top;
99
- const dragOffset = this.list.scrollTop + event.clientY - targetTop;
100
- const draggedOverCell = this.list.elementAt(dragOffset);
101
- if (!draggedOverCell) {
102
- return undefined;
103
- }
104
- const cellTop = this.list.getCellViewScrollTop(draggedOverCell);
105
- const cellHeight = this.list.elementHeight(draggedOverCell);
106
- const dragPosInElement = dragOffset - cellTop;
107
- const dragPosRatio = dragPosInElement / cellHeight;
108
- return {
109
- browserEvent: event,
110
- draggedOverCell,
111
- cellTop,
112
- cellHeight,
113
- dragPosRatio
114
- };
115
- }
116
- clearGlobalDragState() {
117
- this.notebookEditor.getDomNode().classList.remove(GLOBAL_DRAG_CLASS);
118
- }
119
- onGlobalDragStart() {
120
- this.notebookEditor.getDomNode().classList.add(GLOBAL_DRAG_CLASS);
121
- }
122
- onGlobalDragEnd() {
123
- this.notebookEditor.getDomNode().classList.remove(GLOBAL_DRAG_CLASS);
124
- }
125
- onCellDragover(event) {
126
- if (!event.browserEvent.dataTransfer) {
127
- return;
128
- }
129
- if (!this.currentDraggedCell) {
130
- event.browserEvent.dataTransfer.dropEffect = "none";
131
- return;
132
- }
133
- if (this.isScrolling || this.currentDraggedCell === event.draggedOverCell) {
134
- this.setInsertIndicatorVisibility(false);
135
- return;
136
- }
137
- const dropDirection = this.getDropInsertDirection(event.dragPosRatio);
138
- const insertionIndicatorAbsolutePos = dropDirection === "above" ? event.cellTop : event.cellTop + event.cellHeight;
139
- this.updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos);
140
- }
141
- updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos) {
142
- const {
143
- bottomToolbarGap
144
- } = this.notebookEditor.notebookOptions.computeBottomToolbarDimensions(this.notebookEditor.textModel?.viewType);
145
- const insertionIndicatorTop = insertionIndicatorAbsolutePos - this.list.scrollTop + bottomToolbarGap / 2;
146
- if (insertionIndicatorTop >= 0) {
147
- this.listInsertionIndicator.style.top = `${insertionIndicatorTop}px`;
148
- this.setInsertIndicatorVisibility(true);
149
- } else {
150
- this.setInsertIndicatorVisibility(false);
151
- }
152
- }
153
- getDropInsertDirection(dragPosRatio) {
154
- return dragPosRatio < 0.5 ? "above" : "below";
155
- }
156
- onCellDrop(event) {
157
- const draggedCell = this.currentDraggedCell;
158
- if (this.isScrolling || this.currentDraggedCell === event.draggedOverCell) {
159
- return;
160
- }
161
- this.dragCleanup();
162
- const dropDirection = this.getDropInsertDirection(event.dragPosRatio);
163
- this._dropImpl(draggedCell, dropDirection, event.browserEvent, event.draggedOverCell);
164
- }
165
- getCellRangeAroundDragTarget(draggedCellIndex) {
166
- const selections = this.notebookEditor.getSelections();
167
- const modelRanges = expandCellRangesWithHiddenCells(this.notebookEditor, selections);
168
- const nearestRange = modelRanges.find(range => range.start <= draggedCellIndex && draggedCellIndex < range.end);
169
- if (nearestRange) {
170
- return nearestRange;
171
- } else {
172
- return {
173
- start: draggedCellIndex,
174
- end: draggedCellIndex + 1
175
- };
176
- }
177
- }
178
- _dropImpl(draggedCell, dropDirection, ctx, draggedOverCell) {
179
- const cellTop = this.list.getCellViewScrollTop(draggedOverCell);
180
- const cellHeight = this.list.elementHeight(draggedOverCell);
181
- const insertionIndicatorAbsolutePos = dropDirection === "above" ? cellTop : cellTop + cellHeight;
182
- const {
183
- bottomToolbarGap
184
- } = this.notebookEditor.notebookOptions.computeBottomToolbarDimensions(this.notebookEditor.textModel?.viewType);
185
- const insertionIndicatorTop = insertionIndicatorAbsolutePos - this.list.scrollTop + bottomToolbarGap / 2;
186
- const editorHeight = this.notebookEditor.getDomNode().getBoundingClientRect().height;
187
- if (insertionIndicatorTop < 0 || insertionIndicatorTop > editorHeight) {
188
- return;
189
- }
190
- const isCopy = (ctx.ctrlKey && !isMacintosh) || (ctx.altKey && isMacintosh);
191
- if (!this.notebookEditor.hasModel()) {
192
- return;
193
- }
194
- const textModel = this.notebookEditor.textModel;
195
- if (isCopy) {
196
- const draggedCellIndex = this.notebookEditor.getCellIndex(draggedCell);
197
- const range = this.getCellRangeAroundDragTarget(draggedCellIndex);
198
- let originalToIdx = this.notebookEditor.getCellIndex(draggedOverCell);
199
- if (dropDirection === "below") {
200
- const relativeToIndex = this.notebookEditor.getCellIndex(draggedOverCell);
201
- const newIdx = this.notebookEditor.getNextVisibleCellIndex(relativeToIndex);
202
- originalToIdx = newIdx;
203
- }
204
- let finalSelection;
205
- let finalFocus;
206
- if (originalToIdx <= range.start) {
207
- finalSelection = {
208
- start: originalToIdx,
209
- end: originalToIdx + range.end - range.start
210
- };
211
- finalFocus = {
212
- start: originalToIdx + draggedCellIndex - range.start,
213
- end: originalToIdx + draggedCellIndex - range.start + 1
214
- };
215
- } else {
216
- const delta = (originalToIdx - range.start);
217
- finalSelection = {
218
- start: range.start + delta,
219
- end: range.end + delta
220
- };
221
- finalFocus = {
222
- start: draggedCellIndex + delta,
223
- end: draggedCellIndex + delta + 1
224
- };
225
- }
226
- textModel.applyEdits([{
227
- editType: CellEditType.Replace,
228
- index: originalToIdx,
229
- count: 0,
230
- cells: ( cellRangesToIndexes([range]).map(
231
- index => cloneNotebookCellTextModel(this.notebookEditor.cellAt(index).model)
232
- ))
233
- }], true, {
234
- kind: SelectionStateType.Index,
235
- focus: this.notebookEditor.getFocus(),
236
- selections: this.notebookEditor.getSelections()
237
- }, () => ({
238
- kind: SelectionStateType.Index,
239
- focus: finalFocus,
240
- selections: [finalSelection]
241
- }), undefined, true);
242
- this.notebookEditor.revealCellRangeInView(finalSelection);
243
- } else {
244
- performCellDropEdits(this.notebookEditor, draggedCell, dropDirection, draggedOverCell);
245
- }
246
- }
247
- onCellDragLeave(event) {
248
- if (!event.browserEvent.relatedTarget || !isAncestor(event.browserEvent.relatedTarget, this.notebookEditor.getDomNode())) {
249
- this.setInsertIndicatorVisibility(false);
250
- }
251
- }
252
- dragCleanup() {
253
- if (this.currentDraggedCell) {
254
- this.draggedCells.forEach(cell => cell.dragging = false);
255
- this.currentDraggedCell = undefined;
256
- this.draggedCells = [];
257
- }
258
- this.setInsertIndicatorVisibility(false);
259
- }
260
- registerDragHandle(templateData, cellRoot, dragHandles, dragImageProvider) {
261
- const container = templateData.container;
262
- for (const dragHandle of dragHandles) {
263
- dragHandle.setAttribute("draggable", "true");
264
- }
265
- const onDragEnd = () => {
266
- if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
267
- return;
268
- }
269
- container.classList.remove(DRAGGING_CLASS);
270
- this.dragCleanup();
271
- };
272
- for (const dragHandle of dragHandles) {
273
- templateData.templateDisposables.add(addDisposableListener(dragHandle, EventType.DRAG_END, onDragEnd));
274
- }
275
- const onDragStart = event => {
276
- if (!event.dataTransfer) {
277
- return;
278
- }
279
- if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
280
- return;
281
- }
282
- this.currentDraggedCell = templateData.currentRenderedCell;
283
- this.draggedCells = ( this.notebookEditor.getSelections().map(range => this.notebookEditor.getCellsInRange(range))).flat();
284
- this.draggedCells.forEach(cell => cell.dragging = true);
285
- const dragImage = dragImageProvider();
286
- cellRoot.parentElement.appendChild(dragImage);
287
- event.dataTransfer.setDragImage(dragImage, 0, 0);
288
- setTimeout(() => dragImage.remove(), 0);
289
- };
290
- for (const dragHandle of dragHandles) {
291
- templateData.templateDisposables.add(
292
- addDisposableListener(dragHandle, EventType.DRAG_START, onDragStart)
293
- );
294
- }
295
- }
296
- startExplicitDrag(cell, _dragOffsetY) {
297
- if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
298
- return;
299
- }
300
- this.currentDraggedCell = cell;
301
- this.setInsertIndicatorVisibility(true);
302
- }
303
- explicitDrag(cell, dragOffsetY) {
304
- if (!this.notebookEditor.notebookOptions.getDisplayOptions().dragAndDropEnabled || !!this.notebookEditor.isReadOnly) {
305
- return;
306
- }
307
- const target = this.list.elementAt(dragOffsetY);
308
- if (target && target !== cell) {
309
- const cellTop = this.list.getCellViewScrollTop(target);
310
- const cellHeight = this.list.elementHeight(target);
311
- const dropDirection = this.getExplicitDragDropDirection(dragOffsetY, cellTop, cellHeight);
312
- const insertionIndicatorAbsolutePos = dropDirection === "above" ? cellTop : cellTop + cellHeight;
313
- this.updateInsertIndicator(dropDirection, insertionIndicatorAbsolutePos);
314
- }
315
- if (this.currentDraggedCell !== cell) {
316
- return;
317
- }
318
- const notebookViewRect = this.notebookEditor.getDomNode().getBoundingClientRect();
319
- const eventPositionInView = dragOffsetY - this.list.scrollTop;
320
- const notebookViewScrollMargins = 0.2;
321
- const maxScrollDeltaPerFrame = 20;
322
- const eventPositionRatio = eventPositionInView / notebookViewRect.height;
323
- if (eventPositionRatio < notebookViewScrollMargins) {
324
- this.list.scrollTop -= maxScrollDeltaPerFrame * (1 - eventPositionRatio / notebookViewScrollMargins);
325
- } else if (eventPositionRatio > 1 - notebookViewScrollMargins) {
326
- this.list.scrollTop += maxScrollDeltaPerFrame * (1 - ((1 - eventPositionRatio) / notebookViewScrollMargins));
327
- }
328
- }
329
- endExplicitDrag(_cell) {
330
- this.setInsertIndicatorVisibility(false);
331
- }
332
- explicitDrop(cell, ctx) {
333
- this.currentDraggedCell = undefined;
334
- this.setInsertIndicatorVisibility(false);
335
- const target = this.list.elementAt(ctx.dragOffsetY);
336
- if (!target || target === cell) {
337
- return;
338
- }
339
- const cellTop = this.list.getCellViewScrollTop(target);
340
- const cellHeight = this.list.elementHeight(target);
341
- const dropDirection = this.getExplicitDragDropDirection(ctx.dragOffsetY, cellTop, cellHeight);
342
- this._dropImpl(cell, dropDirection, ctx, target);
343
- }
344
- getExplicitDragDropDirection(clientY, cellTop, cellHeight) {
345
- const dragPosInElement = clientY - cellTop;
346
- const dragPosRatio = dragPosInElement / cellHeight;
347
- return this.getDropInsertDirection(dragPosRatio);
348
- }
349
- dispose() {
350
- this.notebookEditor = null;
351
- super.dispose();
352
- }
353
- }
354
- function performCellDropEdits(editor, draggedCell, dropDirection, draggedOverCell) {
355
- const draggedCellIndex = editor.getCellIndex(draggedCell);
356
- let originalToIdx = editor.getCellIndex(draggedOverCell);
357
- if (typeof draggedCellIndex !== "number" || typeof originalToIdx !== "number") {
358
- return;
359
- }
360
- if (dropDirection === "below") {
361
- const newIdx = editor.getNextVisibleCellIndex(originalToIdx) ?? originalToIdx;
362
- originalToIdx = newIdx;
363
- }
364
- let selections = editor.getSelections();
365
- if (!selections.length) {
366
- selections = [editor.getFocus()];
367
- }
368
- let originalFocusIdx = editor.getFocus().start;
369
- if (!( selections.some(s => s.start <= draggedCellIndex && s.end > draggedCellIndex))) {
370
- selections = [{
371
- start: draggedCellIndex,
372
- end: draggedCellIndex + 1
373
- }];
374
- originalFocusIdx = draggedCellIndex;
375
- }
376
- const droppedInSelection = selections.find(range => range.start <= originalToIdx && range.end > originalToIdx);
377
- if (droppedInSelection) {
378
- originalToIdx = droppedInSelection.start;
379
- }
380
- let numCells = 0;
381
- let focusNewIdx = originalToIdx;
382
- let newInsertionIdx = originalToIdx;
383
- selections.sort((a, b) => b.start - a.start);
384
- const edits = ( selections.map(range => {
385
- const length = range.end - range.start;
386
- let toIndexDelta = 0;
387
- if (range.end <= newInsertionIdx) {
388
- toIndexDelta = -length;
389
- }
390
- const newIdx = newInsertionIdx + toIndexDelta;
391
- if (originalFocusIdx >= range.start && originalFocusIdx <= range.end) {
392
- const offset = originalFocusIdx - range.start;
393
- focusNewIdx = newIdx + offset;
394
- }
395
- const fromIndexDelta = range.start >= originalToIdx ? numCells : 0;
396
- const edit = {
397
- editType: CellEditType.Move,
398
- index: range.start + fromIndexDelta,
399
- length,
400
- newIdx
401
- };
402
- numCells += length;
403
- if (range.end < newInsertionIdx) {
404
- newInsertionIdx -= length;
405
- }
406
- return edit;
407
- }));
408
- const lastEdit = edits[edits.length - 1];
409
- const finalSelection = {
410
- start: lastEdit.newIdx,
411
- end: lastEdit.newIdx + numCells
412
- };
413
- const finalFocus = {
414
- start: focusNewIdx,
415
- end: focusNewIdx + 1
416
- };
417
- editor.textModel.applyEdits(edits, true, {
418
- kind: SelectionStateType.Index,
419
- focus: editor.getFocus(),
420
- selections: editor.getSelections()
421
- }, () => ({
422
- kind: SelectionStateType.Index,
423
- focus: finalFocus,
424
- selections: [finalSelection]
425
- }), undefined, true);
426
- editor.revealCellRangeInView(finalSelection);
427
- }
428
-
429
- export { CellDragAndDropController, CellDragAndDropPart, performCellDropEdits };
@@ -1,6 +0,0 @@
1
- import { ICodeEditor } from "../../../../../../editor/browser/editorBrowser.js";
2
- import { BaseCellRenderTemplate } from "../notebookRenderingCommon.js";
3
- export declare class CodeCellDragImageRenderer {
4
- getDragImage(templateData: BaseCellRenderTemplate, editor: ICodeEditor, type: "code" | "markdown"): HTMLElement;
5
- private getDragImageImpl;
6
- }
@@ -1,108 +0,0 @@
1
-
2
- import { $, createElement, reset } from '../../../../../../base/browser/dom.js';
3
- import { createTrustedTypesPolicy } from '../../../../../../base/browser/trustedTypes.js';
4
- import { Color } from '../../../../../../base/common/color.js';
5
- import { isWindows } from '../../../../../../base/common/platform.js';
6
- import { EditorOption } from '../../../../../../editor/common/config/editorOptions.js';
7
- import { Range } from '../../../../../../editor/common/core/range.js';
8
- import { ColorId } from '../../../../../../editor/common/encodedTokenAttributes.js';
9
- import { TokenizationRegistry } from '../../../../../../editor/common/languages.js';
10
- import { tokenizeLineToHTML } from '../../../../../../editor/common/languages/textToHtmlTokenizer.js';
11
-
12
- class EditorTextRenderer {
13
- static {
14
- this._ttPolicy = createTrustedTypesPolicy("cellRendererEditorText", {
15
- createHTML(input) {
16
- return input;
17
- }
18
- });
19
- }
20
- getRichText(editor, modelRange) {
21
- const model = editor.getModel();
22
- if (!model) {
23
- return null;
24
- }
25
- const colorMap = this.getDefaultColorMap();
26
- const fontInfo = editor.getOptions().get(EditorOption.fontInfo);
27
- const fontFamilyVar = "--notebook-editor-font-family";
28
- const fontSizeVar = "--notebook-editor-font-size";
29
- const fontWeightVar = "--notebook-editor-font-weight";
30
- const style = `` + `color: ${colorMap[ColorId.DefaultForeground]};` + `background-color: ${colorMap[ColorId.DefaultBackground]};` + `font-family: var(${fontFamilyVar});` + `font-weight: var(${fontWeightVar});` + `font-size: var(${fontSizeVar});` + `line-height: ${fontInfo.lineHeight}px;` + `white-space: pre;`;
31
- const element = $("div", {
32
- style
33
- });
34
- const fontSize = fontInfo.fontSize;
35
- const fontWeight = fontInfo.fontWeight;
36
- element.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
37
- element.style.setProperty(fontSizeVar, `${fontSize}px`);
38
- element.style.setProperty(fontWeightVar, fontWeight);
39
- const linesHtml = this.getRichTextLinesAsHtml(model, modelRange, colorMap);
40
- element.innerHTML = linesHtml;
41
- return element;
42
- }
43
- getRichTextLinesAsHtml(model, modelRange, colorMap) {
44
- const startLineNumber = modelRange.startLineNumber;
45
- const startColumn = modelRange.startColumn;
46
- const endLineNumber = modelRange.endLineNumber;
47
- const endColumn = modelRange.endColumn;
48
- const tabSize = model.getOptions().tabSize;
49
- let result = "";
50
- for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) {
51
- const lineTokens = model.tokenization.getLineTokens(lineNumber);
52
- const lineContent = lineTokens.getLineContent();
53
- const startOffset = (lineNumber === startLineNumber ? startColumn - 1 : 0);
54
- const endOffset = (lineNumber === endLineNumber ? endColumn - 1 : lineContent.length);
55
- if (lineContent === "") {
56
- result += "<br>";
57
- } else {
58
- result += tokenizeLineToHTML(
59
- lineContent,
60
- lineTokens.inflate(),
61
- colorMap,
62
- startOffset,
63
- endOffset,
64
- tabSize,
65
- isWindows
66
- );
67
- }
68
- }
69
- return EditorTextRenderer._ttPolicy?.createHTML(result) ?? result;
70
- }
71
- getDefaultColorMap() {
72
- const colorMap = TokenizationRegistry.getColorMap();
73
- const result = ["#000000"];
74
- if (colorMap) {
75
- for (let i = 1, len = colorMap.length; i < len; i++) {
76
- result[i] = Color.Format.CSS.formatHex(colorMap[i]);
77
- }
78
- }
79
- return result;
80
- }
81
- }
82
- class CodeCellDragImageRenderer {
83
- getDragImage(templateData, editor, type) {
84
- let dragImage = this.getDragImageImpl(templateData, editor, type);
85
- if (!dragImage) {
86
- dragImage = createElement("div");
87
- dragImage.textContent = "1 cell";
88
- }
89
- return dragImage;
90
- }
91
- getDragImageImpl(templateData, editor, type) {
92
- const dragImageContainer = templateData.container.cloneNode(true);
93
- dragImageContainer.classList.forEach(c => dragImageContainer.classList.remove(c));
94
- dragImageContainer.classList.add("cell-drag-image", "monaco-list-row", "focused", `${type}-cell-row`);
95
- const editorContainer = dragImageContainer.querySelector(".cell-editor-container");
96
- if (!editorContainer) {
97
- return null;
98
- }
99
- const richEditorText = ( new EditorTextRenderer()).getRichText(editor, ( new Range(1, 1, 1, 1000)));
100
- if (!richEditorText) {
101
- return null;
102
- }
103
- reset(editorContainer, richEditorText);
104
- return dragImageContainer;
105
- }
106
- }
107
-
108
- export { CodeCellDragImageRenderer };
@@ -1,36 +0,0 @@
1
- import { Event } from "../../../../../../base/common/event.js";
2
- import { URI } from "../../../../../../base/common/uri.js";
3
- import { IEditorOptions } from "../../../../../../editor/common/config/editorOptions.js";
4
- import { IConfigurationService } from "../../../../../../platform/configuration/common/configuration.service.js";
5
- import { IBaseCellEditorOptions, ICellViewModel } from "../../notebookBrowser.js";
6
- import { CellContentPart } from "../cellPart.js";
7
- import { NotebookCellInternalMetadata } from "../../../common/notebookCommon.js";
8
- import { NotebookOptions } from "../../notebookOptions.js";
9
- import { CellViewModelStateChangeEvent } from "../../notebookViewEvents.js";
10
- import { ITextModelUpdateOptions } from "../../../../../../editor/common/model.js";
11
- export declare class CellEditorOptions extends CellContentPart implements ITextModelUpdateOptions {
12
- private readonly base;
13
- readonly notebookOptions: NotebookOptions;
14
- readonly configurationService: IConfigurationService;
15
- private _lineNumbers;
16
- private _tabSize?;
17
- private _indentSize?;
18
- private _insertSpaces?;
19
- set tabSize(value: number | undefined);
20
- get tabSize(): number | undefined;
21
- set indentSize(value: number | "tabSize" | undefined);
22
- get indentSize(): number | "tabSize" | undefined;
23
- set insertSpaces(value: boolean | undefined);
24
- get insertSpaces(): boolean | undefined;
25
- private readonly _onDidChange;
26
- readonly onDidChange: Event<void>;
27
- private _value;
28
- constructor(base: IBaseCellEditorOptions, notebookOptions: NotebookOptions, configurationService: IConfigurationService);
29
- updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void;
30
- private _recomputeOptions;
31
- private _computeEditorOptions;
32
- getUpdatedValue(internalMetadata: NotebookCellInternalMetadata, cellUri: URI): IEditorOptions;
33
- getValue(internalMetadata: NotebookCellInternalMetadata, cellUri: URI): IEditorOptions;
34
- getDefaultValue(): IEditorOptions;
35
- setLineNumbers(lineNumbers: "on" | "off" | "inherit"): void;
36
- }