@codingame/monaco-vscode-katex-common 29.1.1 → 30.0.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 (180) hide show
  1. package/package.json +2 -2
  2. package/vscode/src/vs/platform/actions/browser/buttonbar.js +14 -13
  3. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +34 -34
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -20
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +14 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +208 -0
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +22 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +637 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
  15. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +9 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +202 -13
  17. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +4 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +17 -8
  19. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +53 -5
  21. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +296 -63
  22. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +59 -23
  23. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -42
  24. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
  25. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +110 -59
  26. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  27. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +5 -4
  31. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +24 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +384 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
  34. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +12 -7
  35. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +220 -61
  36. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +1 -2
  37. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
  38. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +14 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
  42. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
  44. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
  45. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
  46. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +5 -4
  47. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
  48. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
  49. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
  50. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +5 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +14 -14
  52. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +11 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -12
  54. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
  55. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
  56. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +1 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +97 -54
  59. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +5 -4
  60. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
  61. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
  62. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +6 -6
  63. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +8 -7
  64. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +15 -2
  66. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +155 -22
  67. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
  68. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +3 -1
  69. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +36 -19
  70. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
  71. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
  73. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
  74. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +13 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
  76. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
  77. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
  78. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.d.ts +17 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +68 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
  82. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +16 -16
  83. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +33 -25
  84. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -7
  85. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +12 -3
  86. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
  87. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
  88. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
  89. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
  90. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +4 -13
  91. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +37 -113
  92. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +1 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +10 -3
  94. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +66 -39
  95. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
  96. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +13 -2
  97. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +103 -61
  98. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +2 -1
  99. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +35 -23
  100. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -4
  101. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +6 -6
  102. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
  103. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +1 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +2 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -24
  107. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +6 -5
  108. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +44 -18
  109. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
  110. package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +60 -10
  111. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
  112. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
  113. package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
  114. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
  115. package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +4 -0
  116. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
  117. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
  118. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -1
  119. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +5 -2
  120. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +6 -11
  121. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -39
  123. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
  124. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
  125. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
  126. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
  127. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +746 -0
  128. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
  129. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +300 -0
  130. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
  131. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
  132. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
  133. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1963 -0
  134. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
  135. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +314 -0
  136. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
  137. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +886 -0
  138. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
  139. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +118 -0
  140. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
  141. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +71 -0
  142. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
  143. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
  144. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
  145. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +313 -0
  146. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
  147. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +265 -0
  148. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
  149. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +185 -0
  150. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
  151. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +104 -0
  152. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
  153. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +43 -0
  154. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
  155. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +41 -0
  156. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
  157. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +69 -0
  158. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
  159. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
  160. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +933 -0
  161. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
  162. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +32 -0
  163. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
  164. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +643 -0
  165. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
  166. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +197 -0
  167. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
  168. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +539 -0
  169. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
  170. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
  171. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
  172. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +90 -0
  173. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
  174. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
  175. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
  176. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -152
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1317
  179. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +0 -47
  180. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +0 -95
@@ -0,0 +1,51 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
3
+ import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
4
+ import { CellDiffInfo } from "../notebookDiffViewModel.js";
5
+ import { INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
6
+ import { MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
7
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
8
+ import { IActionViewItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar";
9
+ export interface INotebookDeletedCellDecorator {
10
+ getTop(deletedIndex: number): number | undefined;
11
+ }
12
+ export declare class NotebookDeletedCellDecorator extends Disposable implements INotebookDeletedCellDecorator {
13
+ private readonly _notebookEditor;
14
+ private readonly toolbar;
15
+ private readonly languageService;
16
+ private readonly instantiationService;
17
+ private readonly zoneRemover;
18
+ private readonly createdViewZones;
19
+ private readonly deletedCellInfos;
20
+ constructor(_notebookEditor: INotebookEditor, toolbar: {
21
+ menuId: MenuId;
22
+ className: string;
23
+ telemetrySource?: string;
24
+ argFactory: (deletedCellIndex: number) => any;
25
+ actionViewItemProvider?: IActionViewItemProvider;
26
+ } | undefined, languageService: ILanguageService, instantiationService: IInstantiationService);
27
+ getTop(deletedIndex: number): number | undefined;
28
+ reveal(deletedIndex: number): void;
29
+ apply(diffInfo: CellDiffInfo[], original: NotebookTextModel): void;
30
+ clear(): void;
31
+ private _createWidget;
32
+ private _createWidgetImpl;
33
+ }
34
+ export declare class NotebookDeletedCellWidget extends Disposable {
35
+ private readonly _notebookEditor;
36
+ private readonly _toolbarOptions;
37
+ private readonly code;
38
+ private readonly language;
39
+ private readonly _originalIndex;
40
+ private readonly languageService;
41
+ private readonly instantiationService;
42
+ private readonly container;
43
+ constructor(_notebookEditor: INotebookEditor, _toolbarOptions: {
44
+ menuId: MenuId;
45
+ className: string;
46
+ telemetrySource?: string;
47
+ argFactory: (deletedCellIndex: number) => any;
48
+ actionViewItemProvider?: IActionViewItemProvider;
49
+ } | undefined, code: string, language: string, container: HTMLElement, _originalIndex: number, languageService: ILanguageService, instantiationService: IInstantiationService);
50
+ render(): Promise<number>;
51
+ }
@@ -0,0 +1,265 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { createTrustedTypesPolicy } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/trustedTypes';
4
+ import { Disposable, DisposableStore, toDisposable, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { splitLines } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
6
+ import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
7
+ import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
8
+ import { tokenizeToString } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/textToHtmlTokenizer';
9
+ import { DefaultLineHeight } from '../diffElementViewModel.js';
10
+ import { NotebookOverviewRulerLane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
11
+ import { createElement, append, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
12
+ import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
13
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
14
+ import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
15
+ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
16
+ import { overviewRulerDeletedForeground } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff';
17
+
18
+ const ttPolicy = createTrustedTypesPolicy("notebookRenderer", {
19
+ createHTML: value => value
20
+ });
21
+ let NotebookDeletedCellDecorator = class NotebookDeletedCellDecorator extends Disposable {
22
+ constructor(_notebookEditor, toolbar, languageService, instantiationService) {
23
+ super();
24
+ this._notebookEditor = _notebookEditor;
25
+ this.toolbar = toolbar;
26
+ this.languageService = languageService;
27
+ this.instantiationService = instantiationService;
28
+ this.zoneRemover = this._register(( new DisposableStore()));
29
+ this.createdViewZones = ( new Map());
30
+ this.deletedCellInfos = ( new Map());
31
+ }
32
+ getTop(deletedIndex) {
33
+ const info = this.deletedCellInfos.get(deletedIndex);
34
+ if (!info) {
35
+ return;
36
+ }
37
+ if (info.previousIndex === -1) {
38
+ return 0;
39
+ }
40
+ const cells = this._notebookEditor.getCellsInRange({
41
+ start: info.previousIndex,
42
+ end: info.previousIndex + 1
43
+ });
44
+ if (!cells.length) {
45
+ return this._notebookEditor.getLayoutInfo().height + info.offset;
46
+ }
47
+ const cell = cells[0];
48
+ const cellHeight = this._notebookEditor.getHeightOfElement(cell);
49
+ const top = this._notebookEditor.getAbsoluteTopOfElement(cell);
50
+ return top + cellHeight + info.offset;
51
+ }
52
+ reveal(deletedIndex) {
53
+ const top = this.getTop(deletedIndex);
54
+ if (typeof top === "number") {
55
+ this._notebookEditor.focusContainer();
56
+ this._notebookEditor.revealOffsetInCenterIfOutsideViewport(top);
57
+ const info = this.deletedCellInfos.get(deletedIndex);
58
+ if (info) {
59
+ const prevIndex = info.previousIndex === -1 ? 0 : info.previousIndex;
60
+ this._notebookEditor.setFocus({
61
+ start: prevIndex,
62
+ end: prevIndex
63
+ });
64
+ this._notebookEditor.setSelections([{
65
+ start: prevIndex,
66
+ end: prevIndex
67
+ }]);
68
+ }
69
+ }
70
+ }
71
+ apply(diffInfo, original) {
72
+ this.clear();
73
+ let currentIndex = -1;
74
+ const deletedCellsToRender = {
75
+ cells: [],
76
+ index: 0
77
+ };
78
+ diffInfo.forEach(diff => {
79
+ if (diff.type === "delete") {
80
+ const deletedCell = original.cells[diff.originalCellIndex];
81
+ if (deletedCell) {
82
+ deletedCellsToRender.cells.push({
83
+ cell: deletedCell,
84
+ originalIndex: diff.originalCellIndex,
85
+ previousIndex: currentIndex
86
+ });
87
+ deletedCellsToRender.index = currentIndex;
88
+ }
89
+ } else {
90
+ if (deletedCellsToRender.cells.length) {
91
+ this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
92
+ deletedCellsToRender.cells.length = 0;
93
+ }
94
+ currentIndex = diff.modifiedCellIndex;
95
+ }
96
+ });
97
+ if (deletedCellsToRender.cells.length) {
98
+ this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
99
+ }
100
+ }
101
+ clear() {
102
+ this.deletedCellInfos.clear();
103
+ this.zoneRemover.clear();
104
+ }
105
+ _createWidget(index, cells) {
106
+ this._createWidgetImpl(index, cells);
107
+ }
108
+ async _createWidgetImpl(index, cells) {
109
+ const rootContainer = createElement("div");
110
+ const widgets = [];
111
+ const heights = await Promise.all(( cells.map(async cell => {
112
+ const widget = ( new NotebookDeletedCellWidget(
113
+ this._notebookEditor,
114
+ this.toolbar,
115
+ cell.cell.getValue(),
116
+ cell.cell.language,
117
+ rootContainer,
118
+ cell.originalIndex,
119
+ this.languageService,
120
+ this.instantiationService
121
+ ));
122
+ widgets.push(widget);
123
+ const height = await widget.render();
124
+ this.deletedCellInfos.set(cell.originalIndex, {
125
+ height,
126
+ previousIndex: cell.previousIndex,
127
+ offset: 0
128
+ });
129
+ return height;
130
+ })));
131
+ Array.from(( this.deletedCellInfos.keys())).sort((a, b) => a - b).forEach(originalIndex => {
132
+ const previousDeletedCell = this.deletedCellInfos.get(originalIndex - 1);
133
+ if (previousDeletedCell) {
134
+ const deletedCell = this.deletedCellInfos.get(originalIndex);
135
+ if (deletedCell) {
136
+ deletedCell.offset = previousDeletedCell.height + previousDeletedCell.offset;
137
+ }
138
+ }
139
+ });
140
+ const totalHeight = heights.reduce((prev, curr) => prev + curr, 0);
141
+ this._notebookEditor.changeViewZones(accessor => {
142
+ const notebookViewZone = {
143
+ afterModelPosition: index,
144
+ heightInPx: totalHeight + 4,
145
+ domNode: rootContainer
146
+ };
147
+ const id = accessor.addZone(notebookViewZone);
148
+ accessor.layoutZone(id);
149
+ this.createdViewZones.set(index, id);
150
+ const deletedCellOverviewRulereDecorationIds = this._notebookEditor.deltaCellDecorations([], [{
151
+ viewZoneId: id,
152
+ options: {
153
+ overviewRuler: {
154
+ color: overviewRulerDeletedForeground,
155
+ position: NotebookOverviewRulerLane.Center
156
+ }
157
+ }
158
+ }]);
159
+ this.zoneRemover.add(toDisposable(() => {
160
+ if (this.createdViewZones.get(index) === id) {
161
+ this.createdViewZones.delete(index);
162
+ }
163
+ if (!this._notebookEditor.isDisposed) {
164
+ this._notebookEditor.changeViewZones(accessor => {
165
+ accessor.removeZone(id);
166
+ dispose(widgets);
167
+ });
168
+ this._notebookEditor.deltaCellDecorations(deletedCellOverviewRulereDecorationIds, []);
169
+ }
170
+ }));
171
+ });
172
+ }
173
+ };
174
+ NotebookDeletedCellDecorator = ( __decorate([( __param(2, ILanguageService)), ( __param(3, IInstantiationService))], NotebookDeletedCellDecorator));
175
+ let NotebookDeletedCellWidget = class NotebookDeletedCellWidget extends Disposable {
176
+ constructor(
177
+ _notebookEditor,
178
+ _toolbarOptions,
179
+ code,
180
+ language,
181
+ container,
182
+ _originalIndex,
183
+ languageService,
184
+ instantiationService
185
+ ) {
186
+ super();
187
+ this._notebookEditor = _notebookEditor;
188
+ this._toolbarOptions = _toolbarOptions;
189
+ this.code = code;
190
+ this.language = language;
191
+ this._originalIndex = _originalIndex;
192
+ this.languageService = languageService;
193
+ this.instantiationService = instantiationService;
194
+ this.container = append(container, createElement("div"));
195
+ this._register(toDisposable(() => {
196
+ container.removeChild(this.container);
197
+ }));
198
+ }
199
+ async render() {
200
+ const code = this.code;
201
+ const languageId = this.language;
202
+ const codeHtml = await tokenizeToString(this.languageService, code, languageId);
203
+ const fontInfo = this._notebookEditor.getBaseCellEditorOptions(languageId).value;
204
+ const fontFamilyVar = "--notebook-editor-font-family";
205
+ const fontSizeVar = "--notebook-editor-font-size";
206
+ const fontWeightVar = "--notebook-editor-font-weight";
207
+ const editor = ( this._notebookEditor.codeEditors.map(c => c[1])).find(c => c);
208
+ const layoutInfo = editor?.getOptions().get(EditorOption.layoutInfo);
209
+ const style = `` + `font-family: var(${fontFamilyVar});` + `font-weight: var(${fontWeightVar});` + `font-size: var(${fontSizeVar});` + fontInfo.lineHeight ? `line-height: ${fontInfo.lineHeight}px;` : "" + layoutInfo?.contentLeft ? `margin-left: ${layoutInfo}px;` : "" + `white-space: pre;`;
210
+ const rootContainer = this.container;
211
+ rootContainer.classList.add("code-cell-row");
212
+ if (this._toolbarOptions) {
213
+ const toolbar = createElement("div");
214
+ toolbar.className = this._toolbarOptions.className;
215
+ rootContainer.appendChild(toolbar);
216
+ const scopedInstaService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._notebookEditor.scopedContextKeyService]))));
217
+ const toolbarWidget = scopedInstaService.createInstance(MenuWorkbenchToolBar, toolbar, this._toolbarOptions.menuId, {
218
+ telemetrySource: this._toolbarOptions.telemetrySource,
219
+ hiddenItemStrategy: HiddenItemStrategy.NoHide,
220
+ toolbarOptions: {
221
+ primaryGroup: () => true
222
+ },
223
+ menuOptions: {
224
+ renderShortTitle: true,
225
+ arg: this._toolbarOptions.argFactory(this._originalIndex)
226
+ },
227
+ actionViewItemProvider: this._toolbarOptions.actionViewItemProvider
228
+ });
229
+ this._store.add(toolbarWidget);
230
+ toolbar.style.position = "absolute";
231
+ toolbar.style.right = "40px";
232
+ toolbar.style.zIndex = "10";
233
+ toolbar.classList.add("hover");
234
+ }
235
+ const container = append(rootContainer, $(".cell-inner-container"));
236
+ container.style.position = "relative";
237
+ const focusIndicatorLeft = append(container, $(
238
+ ".cell-focus-indicator.cell-focus-indicator-side.cell-focus-indicator-left"
239
+ ));
240
+ const cellContainer = append(container, $(".cell.code"));
241
+ append(focusIndicatorLeft, $("div.execution-count-label"));
242
+ const editorPart = append(cellContainer, $(".cell-editor-part"));
243
+ let editorContainer = append(editorPart, $(".cell-editor-container"));
244
+ editorContainer = append(editorContainer, $(".code", {
245
+ style
246
+ }));
247
+ if (fontInfo.fontFamily) {
248
+ editorContainer.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
249
+ }
250
+ if (fontInfo.fontSize) {
251
+ editorContainer.style.setProperty(fontSizeVar, `${fontInfo.fontSize}px`);
252
+ }
253
+ if (fontInfo.fontWeight) {
254
+ editorContainer.style.setProperty(fontWeightVar, fontInfo.fontWeight);
255
+ }
256
+ editorContainer.innerHTML = (ttPolicy?.createHTML(codeHtml) || codeHtml);
257
+ const lineCount = splitLines(code).length;
258
+ const height = (lineCount * (fontInfo.lineHeight || DefaultLineHeight)) + 12 + 12;
259
+ const totalHeight = height + 16 + 16;
260
+ return totalHeight;
261
+ }
262
+ };
263
+ NotebookDeletedCellWidget = ( __decorate([( __param(6, ILanguageService)), ( __param(7, IInstantiationService))], NotebookDeletedCellWidget));
264
+
265
+ export { NotebookDeletedCellDecorator, NotebookDeletedCellWidget };
@@ -0,0 +1,24 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
3
+ import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
4
+ import { INotebookEditorContribution, INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
5
+ import { INotebookLoggingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
6
+ export declare class NotebookInlineDiffDecorationContribution extends Disposable implements INotebookEditorContribution {
7
+ private readonly notebookEditor;
8
+ private readonly notebookEditorWorkerService;
9
+ private readonly instantiationService;
10
+ private readonly logService;
11
+ static ID: string;
12
+ private previous?;
13
+ private insertedCellDecorator;
14
+ private deletedCellDecorator;
15
+ private readonly cellDecorators;
16
+ private cachedNotebookDiff?;
17
+ private listeners;
18
+ constructor(notebookEditor: INotebookEditor, notebookEditorWorkerService: INotebookEditorWorkerService, instantiationService: IInstantiationService, logService: INotebookLoggingService);
19
+ private clear;
20
+ dispose(): void;
21
+ private initialize;
22
+ private _update;
23
+ private updateCells;
24
+ }
@@ -0,0 +1,185 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
6
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
7
+ import { INotebookEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service';
8
+ import { registerNotebookContribution } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
9
+ import { NotebookCellDiffDecorator } from './notebookCellDiffDecorator.js';
10
+ import { NotebookDeletedCellDecorator } from './notebookDeletedCellDecorator.js';
11
+ import { NotebookInsertedCellDecorator } from './notebookInsertedCellDecorator.js';
12
+ import { INotebookLoggingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
13
+ import { computeDiff } from '../../../common/notebookDiff.js';
14
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
15
+ import './notebookOriginalModelRefFactory.js';
16
+ import './notebookOriginalCellModelFactory.js';
17
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
18
+
19
+ let NotebookInlineDiffDecorationContribution = class NotebookInlineDiffDecorationContribution extends Disposable {
20
+ static {
21
+ this.ID = "workbench.notebook.inlineDiffDecoration";
22
+ }
23
+ constructor(
24
+ notebookEditor,
25
+ notebookEditorWorkerService,
26
+ instantiationService,
27
+ logService
28
+ ) {
29
+ super();
30
+ this.notebookEditor = notebookEditor;
31
+ this.notebookEditorWorkerService = notebookEditorWorkerService;
32
+ this.instantiationService = instantiationService;
33
+ this.logService = logService;
34
+ this.cellDecorators = ( new Map());
35
+ this.listeners = [];
36
+ this.logService.debug("inlineDiff", "Watching for previous model");
37
+ this._register(autorun(reader => {
38
+ this.previous = this.notebookEditor.notebookOptions.previousModelToCompare.read(reader);
39
+ if (this.previous) {
40
+ this.logService.debug("inlineDiff", "Previous model set");
41
+ if (this.notebookEditor.hasModel()) {
42
+ this.initialize();
43
+ } else {
44
+ this.logService.debug("inlineDiff", "Waiting for model to attach");
45
+ this.listeners.push(
46
+ Event.once(this.notebookEditor.onDidAttachViewModel)(() => this.initialize())
47
+ );
48
+ }
49
+ }
50
+ }));
51
+ }
52
+ clear() {
53
+ this.listeners.forEach(l => l.dispose());
54
+ this.cellDecorators.forEach((v, cell) => {
55
+ v.dispose();
56
+ this.cellDecorators.delete(cell);
57
+ });
58
+ this.insertedCellDecorator?.dispose();
59
+ this.deletedCellDecorator?.dispose();
60
+ this.cachedNotebookDiff = undefined;
61
+ this.listeners = [];
62
+ this.logService.debug("inlineDiff", "Cleared decorations and listeners");
63
+ }
64
+ dispose() {
65
+ this.logService.debug("inlineDiff", "Disposing");
66
+ this.clear();
67
+ super.dispose();
68
+ }
69
+ initialize() {
70
+ this.clear();
71
+ if (!this.previous) {
72
+ return;
73
+ }
74
+ this.insertedCellDecorator = this.instantiationService.createInstance(NotebookInsertedCellDecorator, this.notebookEditor);
75
+ this.deletedCellDecorator = this.instantiationService.createInstance(NotebookDeletedCellDecorator, this.notebookEditor, undefined);
76
+ this._update();
77
+ const onVisibleChange = Event.debounce(
78
+ this.notebookEditor.onDidChangeVisibleRanges,
79
+ e => e,
80
+ 100,
81
+ undefined,
82
+ undefined,
83
+ undefined,
84
+ this._store
85
+ );
86
+ this.listeners.push(onVisibleChange(() => this._update()));
87
+ this.listeners.push(this.notebookEditor.onDidChangeModel(() => this._update()));
88
+ if (this.notebookEditor.textModel) {
89
+ const onContentChange = Event.debounce(
90
+ this.notebookEditor.textModel.onDidChangeContent,
91
+ (_, event) => event,
92
+ 100,
93
+ undefined,
94
+ undefined,
95
+ undefined,
96
+ this._store
97
+ );
98
+ const onOriginalContentChange = Event.debounce(
99
+ this.previous.onDidChangeContent,
100
+ (_, event) => event,
101
+ 100,
102
+ undefined,
103
+ undefined,
104
+ undefined,
105
+ this._store
106
+ );
107
+ this.listeners.push(onContentChange(() => this._update()));
108
+ this.listeners.push(onOriginalContentChange(() => this._update()));
109
+ }
110
+ this.logService.debug("inlineDiff", "Initialized");
111
+ }
112
+ async _update() {
113
+ const current = this.notebookEditor.getViewModel()?.notebookDocument;
114
+ if (!this.previous || !current) {
115
+ this.logService.debug("inlineDiff", "Update skipped - no original or current document");
116
+ return;
117
+ }
118
+ if (!this.cachedNotebookDiff || this.cachedNotebookDiff.originalVersion !== this.previous.versionId || this.cachedNotebookDiff.version !== current.versionId) {
119
+ let diffInfo = {
120
+ cellDiffInfo: []
121
+ };
122
+ try {
123
+ const notebookDiff = await this.notebookEditorWorkerService.computeDiff(this.previous.uri, current.uri);
124
+ diffInfo = computeDiff(this.previous, current, notebookDiff);
125
+ } catch (e) {
126
+ this.logService.error("inlineDiff", "Error computing diff:\n" + e);
127
+ return;
128
+ }
129
+ this.cachedNotebookDiff = {
130
+ cellDiffInfo: diffInfo.cellDiffInfo,
131
+ originalVersion: this.previous.versionId,
132
+ version: current.versionId
133
+ };
134
+ this.insertedCellDecorator?.apply(diffInfo.cellDiffInfo);
135
+ this.deletedCellDecorator?.apply(diffInfo.cellDiffInfo, this.previous);
136
+ }
137
+ await this.updateCells(this.previous, current, this.cachedNotebookDiff.cellDiffInfo);
138
+ }
139
+ async updateCells(original, modified, cellDiffs) {
140
+ const validDiffDecorators = ( new Set());
141
+ cellDiffs.forEach(diff => {
142
+ if (diff.type === "modified") {
143
+ const modifiedCell = modified.cells[diff.modifiedCellIndex];
144
+ const originalCell = original.cells[diff.originalCellIndex];
145
+ const editor = this.notebookEditor.codeEditors.find(([vm]) => vm.handle === modifiedCell.handle)?.[1];
146
+ if (editor) {
147
+ const currentDecorator = this.cellDecorators.get(modifiedCell);
148
+ if ((currentDecorator?.modifiedCell !== modifiedCell || currentDecorator?.originalCell !== originalCell)) {
149
+ currentDecorator?.dispose();
150
+ const decorator = this.instantiationService.createInstance(
151
+ NotebookCellDiffDecorator,
152
+ this.notebookEditor,
153
+ modifiedCell,
154
+ originalCell,
155
+ editor
156
+ );
157
+ this.cellDecorators.set(modifiedCell, decorator);
158
+ validDiffDecorators.add(decorator);
159
+ this._register(editor.onDidDispose(() => {
160
+ decorator.dispose();
161
+ if (this.cellDecorators.get(modifiedCell) === decorator) {
162
+ this.cellDecorators.delete(modifiedCell);
163
+ }
164
+ }));
165
+ } else if (currentDecorator) {
166
+ validDiffDecorators.add(currentDecorator);
167
+ }
168
+ }
169
+ }
170
+ });
171
+ this.cellDecorators.forEach((v, cell) => {
172
+ if (!( validDiffDecorators.has(v))) {
173
+ v.dispose();
174
+ this.cellDecorators.delete(cell);
175
+ }
176
+ });
177
+ }
178
+ };
179
+ NotebookInlineDiffDecorationContribution = ( __decorate([( __param(1, INotebookEditorWorkerService)), ( __param(2, IInstantiationService)), ( __param(3, INotebookLoggingService))], NotebookInlineDiffDecorationContribution));
180
+ registerNotebookContribution(
181
+ NotebookInlineDiffDecorationContribution.ID,
182
+ NotebookInlineDiffDecorationContribution
183
+ );
184
+
185
+ export { NotebookInlineDiffDecorationContribution };
@@ -0,0 +1,28 @@
1
+ import * as DOM from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
2
+ import { CodeWindow } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/window";
3
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
5
+ import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
6
+ import { NotebookDiffEditorInput } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/notebookDiffEditorInput";
7
+ import { INotebookEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
8
+ import { NotebookEditorWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget";
9
+ import { NotebookOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions";
10
+ import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
11
+ export declare class NotebookInlineDiffWidget extends Disposable {
12
+ private readonly rootElement;
13
+ private readonly groupId;
14
+ private readonly window;
15
+ private readonly options;
16
+ private dimension;
17
+ private readonly instantiationService;
18
+ private readonly widgetService;
19
+ private widget;
20
+ private position;
21
+ get editorWidget(): NotebookEditorWidget | undefined;
22
+ constructor(rootElement: HTMLElement, groupId: number, window: CodeWindow, options: NotebookOptions, dimension: DOM.Dimension | undefined, instantiationService: IInstantiationService, widgetService: INotebookEditorService);
23
+ show(input: NotebookDiffEditorInput, model: NotebookTextModel | undefined, previousModel: NotebookTextModel | undefined, options: INotebookEditorOptions | undefined): Promise<void>;
24
+ hide(): void;
25
+ setLayout(dimension: DOM.Dimension, position: DOM.IDomPosition): void;
26
+ private createNotebookWidget;
27
+ dispose(): void;
28
+ }
@@ -0,0 +1,104 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { setParentFlowTo } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
6
+ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
7
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
8
+ import { NotebookInlineDiffDecorationContribution } from './notebookInlineDiff.js';
9
+ import { NotebookEditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
10
+ import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
11
+
12
+ let NotebookInlineDiffWidget = class NotebookInlineDiffWidget extends Disposable {
13
+ get editorWidget() {
14
+ return this.widget.value;
15
+ }
16
+ constructor(
17
+ rootElement,
18
+ groupId,
19
+ window,
20
+ options,
21
+ dimension,
22
+ instantiationService,
23
+ widgetService
24
+ ) {
25
+ super();
26
+ this.rootElement = rootElement;
27
+ this.groupId = groupId;
28
+ this.window = window;
29
+ this.options = options;
30
+ this.dimension = dimension;
31
+ this.instantiationService = instantiationService;
32
+ this.widgetService = widgetService;
33
+ this.widget = {
34
+ value: undefined
35
+ };
36
+ }
37
+ async show(input, model, previousModel, options) {
38
+ if (!this.widget.value) {
39
+ this.createNotebookWidget(input, this.groupId, this.rootElement);
40
+ }
41
+ if (this.dimension) {
42
+ this.widget.value?.layout(this.dimension, this.rootElement, this.position);
43
+ }
44
+ if (model) {
45
+ await this.widget.value?.setOptions({
46
+ ...options
47
+ });
48
+ this.widget.value?.notebookOptions.previousModelToCompare.set(previousModel, undefined);
49
+ await this.widget.value.setModel(model, options?.viewState);
50
+ }
51
+ }
52
+ hide() {
53
+ if (this.widget.value) {
54
+ this.widget.value.notebookOptions.previousModelToCompare.set(undefined, undefined);
55
+ this.widget.value.onWillHide();
56
+ }
57
+ }
58
+ setLayout(dimension, position) {
59
+ this.dimension = dimension;
60
+ this.position = position;
61
+ }
62
+ createNotebookWidget(input, groupId, rootElement) {
63
+ const contributions = NotebookEditorExtensionsRegistry.getSomeEditorContributions([NotebookInlineDiffDecorationContribution.ID]);
64
+ const menuIds = {
65
+ notebookToolbar: MenuId.NotebookToolbar,
66
+ cellTitleToolbar: MenuId.NotebookCellTitle,
67
+ cellDeleteToolbar: MenuId.NotebookCellDelete,
68
+ cellInsertToolbar: MenuId.NotebookCellBetween,
69
+ cellTopInsertToolbar: MenuId.NotebookCellListTop,
70
+ cellExecuteToolbar: MenuId.NotebookCellExecute,
71
+ cellExecutePrimary: undefined
72
+ };
73
+ const skipContributions = [
74
+ "editor.contrib.review",
75
+ "editor.contrib.floatingClickMenu",
76
+ "editor.contrib.dirtydiff",
77
+ "editor.contrib.testingOutputPeek",
78
+ "editor.contrib.testingDecorations",
79
+ "store.contrib.stickyScrollController",
80
+ "editor.contrib.findController",
81
+ "editor.contrib.emptyTextEditorHint"
82
+ ];
83
+ const cellEditorContributions = EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1);
84
+ this.widget = this.instantiationService.invokeFunction(this.widgetService.retrieveWidget, groupId, input, {
85
+ contributions,
86
+ menuIds,
87
+ cellEditorContributions,
88
+ options: this.options
89
+ }, this.dimension, this.window);
90
+ if (this.rootElement && this.widget.value.getDomNode()) {
91
+ this.rootElement.setAttribute("aria-flowto", this.widget.value.getDomNode().id || "");
92
+ setParentFlowTo(this.widget.value.getDomNode(), this.rootElement);
93
+ }
94
+ }
95
+ dispose() {
96
+ super.dispose();
97
+ if (this.widget.value) {
98
+ this.widget.value.dispose();
99
+ }
100
+ }
101
+ };
102
+ NotebookInlineDiffWidget = ( __decorate([( __param(5, IInstantiationService)), ( __param(6, INotebookEditorService))], NotebookInlineDiffWidget));
103
+
104
+ export { NotebookInlineDiffWidget };