@codingame/monaco-vscode-katex-common 29.1.0 → 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,197 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { createElement, getWindow, addStandardDisposableListener, EventType, runAtThisOrScheduleAtNextAnimationFrame } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { createFastDomNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fastDomNode';
5
+ import { PixelRatio } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/pixelRatio';
6
+ import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
7
+ import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
8
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
9
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
10
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
11
+ import { diffOverviewRulerInserted, defaultInsertColor, diffInserted, diffOverviewRulerRemoved, defaultRemoveColor, diffRemoved } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
12
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
13
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
14
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
15
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
16
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
17
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
18
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
19
+ import { Themable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
20
+ import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
21
+
22
+ const MINIMUM_SLIDER_SIZE = 20;
23
+ let NotebookDiffOverviewRuler = class NotebookDiffOverviewRuler extends Themable {
24
+ constructor(notebookEditor, width, container, themeService) {
25
+ super(themeService);
26
+ this.notebookEditor = notebookEditor;
27
+ this.width = width;
28
+ this._diffElementViewModels = [];
29
+ this._lanes = 2;
30
+ this._insertColor = null;
31
+ this._removeColor = null;
32
+ this._insertColorHex = null;
33
+ this._removeColorHex = null;
34
+ this._disposables = this._register(( new DisposableStore()));
35
+ this._renderAnimationFrame = null;
36
+ this._domNode = createFastDomNode(createElement("canvas"));
37
+ this._domNode.setPosition("relative");
38
+ this._domNode.setLayerHinting(true);
39
+ this._domNode.setContain("strict");
40
+ container.appendChild(this._domNode.domNode);
41
+ this._overviewViewportDomElement = createFastDomNode(createElement("div"));
42
+ this._overviewViewportDomElement.setClassName("diffViewport");
43
+ this._overviewViewportDomElement.setPosition("absolute");
44
+ this._overviewViewportDomElement.setWidth(width);
45
+ container.appendChild(this._overviewViewportDomElement.domNode);
46
+ this._register(
47
+ PixelRatio.getInstance(getWindow(this._domNode.domNode)).onDidChange(() => {
48
+ this._scheduleRender();
49
+ })
50
+ );
51
+ this._register(this.themeService.onDidColorThemeChange(e => {
52
+ const colorChanged = this.applyColors(e);
53
+ if (colorChanged) {
54
+ this._scheduleRender();
55
+ }
56
+ }));
57
+ this.applyColors(this.themeService.getColorTheme());
58
+ this._register(this.notebookEditor.onDidScroll(() => {
59
+ this._renderOverviewViewport();
60
+ }));
61
+ this._register(
62
+ addStandardDisposableListener(container, EventType.POINTER_DOWN, e => {
63
+ this.notebookEditor.delegateVerticalScrollbarPointerDown(e);
64
+ })
65
+ );
66
+ }
67
+ applyColors(theme) {
68
+ const newInsertColor = theme.getColor(diffOverviewRulerInserted) || ( (theme.getColor(diffInserted) || defaultInsertColor).transparent(2));
69
+ const newRemoveColor = theme.getColor(diffOverviewRulerRemoved) || ( (theme.getColor(diffRemoved) || defaultRemoveColor).transparent(2));
70
+ const hasChanges = !newInsertColor.equals(this._insertColor) || !newRemoveColor.equals(this._removeColor);
71
+ this._insertColor = newInsertColor;
72
+ this._removeColor = newRemoveColor;
73
+ if (this._insertColor) {
74
+ this._insertColorHex = Color.Format.CSS.formatHexA(this._insertColor);
75
+ }
76
+ if (this._removeColor) {
77
+ this._removeColorHex = Color.Format.CSS.formatHexA(this._removeColor);
78
+ }
79
+ return hasChanges;
80
+ }
81
+ layout() {
82
+ this._layoutNow();
83
+ }
84
+ updateViewModels(elements, eventDispatcher) {
85
+ this._disposables.clear();
86
+ this._diffElementViewModels = elements;
87
+ if (eventDispatcher) {
88
+ this._disposables.add(eventDispatcher.onDidChangeLayout(() => {
89
+ this._scheduleRender();
90
+ }));
91
+ this._disposables.add(eventDispatcher.onDidChangeCellLayout(() => {
92
+ this._scheduleRender();
93
+ }));
94
+ }
95
+ this._scheduleRender();
96
+ }
97
+ _scheduleRender() {
98
+ if (this._renderAnimationFrame === null) {
99
+ this._renderAnimationFrame = runAtThisOrScheduleAtNextAnimationFrame(
100
+ getWindow(this._domNode.domNode),
101
+ this._onRenderScheduled.bind(this),
102
+ 16
103
+ );
104
+ }
105
+ }
106
+ _onRenderScheduled() {
107
+ this._renderAnimationFrame = null;
108
+ this._layoutNow();
109
+ }
110
+ _layoutNow() {
111
+ const layoutInfo = this.notebookEditor.getLayoutInfo();
112
+ const height = layoutInfo.height;
113
+ const contentHeight = ( this._diffElementViewModels.map(view => view.totalHeight)).reduce((a, b) => a + b, 0);
114
+ const ratio = PixelRatio.getInstance(getWindow(this._domNode.domNode)).value;
115
+ this._domNode.setWidth(this.width);
116
+ this._domNode.setHeight(height);
117
+ this._domNode.domNode.width = this.width * ratio;
118
+ this._domNode.domNode.height = height * ratio;
119
+ const ctx = this._domNode.domNode.getContext("2d");
120
+ ctx.clearRect(0, 0, this.width * ratio, height * ratio);
121
+ this._renderCanvas(ctx, this.width * ratio, height * ratio, contentHeight * ratio, ratio);
122
+ this._renderOverviewViewport();
123
+ }
124
+ _renderOverviewViewport() {
125
+ const layout = this._computeOverviewViewport();
126
+ if (!layout) {
127
+ this._overviewViewportDomElement.setTop(0);
128
+ this._overviewViewportDomElement.setHeight(0);
129
+ } else {
130
+ this._overviewViewportDomElement.setTop(layout.top);
131
+ this._overviewViewportDomElement.setHeight(layout.height);
132
+ }
133
+ }
134
+ _computeOverviewViewport() {
135
+ const layoutInfo = this.notebookEditor.getLayoutInfo();
136
+ if (!layoutInfo) {
137
+ return null;
138
+ }
139
+ const scrollTop = this.notebookEditor.getScrollTop();
140
+ const scrollHeight = this.notebookEditor.getScrollHeight();
141
+ const computedAvailableSize = Math.max(0, layoutInfo.height);
142
+ const computedRepresentableSize = Math.max(0, computedAvailableSize - 2 * 0);
143
+ const visibleSize = layoutInfo.height;
144
+ const computedSliderSize = Math.round(Math.max(
145
+ MINIMUM_SLIDER_SIZE,
146
+ Math.floor(visibleSize * computedRepresentableSize / scrollHeight)
147
+ ));
148
+ const computedSliderRatio = (computedRepresentableSize - computedSliderSize) / (scrollHeight - visibleSize);
149
+ const computedSliderPosition = Math.round(scrollTop * computedSliderRatio);
150
+ return {
151
+ height: computedSliderSize,
152
+ top: computedSliderPosition
153
+ };
154
+ }
155
+ _renderCanvas(ctx, width, height, scrollHeight, ratio) {
156
+ if (!this._insertColorHex || !this._removeColorHex) {
157
+ return;
158
+ }
159
+ const laneWidth = width / this._lanes;
160
+ let currentFrom = 0;
161
+ for (let i = 0; i < this._diffElementViewModels.length; i++) {
162
+ const element = this._diffElementViewModels[i];
163
+ const cellHeight = Math.round((element.totalHeight / scrollHeight) * ratio * height);
164
+ switch (element.type) {
165
+ case "insert":
166
+ ctx.fillStyle = this._insertColorHex;
167
+ ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
168
+ break;
169
+ case "delete":
170
+ ctx.fillStyle = this._removeColorHex;
171
+ ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
172
+ break;
173
+ case "unchanged":
174
+ case "unchangedMetadata":
175
+ break;
176
+ case "modified":
177
+ case "modifiedMetadata":
178
+ ctx.fillStyle = this._removeColorHex;
179
+ ctx.fillRect(0, currentFrom, laneWidth, cellHeight);
180
+ ctx.fillStyle = this._insertColorHex;
181
+ ctx.fillRect(laneWidth, currentFrom, laneWidth, cellHeight);
182
+ break;
183
+ }
184
+ currentFrom += cellHeight;
185
+ }
186
+ }
187
+ dispose() {
188
+ if (this._renderAnimationFrame !== null) {
189
+ this._renderAnimationFrame.dispose();
190
+ this._renderAnimationFrame = null;
191
+ }
192
+ super.dispose();
193
+ }
194
+ };
195
+ NotebookDiffOverviewRuler = ( __decorate([( __param(3, IThemeService))], NotebookDiffOverviewRuler));
196
+
197
+ export { NotebookDiffOverviewRuler };
@@ -0,0 +1,75 @@
1
+ import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
2
+ import { IDiffResult } from "@codingame/monaco-vscode-api/vscode/vs/base/common/diff/diff";
3
+ import { type IValueWithChangeEvent } 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 type { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
6
+ import { FontInfo } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/config/fontInfo";
7
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
8
+ import type { ContextKeyValue } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey";
9
+ import { MultiDiffEditorItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
10
+ import { IDiffElementViewModelBase } from "./diffElementViewModel.js";
11
+ import { NotebookDiffEditorEventDispatcher } from "./eventDispatcher.js";
12
+ import { INotebookDiffViewModel, INotebookDiffViewModelUpdateEvent } from "./notebookDiffEditorBrowser.js";
13
+ import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
14
+ import { INotebookDiffEditorModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
15
+ import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
16
+ import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
17
+ import { IDiffEditorHeightCalculatorService } from "./editorHeightCalculator.js";
18
+ export declare class NotebookDiffViewModel extends Disposable implements INotebookDiffViewModel, IValueWithChangeEvent<readonly MultiDiffEditorItem[]> {
19
+ private readonly model;
20
+ private readonly notebookEditorWorkerService;
21
+ private readonly configurationService;
22
+ private readonly eventDispatcher;
23
+ private readonly notebookService;
24
+ private readonly diffEditorHeightCalculator;
25
+ private readonly fontInfo?;
26
+ private readonly excludeUnchangedPlaceholder?;
27
+ private readonly placeholderAndRelatedCells;
28
+ private readonly _items;
29
+ get items(): readonly IDiffElementViewModelBase[];
30
+ private readonly _onDidChangeItems;
31
+ readonly onDidChangeItems: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<INotebookDiffViewModelUpdateEvent>;
32
+ private readonly disposables;
33
+ private _onDidChange;
34
+ private diffEditorItems;
35
+ onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
36
+ private notebookMetadataViewModel?;
37
+ get value(): readonly NotebookMultiDiffEditorItem[];
38
+ private _hasUnchangedCells?;
39
+ get hasUnchangedCells(): boolean;
40
+ private _includeUnchanged?;
41
+ get includeUnchanged(): boolean;
42
+ set includeUnchanged(value: boolean);
43
+ private hideOutput?;
44
+ private ignoreMetadata?;
45
+ private originalCellViewModels;
46
+ constructor(model: INotebookDiffEditorModel, notebookEditorWorkerService: INotebookEditorWorkerService, configurationService: IConfigurationService, eventDispatcher: NotebookDiffEditorEventDispatcher, notebookService: INotebookService, diffEditorHeightCalculator: IDiffEditorHeightCalculatorService, fontInfo?: FontInfo | undefined, excludeUnchangedPlaceholder?: boolean | undefined);
47
+ dispose(): void;
48
+ private clear;
49
+ computeDiff(token: CancellationToken): Promise<void>;
50
+ private toggleNotebookMetadata;
51
+ private updateDiffEditorItems;
52
+ private updateViewModels;
53
+ private createDiffViewModels;
54
+ }
55
+ /**
56
+ * making sure that swapping cells are always translated to `insert+delete`.
57
+ */
58
+ export declare function prettyChanges(original: NotebookTextModel, modified: NotebookTextModel, diffResult: IDiffResult): void;
59
+ export type CellDiffInfo = {
60
+ originalCellIndex: number;
61
+ modifiedCellIndex: number;
62
+ type: "unchanged" | "modified";
63
+ } | {
64
+ originalCellIndex: number;
65
+ type: "delete";
66
+ } | {
67
+ modifiedCellIndex: number;
68
+ type: "insert";
69
+ };
70
+ export declare abstract class NotebookMultiDiffEditorItem extends MultiDiffEditorItem {
71
+ readonly type: IDiffElementViewModelBase["type"];
72
+ readonly containerType: IDiffElementViewModelBase["type"];
73
+ kind: "Cell" | "Metadata" | "Output";
74
+ constructor(originalUri: URI | undefined, modifiedUri: URI | undefined, goToFileUri: URI | undefined, type: IDiffElementViewModelBase["type"], containerType: IDiffElementViewModelBase["type"], kind: "Cell" | "Metadata" | "Output", contextKeys?: Record<string, ContextKeyValue>);
75
+ }