@codingame/monaco-vscode-katex-common 24.1.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 (262) hide show
  1. package/empty.js +1 -0
  2. package/package.json +45 -0
  3. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +37 -0
  4. package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +127 -0
  5. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +27 -0
  6. package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +81 -0
  7. package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +44 -0
  8. package/vscode/src/vs/platform/actions/browser/buttonbar.js +172 -0
  9. package/vscode/src/vs/platform/editor/browser/editor.d.ts +12 -0
  10. package/vscode/src/vs/platform/editor/browser/editor.js +51 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +41 -0
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +295 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.d.ts +2 -0
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +60 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +65 -0
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +650 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +2 -0
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +364 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +38 -0
  20. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +207 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.d.ts +17 -0
  22. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +216 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.d.ts +24 -0
  24. package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +114 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.d.ts +34 -0
  26. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.js +141 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.d.ts +169 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.js +951 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.d.ts +19 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.js +109 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.d.ts +12 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.js +47 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.d.ts +13 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.js +49 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.d.ts +27 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +160 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.d.ts +40 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.js +286 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.d.ts +13 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +49 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.d.ts +34 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.js +101 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.d.ts +14 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +30 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.d.ts +11 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +37 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.d.ts +17 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +69 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.d.ts +116 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +417 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.d.ts +20 -0
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.js +66 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.d.ts +25 -0
  54. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.js +123 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.d.ts +18 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.js +60 -0
  57. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.d.ts +16 -0
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.js +46 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.d.ts +19 -0
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.js +57 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.d.ts +94 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +567 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.d.ts +34 -0
  64. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.js +224 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.d.ts +34 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.js +259 -0
  67. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.d.ts +38 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +160 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.d.ts +16 -0
  70. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.js +55 -0
  71. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.d.ts +17 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.js +117 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.d.ts +66 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +528 -0
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.d.ts +31 -0
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.js +160 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.d.ts +17 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +49 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.d.ts +18 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +91 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.d.ts +13 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.js +6 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.d.ts +54 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.js +429 -0
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.d.ts +40 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.js +347 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.d.ts +56 -0
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.js +164 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.d.ts +32 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.js +224 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.d.ts +35 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +173 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css +341 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatExtensionsContent.css +27 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMarkdownPart.css +23 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMcpServersInteractionContent.css +14 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatPullRequestContent.css +75 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css +221 -0
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatThinkingContent.css +162 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +41 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +94 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +15 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +96 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +18 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +147 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +14 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.js +23 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +68 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +353 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +100 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +1085 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +39 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +275 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +32 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +119 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +19 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +36 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +21 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.js +130 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +25 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +225 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +24 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.js +101 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.d.ts +42 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.js +127 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.d.ts +43 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +388 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +49 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +721 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.d.ts +13 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +52 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.d.ts +39 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +409 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.d.ts +334 -0
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +2008 -0
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.d.ts +52 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.js +93 -0
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.d.ts +217 -0
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1573 -0
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.d.ts +43 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +249 -0
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.d.ts +50 -0
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +84 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.d.ts +32 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.js +174 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +31 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +101 -0
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +19 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +76 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionAction.css +39 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.d.ts +292 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +2014 -0
  153. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css +171 -0
  154. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.d.ts +173 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +797 -0
  156. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.d.ts +54 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.js +345 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.d.ts +10 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1069 -0
  160. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +34 -0
  161. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +139 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css +2880 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +87 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatCodeBlockPill.css +139 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css +61 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css +209 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.d.ts +28 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.js +135 -0
  169. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.d.ts +28 -0
  170. package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.js +147 -0
  171. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +71 -0
  172. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +279 -0
  173. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.d.ts +28 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +28 -0
  175. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.d.ts +13 -0
  176. package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +38 -0
  177. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +55 -0
  178. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +176 -0
  179. package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.d.ts +45 -0
  180. package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +207 -0
  181. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +48 -0
  182. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +373 -0
  183. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +171 -0
  184. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +1442 -0
  185. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +199 -0
  186. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +482 -0
  187. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +28 -0
  188. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +37 -0
  189. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +95 -0
  190. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +497 -0
  191. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +76 -0
  192. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +464 -0
  193. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +124 -0
  194. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +562 -0
  195. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +42 -0
  196. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +279 -0
  197. package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +411 -0
  198. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +13 -0
  199. package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +66 -0
  200. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +61 -0
  201. package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +154 -0
  202. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.d.ts +19 -0
  203. package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +201 -0
  204. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
  205. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +372 -0
  206. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
  207. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +594 -0
  210. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1746 -0
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +269 -0
  216. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
  217. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +806 -0
  218. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
  219. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +116 -0
  220. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
  221. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +62 -0
  222. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
  223. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
  224. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
  225. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +295 -0
  226. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
  227. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +241 -0
  228. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
  229. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +146 -0
  230. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
  231. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +90 -0
  232. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
  233. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +41 -0
  234. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
  235. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +42 -0
  236. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
  237. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +77 -0
  238. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
  239. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
  240. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +823 -0
  241. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
  242. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +29 -0
  243. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
  244. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +567 -0
  245. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
  246. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +189 -0
  247. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
  248. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +439 -0
  249. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
  250. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +263 -0
  251. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
  252. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +48 -0
  253. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
  255. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
  256. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +89 -0
  257. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
  258. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
  259. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
  260. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +108 -0
  261. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +34 -0
  262. package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +145 -0
@@ -0,0 +1,806 @@
1
+
2
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
3
+ import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
4
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { DiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
6
+ import { getEditorPadding } from './diffCellEditorOptions.js';
7
+ import { DiffNestedCellViewModel } from './diffNestedCellViewModel.js';
8
+ import { NotebookDiffViewEventType } from './eventDispatcher.js';
9
+ import { DIFF_CELL_MARGIN, DiffSide } from './notebookDiffEditorBrowser.js';
10
+ import { CellLayoutState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
11
+ import { getFormattedMetadataJSON } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
12
+ import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
13
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
14
+ import { NotebookDocumentMetadataTextModel } from '../../common/model/notebookMetadataTextModel.js';
15
+
16
+ const PropertyHeaderHeight = 25;
17
+ const HeightOfHiddenLinesRegionInDiffEditor = 24;
18
+ const DefaultLineHeight = 17;
19
+ var PropertyFoldingState;
20
+ (function (PropertyFoldingState) {
21
+ PropertyFoldingState[PropertyFoldingState["Expanded"] = 0] = "Expanded";
22
+ PropertyFoldingState[PropertyFoldingState["Collapsed"] = 1] = "Collapsed";
23
+ })(PropertyFoldingState || (PropertyFoldingState = {}));
24
+ const OUTPUT_EDITOR_HEIGHT_MAGIC = 1440;
25
+ class DiffElementViewModelBase extends Disposable {
26
+ constructor(mainDocumentTextModel, editorEventDispatcher, initData) {
27
+ super();
28
+ this.mainDocumentTextModel = mainDocumentTextModel;
29
+ this.editorEventDispatcher = editorEventDispatcher;
30
+ this.initData = initData;
31
+ this._layoutInfoEmitter = this._register(( new Emitter()));
32
+ this.onDidLayoutChange = this._layoutInfoEmitter.event;
33
+ this._register(this.editorEventDispatcher.onDidChangeLayout(e => this._layoutInfoEmitter.fire({ outerWidth: true })));
34
+ }
35
+ }
36
+ class DiffElementPlaceholderViewModel extends DiffElementViewModelBase {
37
+ constructor(mainDocumentTextModel, editorEventDispatcher, initData) {
38
+ super(mainDocumentTextModel, editorEventDispatcher, initData);
39
+ this.type = 'placeholder';
40
+ this.hiddenCells = [];
41
+ this._unfoldHiddenCells = this._register(( new Emitter()));
42
+ this.onUnfoldHiddenCells = this._unfoldHiddenCells.event;
43
+ this.renderOutput = false;
44
+ }
45
+ get totalHeight() {
46
+ return 24 + (2 * DIFF_CELL_MARGIN);
47
+ }
48
+ getHeight(_) {
49
+ return this.totalHeight;
50
+ }
51
+ layoutChange() {
52
+ }
53
+ showHiddenCells() {
54
+ this._unfoldHiddenCells.fire();
55
+ }
56
+ }
57
+ class NotebookDocumentMetadataViewModel extends DiffElementViewModelBase {
58
+ set editorHeight(height) {
59
+ this._layout({ editorHeight: height });
60
+ }
61
+ get editorHeight() {
62
+ throw ( new Error('Use Cell.layoutInfo.editorHeight'));
63
+ }
64
+ set editorMargin(margin) {
65
+ this._layout({ editorMargin: margin });
66
+ }
67
+ get editorMargin() {
68
+ throw ( new Error('Use Cell.layoutInfo.editorMargin'));
69
+ }
70
+ get layoutInfo() {
71
+ return this._layoutInfo;
72
+ }
73
+ get totalHeight() {
74
+ return this.layoutInfo.totalHeight;
75
+ }
76
+ constructor(originalDocumentTextModel, modifiedDocumentTextModel, type, editorEventDispatcher, initData, notebookService, editorHeightCalculator) {
77
+ super(originalDocumentTextModel, editorEventDispatcher, initData);
78
+ this.originalDocumentTextModel = originalDocumentTextModel;
79
+ this.modifiedDocumentTextModel = modifiedDocumentTextModel;
80
+ this.type = type;
81
+ this.editorHeightCalculator = editorHeightCalculator;
82
+ this.renderOutput = false;
83
+ this._sourceEditorViewState = null;
84
+ const cellStatusHeight = PropertyHeaderHeight;
85
+ this._layoutInfo = {
86
+ width: 0,
87
+ editorHeight: 0,
88
+ editorMargin: 0,
89
+ metadataHeight: 0,
90
+ cellStatusHeight,
91
+ metadataStatusHeight: 0,
92
+ rawOutputHeight: 0,
93
+ outputTotalHeight: 0,
94
+ outputStatusHeight: 0,
95
+ outputMetadataHeight: 0,
96
+ bodyMargin: 32,
97
+ totalHeight: 82 + cellStatusHeight + 0,
98
+ layoutState: CellLayoutState.Uninitialized
99
+ };
100
+ this.cellFoldingState = type === 'modifiedMetadata' ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
101
+ this.originalMetadata = this._register(( new NotebookDocumentMetadataTextModel(originalDocumentTextModel)));
102
+ this.modifiedMetadata = this._register(( new NotebookDocumentMetadataTextModel(modifiedDocumentTextModel)));
103
+ }
104
+ async computeHeights() {
105
+ if (this.type === 'unchangedMetadata') {
106
+ this.editorHeight = this.editorHeightCalculator.computeHeightFromLines(this.originalMetadata.textBuffer.getLineCount());
107
+ }
108
+ else {
109
+ const original = this.originalMetadata.uri;
110
+ const modified = this.modifiedMetadata.uri;
111
+ this.editorHeight = await this.editorHeightCalculator.diffAndComputeHeight(original, modified);
112
+ }
113
+ }
114
+ layoutChange() {
115
+ this._layout({ recomputeOutput: true });
116
+ }
117
+ _layout(delta) {
118
+ const width = delta.width !== undefined ? delta.width : this._layoutInfo.width;
119
+ const editorHeight = delta.editorHeight !== undefined ? delta.editorHeight : this._layoutInfo.editorHeight;
120
+ const editorMargin = delta.editorMargin !== undefined ? delta.editorMargin : this._layoutInfo.editorMargin;
121
+ const cellStatusHeight = delta.cellStatusHeight !== undefined ? delta.cellStatusHeight : this._layoutInfo.cellStatusHeight;
122
+ const bodyMargin = delta.bodyMargin !== undefined ? delta.bodyMargin : this._layoutInfo.bodyMargin;
123
+ const totalHeight = editorHeight
124
+ + editorMargin
125
+ + cellStatusHeight
126
+ + bodyMargin;
127
+ const newLayout = {
128
+ width: width,
129
+ editorHeight: editorHeight,
130
+ editorMargin: editorMargin,
131
+ metadataHeight: 0,
132
+ cellStatusHeight,
133
+ metadataStatusHeight: 0,
134
+ outputTotalHeight: 0,
135
+ outputStatusHeight: 0,
136
+ bodyMargin: bodyMargin,
137
+ rawOutputHeight: 0,
138
+ outputMetadataHeight: 0,
139
+ totalHeight: totalHeight,
140
+ layoutState: CellLayoutState.Measured
141
+ };
142
+ let somethingChanged = false;
143
+ const changeEvent = {};
144
+ if (newLayout.width !== this._layoutInfo.width) {
145
+ changeEvent.width = true;
146
+ somethingChanged = true;
147
+ }
148
+ if (newLayout.editorHeight !== this._layoutInfo.editorHeight) {
149
+ changeEvent.editorHeight = true;
150
+ somethingChanged = true;
151
+ }
152
+ if (newLayout.editorMargin !== this._layoutInfo.editorMargin) {
153
+ changeEvent.editorMargin = true;
154
+ somethingChanged = true;
155
+ }
156
+ if (newLayout.cellStatusHeight !== this._layoutInfo.cellStatusHeight) {
157
+ changeEvent.cellStatusHeight = true;
158
+ somethingChanged = true;
159
+ }
160
+ if (newLayout.bodyMargin !== this._layoutInfo.bodyMargin) {
161
+ changeEvent.bodyMargin = true;
162
+ somethingChanged = true;
163
+ }
164
+ if (newLayout.totalHeight !== this._layoutInfo.totalHeight) {
165
+ changeEvent.totalHeight = true;
166
+ somethingChanged = true;
167
+ }
168
+ if (somethingChanged) {
169
+ this._layoutInfo = newLayout;
170
+ this._fireLayoutChangeEvent(changeEvent);
171
+ }
172
+ }
173
+ getHeight(lineHeight) {
174
+ if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
175
+ const editorHeight = this.cellFoldingState === PropertyFoldingState.Collapsed ? 0 : this.computeInputEditorHeight(lineHeight);
176
+ return this._computeTotalHeight(editorHeight);
177
+ }
178
+ else {
179
+ return this._layoutInfo.totalHeight;
180
+ }
181
+ }
182
+ _computeTotalHeight(editorHeight) {
183
+ const totalHeight = editorHeight
184
+ + this._layoutInfo.editorMargin
185
+ + this._layoutInfo.metadataHeight
186
+ + this._layoutInfo.cellStatusHeight
187
+ + this._layoutInfo.metadataStatusHeight
188
+ + this._layoutInfo.outputTotalHeight
189
+ + this._layoutInfo.outputStatusHeight
190
+ + this._layoutInfo.outputMetadataHeight
191
+ + this._layoutInfo.bodyMargin;
192
+ return totalHeight;
193
+ }
194
+ computeInputEditorHeight(_lineHeight) {
195
+ return this.editorHeightCalculator.computeHeightFromLines(Math.max(this.originalMetadata.textBuffer.getLineCount(), this.modifiedMetadata.textBuffer.getLineCount()));
196
+ }
197
+ _fireLayoutChangeEvent(state) {
198
+ this._layoutInfoEmitter.fire(state);
199
+ this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
200
+ }
201
+ getComputedCellContainerWidth(layoutInfo, diffEditor, fullWidth) {
202
+ if (fullWidth) {
203
+ return layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0) - 2;
204
+ }
205
+ return (layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0)) / 2 - 18 - 2;
206
+ }
207
+ getSourceEditorViewState() {
208
+ return this._sourceEditorViewState;
209
+ }
210
+ saveSpirceEditorViewState(viewState) {
211
+ this._sourceEditorViewState = viewState;
212
+ }
213
+ }
214
+ class DiffElementCellViewModelBase extends DiffElementViewModelBase {
215
+ hideUnchangedCells() {
216
+ this._hideUnchangedCells.fire();
217
+ }
218
+ set rawOutputHeight(height) {
219
+ this._layout({ rawOutputHeight: Math.min(OUTPUT_EDITOR_HEIGHT_MAGIC, height) });
220
+ }
221
+ get rawOutputHeight() {
222
+ throw ( new Error('Use Cell.layoutInfo.rawOutputHeight'));
223
+ }
224
+ set outputStatusHeight(height) {
225
+ this._layout({ outputStatusHeight: height });
226
+ }
227
+ get outputStatusHeight() {
228
+ throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
229
+ }
230
+ set outputMetadataHeight(height) {
231
+ this._layout({ outputMetadataHeight: height });
232
+ }
233
+ get outputMetadataHeight() {
234
+ throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
235
+ }
236
+ set editorHeight(height) {
237
+ this._layout({ editorHeight: height });
238
+ }
239
+ get editorHeight() {
240
+ throw ( new Error('Use Cell.layoutInfo.editorHeight'));
241
+ }
242
+ set editorMargin(margin) {
243
+ this._layout({ editorMargin: margin });
244
+ }
245
+ get editorMargin() {
246
+ throw ( new Error('Use Cell.layoutInfo.editorMargin'));
247
+ }
248
+ set metadataStatusHeight(height) {
249
+ this._layout({ metadataStatusHeight: height });
250
+ }
251
+ get metadataStatusHeight() {
252
+ throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
253
+ }
254
+ set metadataHeight(height) {
255
+ this._layout({ metadataHeight: height });
256
+ }
257
+ get metadataHeight() {
258
+ throw ( new Error('Use Cell.layoutInfo.metadataHeight'));
259
+ }
260
+ set renderOutput(value) {
261
+ this._renderOutput = value;
262
+ this._layout({ recomputeOutput: true });
263
+ this._stateChangeEmitter.fire({ renderOutput: this._renderOutput });
264
+ }
265
+ get renderOutput() {
266
+ return this._renderOutput;
267
+ }
268
+ get layoutInfo() {
269
+ return this._layoutInfo;
270
+ }
271
+ get totalHeight() {
272
+ return this.layoutInfo.totalHeight;
273
+ }
274
+ get ignoreOutputs() {
275
+ return this.configurationService.getValue('notebook.diff.ignoreOutputs') || !!(this.mainDocumentTextModel?.transientOptions.transientOutputs);
276
+ }
277
+ get ignoreMetadata() {
278
+ return this.configurationService.getValue('notebook.diff.ignoreMetadata');
279
+ }
280
+ constructor(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator) {
281
+ super(mainDocumentTextModel, editorEventDispatcher, initData);
282
+ this.type = type;
283
+ this.index = index;
284
+ this.configurationService = configurationService;
285
+ this.diffEditorHeightCalculator = diffEditorHeightCalculator;
286
+ this._stateChangeEmitter = this._register(( new Emitter()));
287
+ this.onDidStateChange = this._stateChangeEmitter.event;
288
+ this._hideUnchangedCells = this._register(( new Emitter()));
289
+ this.onHideUnchangedCells = this._hideUnchangedCells.event;
290
+ this._renderOutput = true;
291
+ this._sourceEditorViewState = null;
292
+ this._outputEditorViewState = null;
293
+ this._metadataEditorViewState = null;
294
+ this.original = original ? this._register(( new DiffNestedCellViewModel(original, notebookService))) : undefined;
295
+ this.modified = modified ? this._register(( new DiffNestedCellViewModel(modified, notebookService))) : undefined;
296
+ const editorHeight = this._estimateEditorHeight(initData.fontInfo);
297
+ const cellStatusHeight = PropertyHeaderHeight;
298
+ this._layoutInfo = {
299
+ width: 0,
300
+ editorHeight: editorHeight,
301
+ editorMargin: 0,
302
+ metadataHeight: 0,
303
+ cellStatusHeight,
304
+ metadataStatusHeight: this.ignoreMetadata ? 0 : PropertyHeaderHeight,
305
+ rawOutputHeight: 0,
306
+ outputTotalHeight: 0,
307
+ outputStatusHeight: this.ignoreOutputs ? 0 : PropertyHeaderHeight,
308
+ outputMetadataHeight: 0,
309
+ bodyMargin: 32,
310
+ totalHeight: 82 + cellStatusHeight + editorHeight,
311
+ layoutState: CellLayoutState.Uninitialized
312
+ };
313
+ this.cellFoldingState = modified?.getTextBufferHash() !== original?.getTextBufferHash() ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
314
+ this.metadataFoldingState = PropertyFoldingState.Collapsed;
315
+ this.outputFoldingState = PropertyFoldingState.Collapsed;
316
+ }
317
+ layoutChange() {
318
+ this._layout({ recomputeOutput: true });
319
+ }
320
+ _estimateEditorHeight(fontInfo) {
321
+ const lineHeight = fontInfo?.lineHeight ?? 17;
322
+ switch (this.type) {
323
+ case 'unchanged':
324
+ case 'insert':
325
+ {
326
+ const lineCount = this.modified.textModel.textBuffer.getLineCount();
327
+ const editorHeight = lineCount * lineHeight + getEditorPadding(lineCount).top + getEditorPadding(lineCount).bottom;
328
+ return editorHeight;
329
+ }
330
+ case 'delete':
331
+ case 'modified':
332
+ {
333
+ const lineCount = this.original.textModel.textBuffer.getLineCount();
334
+ const editorHeight = lineCount * lineHeight + getEditorPadding(lineCount).top + getEditorPadding(lineCount).bottom;
335
+ return editorHeight;
336
+ }
337
+ }
338
+ }
339
+ _layout(delta) {
340
+ const width = delta.width !== undefined ? delta.width : this._layoutInfo.width;
341
+ const editorHeight = delta.editorHeight !== undefined ? delta.editorHeight : this._layoutInfo.editorHeight;
342
+ const editorMargin = delta.editorMargin !== undefined ? delta.editorMargin : this._layoutInfo.editorMargin;
343
+ const metadataHeight = delta.metadataHeight !== undefined ? delta.metadataHeight : this._layoutInfo.metadataHeight;
344
+ const cellStatusHeight = delta.cellStatusHeight !== undefined ? delta.cellStatusHeight : this._layoutInfo.cellStatusHeight;
345
+ const metadataStatusHeight = delta.metadataStatusHeight !== undefined ? delta.metadataStatusHeight : this._layoutInfo.metadataStatusHeight;
346
+ const rawOutputHeight = delta.rawOutputHeight !== undefined ? delta.rawOutputHeight : this._layoutInfo.rawOutputHeight;
347
+ const outputStatusHeight = delta.outputStatusHeight !== undefined ? delta.outputStatusHeight : this._layoutInfo.outputStatusHeight;
348
+ const bodyMargin = delta.bodyMargin !== undefined ? delta.bodyMargin : this._layoutInfo.bodyMargin;
349
+ const outputMetadataHeight = delta.outputMetadataHeight !== undefined ? delta.outputMetadataHeight : this._layoutInfo.outputMetadataHeight;
350
+ const outputHeight = this.ignoreOutputs ? 0 : (delta.recomputeOutput || delta.rawOutputHeight !== undefined || delta.outputMetadataHeight !== undefined) ? this._getOutputTotalHeight(rawOutputHeight, outputMetadataHeight) : this._layoutInfo.outputTotalHeight;
351
+ const totalHeight = editorHeight
352
+ + editorMargin
353
+ + cellStatusHeight
354
+ + metadataHeight
355
+ + metadataStatusHeight
356
+ + outputHeight
357
+ + outputStatusHeight
358
+ + bodyMargin;
359
+ const newLayout = {
360
+ width: width,
361
+ editorHeight: editorHeight,
362
+ editorMargin: editorMargin,
363
+ metadataHeight: metadataHeight,
364
+ cellStatusHeight,
365
+ metadataStatusHeight: metadataStatusHeight,
366
+ outputTotalHeight: outputHeight,
367
+ outputStatusHeight: outputStatusHeight,
368
+ bodyMargin: bodyMargin,
369
+ rawOutputHeight: rawOutputHeight,
370
+ outputMetadataHeight: outputMetadataHeight,
371
+ totalHeight: totalHeight,
372
+ layoutState: CellLayoutState.Measured
373
+ };
374
+ let somethingChanged = false;
375
+ const changeEvent = {};
376
+ if (newLayout.width !== this._layoutInfo.width) {
377
+ changeEvent.width = true;
378
+ somethingChanged = true;
379
+ }
380
+ if (newLayout.editorHeight !== this._layoutInfo.editorHeight) {
381
+ changeEvent.editorHeight = true;
382
+ somethingChanged = true;
383
+ }
384
+ if (newLayout.editorMargin !== this._layoutInfo.editorMargin) {
385
+ changeEvent.editorMargin = true;
386
+ somethingChanged = true;
387
+ }
388
+ if (newLayout.metadataHeight !== this._layoutInfo.metadataHeight) {
389
+ changeEvent.metadataHeight = true;
390
+ somethingChanged = true;
391
+ }
392
+ if (newLayout.cellStatusHeight !== this._layoutInfo.cellStatusHeight) {
393
+ changeEvent.cellStatusHeight = true;
394
+ somethingChanged = true;
395
+ }
396
+ if (newLayout.metadataStatusHeight !== this._layoutInfo.metadataStatusHeight) {
397
+ changeEvent.metadataStatusHeight = true;
398
+ somethingChanged = true;
399
+ }
400
+ if (newLayout.outputTotalHeight !== this._layoutInfo.outputTotalHeight) {
401
+ changeEvent.outputTotalHeight = true;
402
+ somethingChanged = true;
403
+ }
404
+ if (newLayout.outputStatusHeight !== this._layoutInfo.outputStatusHeight) {
405
+ changeEvent.outputStatusHeight = true;
406
+ somethingChanged = true;
407
+ }
408
+ if (newLayout.bodyMargin !== this._layoutInfo.bodyMargin) {
409
+ changeEvent.bodyMargin = true;
410
+ somethingChanged = true;
411
+ }
412
+ if (newLayout.outputMetadataHeight !== this._layoutInfo.outputMetadataHeight) {
413
+ changeEvent.outputMetadataHeight = true;
414
+ somethingChanged = true;
415
+ }
416
+ if (newLayout.totalHeight !== this._layoutInfo.totalHeight) {
417
+ changeEvent.totalHeight = true;
418
+ somethingChanged = true;
419
+ }
420
+ if (somethingChanged) {
421
+ this._layoutInfo = newLayout;
422
+ this._fireLayoutChangeEvent(changeEvent);
423
+ }
424
+ }
425
+ getHeight(lineHeight) {
426
+ if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
427
+ const editorHeight = this.cellFoldingState === PropertyFoldingState.Collapsed ? 0 : this.computeInputEditorHeight(lineHeight);
428
+ return this._computeTotalHeight(editorHeight);
429
+ }
430
+ else {
431
+ return this._layoutInfo.totalHeight;
432
+ }
433
+ }
434
+ _computeTotalHeight(editorHeight) {
435
+ const totalHeight = editorHeight
436
+ + this._layoutInfo.editorMargin
437
+ + this._layoutInfo.metadataHeight
438
+ + this._layoutInfo.cellStatusHeight
439
+ + this._layoutInfo.metadataStatusHeight
440
+ + this._layoutInfo.outputTotalHeight
441
+ + this._layoutInfo.outputStatusHeight
442
+ + this._layoutInfo.outputMetadataHeight
443
+ + this._layoutInfo.bodyMargin;
444
+ return totalHeight;
445
+ }
446
+ computeInputEditorHeight(lineHeight) {
447
+ const lineCount = Math.max(this.original?.textModel.textBuffer.getLineCount() ?? 1, this.modified?.textModel.textBuffer.getLineCount() ?? 1);
448
+ return this.diffEditorHeightCalculator.computeHeightFromLines(lineCount);
449
+ }
450
+ _getOutputTotalHeight(rawOutputHeight, metadataHeight) {
451
+ if (this.outputFoldingState === PropertyFoldingState.Collapsed) {
452
+ return 0;
453
+ }
454
+ if (this.renderOutput) {
455
+ if (this.isOutputEmpty()) {
456
+ return 24;
457
+ }
458
+ return this.getRichOutputTotalHeight() + metadataHeight;
459
+ }
460
+ else {
461
+ return rawOutputHeight;
462
+ }
463
+ }
464
+ _fireLayoutChangeEvent(state) {
465
+ this._layoutInfoEmitter.fire(state);
466
+ this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
467
+ }
468
+ getComputedCellContainerWidth(layoutInfo, diffEditor, fullWidth) {
469
+ if (fullWidth) {
470
+ return layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0) - 2;
471
+ }
472
+ return (layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0)) / 2 - 18 - 2;
473
+ }
474
+ getOutputEditorViewState() {
475
+ return this._outputEditorViewState;
476
+ }
477
+ saveOutputEditorViewState(viewState) {
478
+ this._outputEditorViewState = viewState;
479
+ }
480
+ getMetadataEditorViewState() {
481
+ return this._metadataEditorViewState;
482
+ }
483
+ saveMetadataEditorViewState(viewState) {
484
+ this._metadataEditorViewState = viewState;
485
+ }
486
+ getSourceEditorViewState() {
487
+ return this._sourceEditorViewState;
488
+ }
489
+ saveSpirceEditorViewState(viewState) {
490
+ this._sourceEditorViewState = viewState;
491
+ }
492
+ }
493
+ class SideBySideDiffElementViewModel extends DiffElementCellViewModelBase {
494
+ get originalDocument() {
495
+ return this.otherDocumentTextModel;
496
+ }
497
+ get modifiedDocument() {
498
+ return this.mainDocumentTextModel;
499
+ }
500
+ constructor(mainDocumentTextModel, otherDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, configurationService, index, diffEditorHeightCalculator) {
501
+ super(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator);
502
+ this.otherDocumentTextModel = otherDocumentTextModel;
503
+ this.type = type;
504
+ this.cellFoldingState = this.modified.textModel.getValue() !== this.original.textModel.getValue() ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
505
+ this.metadataFoldingState = PropertyFoldingState.Collapsed;
506
+ this.outputFoldingState = PropertyFoldingState.Collapsed;
507
+ if (this.checkMetadataIfModified()) {
508
+ this.metadataFoldingState = PropertyFoldingState.Expanded;
509
+ }
510
+ if (this.checkIfOutputsModified()) {
511
+ this.outputFoldingState = PropertyFoldingState.Expanded;
512
+ }
513
+ this._register(this.original.onDidChangeOutputLayout(() => {
514
+ this._layout({ recomputeOutput: true });
515
+ }));
516
+ this._register(this.modified.onDidChangeOutputLayout(() => {
517
+ this._layout({ recomputeOutput: true });
518
+ }));
519
+ this._register(this.modified.textModel.onDidChangeContent(() => {
520
+ if (mainDocumentTextModel.transientOptions.cellContentMetadata) {
521
+ const cellMetadataKeys = [...( Object.keys(mainDocumentTextModel.transientOptions.cellContentMetadata))];
522
+ const modifiedMedataRaw = Object.assign({}, this.modified.metadata);
523
+ const originalCellMetadata = this.original.metadata;
524
+ for (const key of cellMetadataKeys) {
525
+ if (Object.hasOwn(originalCellMetadata, key)) {
526
+ modifiedMedataRaw[key] = originalCellMetadata[key];
527
+ }
528
+ }
529
+ this.modified.textModel.metadata = modifiedMedataRaw;
530
+ }
531
+ }));
532
+ }
533
+ checkIfInputModified() {
534
+ if (this.original.textModel.getTextBufferHash() === this.modified.textModel.getTextBufferHash()) {
535
+ return false;
536
+ }
537
+ return {
538
+ reason: 'Cell content has changed',
539
+ };
540
+ }
541
+ checkIfOutputsModified() {
542
+ if (this.mainDocumentTextModel.transientOptions.transientOutputs || this.ignoreOutputs) {
543
+ return false;
544
+ }
545
+ const ret = outputsEqual(this.original?.outputs ?? [], this.modified?.outputs ?? []);
546
+ if (ret === OutputComparison.Unchanged) {
547
+ return false;
548
+ }
549
+ return {
550
+ reason: ret === OutputComparison.Metadata ? 'Output metadata has changed' : undefined,
551
+ kind: ret
552
+ };
553
+ }
554
+ checkMetadataIfModified() {
555
+ if (this.ignoreMetadata) {
556
+ return false;
557
+ }
558
+ const modified = hash(getFormattedMetadataJSON(this.mainDocumentTextModel.transientOptions.transientCellMetadata, this.original?.metadata || {}, this.original?.language)) !== hash(getFormattedMetadataJSON(this.mainDocumentTextModel.transientOptions.transientCellMetadata, this.modified?.metadata ?? {}, this.modified?.language));
559
+ if (modified) {
560
+ return { reason: undefined };
561
+ }
562
+ else {
563
+ return false;
564
+ }
565
+ }
566
+ updateOutputHeight(diffSide, index, height) {
567
+ if (diffSide === DiffSide.Original) {
568
+ this.original.updateOutputHeight(index, height);
569
+ }
570
+ else {
571
+ this.modified.updateOutputHeight(index, height);
572
+ }
573
+ }
574
+ getOutputOffsetInContainer(diffSide, index) {
575
+ if (diffSide === DiffSide.Original) {
576
+ return this.original.getOutputOffset(index);
577
+ }
578
+ else {
579
+ return this.modified.getOutputOffset(index);
580
+ }
581
+ }
582
+ getOutputOffsetInCell(diffSide, index) {
583
+ const offsetInOutputsContainer = this.getOutputOffsetInContainer(diffSide, index);
584
+ return this._layoutInfo.editorHeight
585
+ + this._layoutInfo.editorMargin
586
+ + this._layoutInfo.metadataHeight
587
+ + this._layoutInfo.cellStatusHeight
588
+ + this._layoutInfo.metadataStatusHeight
589
+ + this._layoutInfo.outputStatusHeight
590
+ + this._layoutInfo.bodyMargin / 2
591
+ + offsetInOutputsContainer;
592
+ }
593
+ isOutputEmpty() {
594
+ if (this.mainDocumentTextModel.transientOptions.transientOutputs) {
595
+ return true;
596
+ }
597
+ if (this.checkIfOutputsModified()) {
598
+ return false;
599
+ }
600
+ return (this.original?.outputs || []).length === 0;
601
+ }
602
+ getRichOutputTotalHeight() {
603
+ return Math.max(this.original.getOutputTotalHeight(), this.modified.getOutputTotalHeight());
604
+ }
605
+ getNestedCellViewModel(diffSide) {
606
+ return diffSide === DiffSide.Original ? this.original : this.modified;
607
+ }
608
+ getCellByUri(cellUri) {
609
+ if (( cellUri.toString()) === ( this.original.uri.toString())) {
610
+ return this.original;
611
+ }
612
+ else {
613
+ return this.modified;
614
+ }
615
+ }
616
+ computeInputEditorHeight(lineHeight) {
617
+ if (this.type === 'modified' &&
618
+ typeof this.editorHeightWithUnchangedLinesCollapsed === 'number' &&
619
+ this.checkIfInputModified()) {
620
+ return this.editorHeightWithUnchangedLinesCollapsed;
621
+ }
622
+ return super.computeInputEditorHeight(lineHeight);
623
+ }
624
+ async computeModifiedInputEditorHeight() {
625
+ if (this.checkIfInputModified()) {
626
+ this.editorHeightWithUnchangedLinesCollapsed = this._layoutInfo.editorHeight = await this.diffEditorHeightCalculator.diffAndComputeHeight(this.original.uri, this.modified.uri);
627
+ }
628
+ }
629
+ async computeModifiedMetadataEditorHeight() {
630
+ if (this.checkMetadataIfModified()) {
631
+ const originalMetadataUri = CellUri.generateCellPropertyUri(this.originalDocument.uri, this.original.handle, Schemas.vscodeNotebookCellMetadata);
632
+ const modifiedMetadataUri = CellUri.generateCellPropertyUri(this.modifiedDocument.uri, this.modified.handle, Schemas.vscodeNotebookCellMetadata);
633
+ this._layoutInfo.metadataHeight = await this.diffEditorHeightCalculator.diffAndComputeHeight(originalMetadataUri, modifiedMetadataUri);
634
+ }
635
+ }
636
+ async computeEditorHeights() {
637
+ if (this.type === 'unchanged') {
638
+ return;
639
+ }
640
+ await Promise.all([this.computeModifiedInputEditorHeight(), this.computeModifiedMetadataEditorHeight()]);
641
+ }
642
+ }
643
+ class SingleSideDiffElementViewModel extends DiffElementCellViewModelBase {
644
+ get cellViewModel() {
645
+ return this.type === 'insert' ? this.modified : this.original;
646
+ }
647
+ get originalDocument() {
648
+ if (this.type === 'insert') {
649
+ return this.otherDocumentTextModel;
650
+ }
651
+ else {
652
+ return this.mainDocumentTextModel;
653
+ }
654
+ }
655
+ get modifiedDocument() {
656
+ if (this.type === 'insert') {
657
+ return this.mainDocumentTextModel;
658
+ }
659
+ else {
660
+ return this.otherDocumentTextModel;
661
+ }
662
+ }
663
+ constructor(mainDocumentTextModel, otherDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, configurationService, diffEditorHeightCalculator, index) {
664
+ super(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator);
665
+ this.otherDocumentTextModel = otherDocumentTextModel;
666
+ this.type = type;
667
+ this._register(this.cellViewModel.onDidChangeOutputLayout(() => {
668
+ this._layout({ recomputeOutput: true });
669
+ }));
670
+ }
671
+ checkIfInputModified() {
672
+ return {
673
+ reason: 'Cell content has changed',
674
+ };
675
+ }
676
+ getNestedCellViewModel(diffSide) {
677
+ return this.type === 'insert' ? this.modified : this.original;
678
+ }
679
+ checkIfOutputsModified() {
680
+ return false;
681
+ }
682
+ checkMetadataIfModified() {
683
+ return false;
684
+ }
685
+ updateOutputHeight(diffSide, index, height) {
686
+ this.cellViewModel?.updateOutputHeight(index, height);
687
+ }
688
+ getOutputOffsetInContainer(diffSide, index) {
689
+ return this.cellViewModel.getOutputOffset(index);
690
+ }
691
+ getOutputOffsetInCell(diffSide, index) {
692
+ const offsetInOutputsContainer = this.cellViewModel.getOutputOffset(index);
693
+ return this._layoutInfo.editorHeight
694
+ + this._layoutInfo.editorMargin
695
+ + this._layoutInfo.metadataHeight
696
+ + this._layoutInfo.cellStatusHeight
697
+ + this._layoutInfo.metadataStatusHeight
698
+ + this._layoutInfo.outputStatusHeight
699
+ + this._layoutInfo.bodyMargin / 2
700
+ + offsetInOutputsContainer;
701
+ }
702
+ isOutputEmpty() {
703
+ if (this.mainDocumentTextModel.transientOptions.transientOutputs) {
704
+ return true;
705
+ }
706
+ return (this.original?.outputs || this.modified?.outputs || []).length === 0;
707
+ }
708
+ getRichOutputTotalHeight() {
709
+ return this.cellViewModel?.getOutputTotalHeight() ?? 0;
710
+ }
711
+ getCellByUri(cellUri) {
712
+ return this.cellViewModel;
713
+ }
714
+ }
715
+ var OutputComparison;
716
+ (function (OutputComparison) {
717
+ OutputComparison[OutputComparison["Unchanged"] = 0] = "Unchanged";
718
+ OutputComparison[OutputComparison["Metadata"] = 1] = "Metadata";
719
+ OutputComparison[OutputComparison["Other"] = 2] = "Other";
720
+ })(OutputComparison || (OutputComparison = {}));
721
+ function outputEqual(a, b) {
722
+ if (hash(a.metadata) === hash(b.metadata)) {
723
+ return OutputComparison.Other;
724
+ }
725
+ for (let j = 0; j < a.outputs.length; j++) {
726
+ const aOutputItem = a.outputs[j];
727
+ const bOutputItem = b.outputs[j];
728
+ if (aOutputItem.mime !== bOutputItem.mime) {
729
+ return OutputComparison.Other;
730
+ }
731
+ if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
732
+ return OutputComparison.Other;
733
+ }
734
+ for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
735
+ if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
736
+ return OutputComparison.Other;
737
+ }
738
+ }
739
+ }
740
+ return OutputComparison.Metadata;
741
+ }
742
+ function outputsEqual(original, modified) {
743
+ if (original.length !== modified.length) {
744
+ return OutputComparison.Other;
745
+ }
746
+ const len = original.length;
747
+ for (let i = 0; i < len; i++) {
748
+ const a = original[i];
749
+ const b = modified[i];
750
+ if (hash(a.metadata) !== hash(b.metadata)) {
751
+ return OutputComparison.Metadata;
752
+ }
753
+ if (a.outputs.length !== b.outputs.length) {
754
+ return OutputComparison.Other;
755
+ }
756
+ for (let j = 0; j < a.outputs.length; j++) {
757
+ const aOutputItem = a.outputs[j];
758
+ const bOutputItem = b.outputs[j];
759
+ if (aOutputItem.mime !== bOutputItem.mime) {
760
+ return OutputComparison.Other;
761
+ }
762
+ if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
763
+ return OutputComparison.Other;
764
+ }
765
+ for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
766
+ if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
767
+ return OutputComparison.Other;
768
+ }
769
+ }
770
+ }
771
+ }
772
+ return OutputComparison.Unchanged;
773
+ }
774
+ function getStreamOutputData(outputs) {
775
+ if (!outputs.length) {
776
+ return null;
777
+ }
778
+ const first = outputs[0];
779
+ const mime = first.mime;
780
+ const sameStream = !outputs.find(op => op.mime !== mime);
781
+ if (sameStream) {
782
+ return ( outputs.map(opit => ( opit.data.toString()))).join('');
783
+ }
784
+ else {
785
+ return null;
786
+ }
787
+ }
788
+ function getFormattedOutputJSON(outputs) {
789
+ if (outputs.length === 1) {
790
+ const streamOutputData = getStreamOutputData(outputs[0].outputs);
791
+ if (streamOutputData) {
792
+ return streamOutputData;
793
+ }
794
+ }
795
+ return JSON.stringify(( outputs.map(output => {
796
+ return ({
797
+ metadata: output.metadata,
798
+ outputItems: ( output.outputs.map(opit => ({
799
+ mimeType: opit.mime,
800
+ data: ( opit.data.toString())
801
+ })))
802
+ });
803
+ })), undefined, '\t');
804
+ }
805
+
806
+ export { DefaultLineHeight, DiffElementCellViewModelBase, DiffElementPlaceholderViewModel, DiffElementViewModelBase, HeightOfHiddenLinesRegionInDiffEditor, NotebookDocumentMetadataViewModel, OUTPUT_EDITOR_HEIGHT_MAGIC, OutputComparison, PropertyFoldingState, SideBySideDiffElementViewModel, SingleSideDiffElementViewModel, getFormattedOutputJSON, getStreamOutputData, outputEqual };