@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.
- package/empty.js +1 -0
- package/package.json +45 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +37 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +127 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +27 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +81 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +44 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +172 -0
- package/vscode/src/vs/platform/editor/browser/editor.d.ts +12 -0
- package/vscode/src/vs/platform/editor/browser/editor.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +295 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +650 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +364 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.d.ts +169 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.js +951 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.js +286 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.d.ts +116 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +417 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.js +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.js +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.d.ts +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +567 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.js +259 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +528 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.js +429 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.js +164 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css +341 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatExtensionsContent.css +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMarkdownPart.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMcpServersInteractionContent.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatPullRequestContent.css +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatThinkingContent.css +162 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +96 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.js +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +353 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +100 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +1085 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +275 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +225 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +388 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +721 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +409 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.d.ts +334 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +2008 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.d.ts +217 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1573 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +249 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.js +174 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionAction.css +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.d.ts +292 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +2014 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.d.ts +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +797 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.js +345 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1069 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css +2880 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatCodeBlockPill.css +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css +209 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.js +135 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +176 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +373 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +171 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +1442 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +199 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +482 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +37 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +95 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +497 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +76 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +464 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +124 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +562 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +279 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +411 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +66 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +154 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +201 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +372 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +594 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1746 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +269 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +806 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +116 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +295 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +241 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +146 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +42 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +77 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +823 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +567 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +189 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +439 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +263 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +89 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +108 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +145 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { hashAsync } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
6
|
+
import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
8
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
9
|
+
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
10
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
11
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
12
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
13
|
+
import { EditorModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorModel';
|
|
14
|
+
|
|
15
|
+
function parseUnifiedDiff(diffText) {
|
|
16
|
+
const lines = diffText.split('\n');
|
|
17
|
+
const beforeLines = [];
|
|
18
|
+
const afterLines = [];
|
|
19
|
+
for (const line of lines) {
|
|
20
|
+
if (line.startsWith('- ')) {
|
|
21
|
+
beforeLines.push(line.substring(2));
|
|
22
|
+
}
|
|
23
|
+
else if (line.startsWith('-')) {
|
|
24
|
+
beforeLines.push(line.substring(1));
|
|
25
|
+
}
|
|
26
|
+
else if (line.startsWith('+ ')) {
|
|
27
|
+
afterLines.push(line.substring(2));
|
|
28
|
+
}
|
|
29
|
+
else if (line.startsWith('+')) {
|
|
30
|
+
afterLines.push(line.substring(1));
|
|
31
|
+
}
|
|
32
|
+
else if (line.startsWith(' ')) {
|
|
33
|
+
const content = line.substring(1);
|
|
34
|
+
beforeLines.push(content);
|
|
35
|
+
afterLines.push(content);
|
|
36
|
+
}
|
|
37
|
+
else if (!line.startsWith('@@') && !line.startsWith('---') && !line.startsWith('+++') && !line.startsWith('diff ')) {
|
|
38
|
+
beforeLines.push(line);
|
|
39
|
+
afterLines.push(line);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
before: beforeLines.join('\n'),
|
|
44
|
+
after: afterLines.join('\n')
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
class SimpleDiffEditorModel extends EditorModel {
|
|
48
|
+
constructor(_original, _modified) {
|
|
49
|
+
super();
|
|
50
|
+
this._original = _original;
|
|
51
|
+
this._modified = _modified;
|
|
52
|
+
this.original = this._original.object.textEditorModel;
|
|
53
|
+
this.modified = this._modified.object.textEditorModel;
|
|
54
|
+
}
|
|
55
|
+
dispose() {
|
|
56
|
+
super.dispose();
|
|
57
|
+
this._original.dispose();
|
|
58
|
+
this._modified.dispose();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
let MarkdownDiffBlockPart = class MarkdownDiffBlockPart extends Disposable {
|
|
62
|
+
constructor(data, diffEditorPool, currentWidth, modelService, textModelService, languageService) {
|
|
63
|
+
super();
|
|
64
|
+
this.modelService = modelService;
|
|
65
|
+
this.textModelService = textModelService;
|
|
66
|
+
this.languageService = languageService;
|
|
67
|
+
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
68
|
+
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
69
|
+
this.modelRef = this._register(( new MutableDisposable()));
|
|
70
|
+
this.comparePart = this._register(diffEditorPool.get());
|
|
71
|
+
this._register(this.comparePart.object.onDidChangeContentHeight(() => {
|
|
72
|
+
this._onDidChangeContentHeight.fire();
|
|
73
|
+
}));
|
|
74
|
+
const originalUri = ( URI.from({
|
|
75
|
+
scheme: Schemas.vscodeChatCodeBlock,
|
|
76
|
+
path: `/chat-diff-original-${data.codeBlockIndex}-${generateUuid()}`,
|
|
77
|
+
}));
|
|
78
|
+
const modifiedUri = ( URI.from({
|
|
79
|
+
scheme: Schemas.vscodeChatCodeBlock,
|
|
80
|
+
path: `/chat-diff-modified-${data.codeBlockIndex}-${generateUuid()}`,
|
|
81
|
+
}));
|
|
82
|
+
const languageSelection = this.languageService.createById(data.languageId);
|
|
83
|
+
this._register(this.modelService.createModel(data.beforeContent, languageSelection, originalUri, false));
|
|
84
|
+
this._register(this.modelService.createModel(data.afterContent, languageSelection, modifiedUri, false));
|
|
85
|
+
const modelsPromise = Promise.all([
|
|
86
|
+
this.textModelService.createModelReference(originalUri),
|
|
87
|
+
this.textModelService.createModelReference(modifiedUri)
|
|
88
|
+
]).then(([originalRef, modifiedRef]) => {
|
|
89
|
+
return ( new SimpleDiffEditorModel(originalRef, modifiedRef));
|
|
90
|
+
});
|
|
91
|
+
const compareData = {
|
|
92
|
+
element: data.element,
|
|
93
|
+
isReadOnly: data.isReadOnly,
|
|
94
|
+
horizontalPadding: data.horizontalPadding,
|
|
95
|
+
edit: {
|
|
96
|
+
uri: data.codeBlockResource || modifiedUri,
|
|
97
|
+
edits: [],
|
|
98
|
+
kind: 'textEditGroup',
|
|
99
|
+
done: true
|
|
100
|
+
},
|
|
101
|
+
diffData: modelsPromise.then(async (model) => {
|
|
102
|
+
this.modelRef.value = model;
|
|
103
|
+
const diffData = {
|
|
104
|
+
original: model.original,
|
|
105
|
+
modified: model.modified,
|
|
106
|
+
originalSha1: await hashAsync(model.original.getValue()),
|
|
107
|
+
};
|
|
108
|
+
return diffData;
|
|
109
|
+
})
|
|
110
|
+
};
|
|
111
|
+
this.comparePart.object.render(compareData, currentWidth, CancellationToken.None);
|
|
112
|
+
this.element = this.comparePart.object.element;
|
|
113
|
+
}
|
|
114
|
+
layout(width) {
|
|
115
|
+
this.comparePart.object.layout(width);
|
|
116
|
+
}
|
|
117
|
+
reset() {
|
|
118
|
+
this.modelRef.clear();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
MarkdownDiffBlockPart = ( __decorate([
|
|
122
|
+
( __param(3, IModelService)),
|
|
123
|
+
( __param(4, ITextModelService)),
|
|
124
|
+
( __param(5, ILanguageService))
|
|
125
|
+
], MarkdownDiffBlockPart));
|
|
126
|
+
|
|
127
|
+
export { MarkdownDiffBlockPart, parseUnifiedDiff };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
2
|
+
import { Themable } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService";
|
|
3
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
4
|
+
import { ISharedWebContentExtractorService } from "@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service";
|
|
5
|
+
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
6
|
+
import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
|
+
import { ChatAttachmentModel } from "./chatAttachmentModel.js";
|
|
8
|
+
import { IChatAttachmentResolveService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service";
|
|
9
|
+
import { IChatInputStyles } from "./chatInputPart.js";
|
|
10
|
+
export declare class ChatDragAndDrop extends Themable {
|
|
11
|
+
private readonly widgetRef;
|
|
12
|
+
private readonly attachmentModel;
|
|
13
|
+
private readonly styles;
|
|
14
|
+
private readonly extensionService;
|
|
15
|
+
private readonly webContentExtractorService;
|
|
16
|
+
private readonly logService;
|
|
17
|
+
private readonly chatAttachmentResolveService;
|
|
18
|
+
private readonly overlays;
|
|
19
|
+
private overlayText?;
|
|
20
|
+
private overlayTextBackground;
|
|
21
|
+
private disableOverlay;
|
|
22
|
+
constructor(widgetRef: () => IChatWidget | undefined, attachmentModel: ChatAttachmentModel, styles: IChatInputStyles, themeService: IThemeService, extensionService: IExtensionService, webContentExtractorService: ISharedWebContentExtractorService, logService: ILogService, chatAttachmentResolveService: IChatAttachmentResolveService);
|
|
23
|
+
addOverlay(target: HTMLElement, overlayContainer: HTMLElement): void;
|
|
24
|
+
removeOverlay(target: HTMLElement): void;
|
|
25
|
+
setDisabledOverlay(disable: boolean): void;
|
|
26
|
+
private currentActiveTarget;
|
|
27
|
+
private createOverlay;
|
|
28
|
+
private onDragEnter;
|
|
29
|
+
private onDragLeave;
|
|
30
|
+
private onDrop;
|
|
31
|
+
private drop;
|
|
32
|
+
private updateDropFeedback;
|
|
33
|
+
private guessDropType;
|
|
34
|
+
private isDragEventSupported;
|
|
35
|
+
private getDropTypeName;
|
|
36
|
+
private resolveAttachmentsFromDragEvent;
|
|
37
|
+
private downloadImageAsUint8Array;
|
|
38
|
+
private resolveHTMLAttachContext;
|
|
39
|
+
private setOverlay;
|
|
40
|
+
private getOverlayText;
|
|
41
|
+
private updateOverlayStyles;
|
|
42
|
+
updateStyles(): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { DataTransfers } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dnd';
|
|
4
|
+
import { createElement, DragAndDropObserver, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
+
import { renderLabelWithIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
6
|
+
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
7
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
8
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
9
|
+
import { UriList } from '@codingame/monaco-vscode-api/vscode/vs/base/common/dataTransfer';
|
|
10
|
+
import { toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { Mimes } from '@codingame/monaco-vscode-api/vscode/vs/base/common/mime';
|
|
12
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
13
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { containsDragType, CodeDataTransfers, extractNotebookCellOutputDropData, extractMarkerDropData, extractSymbolDropData, extractEditorsDropData } from '@codingame/monaco-vscode-api/vscode/vs/platform/dnd/browser/dnd';
|
|
15
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
16
|
+
import { Themable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
17
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
18
|
+
import { ISharedWebContentExtractorService } from '@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service';
|
|
19
|
+
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
20
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
21
|
+
import { extractSCMHistoryItemDropData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/browser/scmHistoryChatContext';
|
|
22
|
+
import { IChatAttachmentResolveService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service';
|
|
23
|
+
import { convertStringToUInt8Array } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/imageUtils';
|
|
24
|
+
|
|
25
|
+
var ChatDragAndDropType;
|
|
26
|
+
(function (ChatDragAndDropType) {
|
|
27
|
+
ChatDragAndDropType[ChatDragAndDropType["FILE_INTERNAL"] = 0] = "FILE_INTERNAL";
|
|
28
|
+
ChatDragAndDropType[ChatDragAndDropType["FILE_EXTERNAL"] = 1] = "FILE_EXTERNAL";
|
|
29
|
+
ChatDragAndDropType[ChatDragAndDropType["FOLDER"] = 2] = "FOLDER";
|
|
30
|
+
ChatDragAndDropType[ChatDragAndDropType["IMAGE"] = 3] = "IMAGE";
|
|
31
|
+
ChatDragAndDropType[ChatDragAndDropType["SYMBOL"] = 4] = "SYMBOL";
|
|
32
|
+
ChatDragAndDropType[ChatDragAndDropType["HTML"] = 5] = "HTML";
|
|
33
|
+
ChatDragAndDropType[ChatDragAndDropType["MARKER"] = 6] = "MARKER";
|
|
34
|
+
ChatDragAndDropType[ChatDragAndDropType["NOTEBOOK_CELL_OUTPUT"] = 7] = "NOTEBOOK_CELL_OUTPUT";
|
|
35
|
+
ChatDragAndDropType[ChatDragAndDropType["SCM_HISTORY_ITEM"] = 8] = "SCM_HISTORY_ITEM";
|
|
36
|
+
})(ChatDragAndDropType || (ChatDragAndDropType = {}));
|
|
37
|
+
const IMAGE_DATA_REGEX = /^data:image\/[a-z]+;base64,/;
|
|
38
|
+
const URL_REGEX = /^https?:\/\/.+/;
|
|
39
|
+
let ChatDragAndDrop = class ChatDragAndDrop extends Themable {
|
|
40
|
+
constructor(widgetRef, attachmentModel, styles, themeService, extensionService, webContentExtractorService, logService, chatAttachmentResolveService) {
|
|
41
|
+
super(themeService);
|
|
42
|
+
this.widgetRef = widgetRef;
|
|
43
|
+
this.attachmentModel = attachmentModel;
|
|
44
|
+
this.styles = styles;
|
|
45
|
+
this.extensionService = extensionService;
|
|
46
|
+
this.webContentExtractorService = webContentExtractorService;
|
|
47
|
+
this.logService = logService;
|
|
48
|
+
this.chatAttachmentResolveService = chatAttachmentResolveService;
|
|
49
|
+
this.overlays = ( new Map());
|
|
50
|
+
this.overlayTextBackground = '';
|
|
51
|
+
this.disableOverlay = false;
|
|
52
|
+
this.currentActiveTarget = undefined;
|
|
53
|
+
this.updateStyles();
|
|
54
|
+
this._register(toDisposable(() => {
|
|
55
|
+
this.overlays.forEach(({ overlay, disposable }) => {
|
|
56
|
+
disposable.dispose();
|
|
57
|
+
overlay.remove();
|
|
58
|
+
});
|
|
59
|
+
this.overlays.clear();
|
|
60
|
+
this.currentActiveTarget = undefined;
|
|
61
|
+
this.overlayText?.remove();
|
|
62
|
+
this.overlayText = undefined;
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
addOverlay(target, overlayContainer) {
|
|
66
|
+
this.removeOverlay(target);
|
|
67
|
+
const { overlay, disposable } = this.createOverlay(target, overlayContainer);
|
|
68
|
+
this.overlays.set(target, { overlay, disposable });
|
|
69
|
+
}
|
|
70
|
+
removeOverlay(target) {
|
|
71
|
+
if (this.currentActiveTarget === target) {
|
|
72
|
+
this.currentActiveTarget = undefined;
|
|
73
|
+
}
|
|
74
|
+
const existingOverlay = this.overlays.get(target);
|
|
75
|
+
if (existingOverlay) {
|
|
76
|
+
existingOverlay.overlay.remove();
|
|
77
|
+
existingOverlay.disposable.dispose();
|
|
78
|
+
this.overlays.delete(target);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setDisabledOverlay(disable) {
|
|
82
|
+
this.disableOverlay = disable;
|
|
83
|
+
}
|
|
84
|
+
createOverlay(target, overlayContainer) {
|
|
85
|
+
const overlay = createElement('div');
|
|
86
|
+
overlay.classList.add('chat-dnd-overlay');
|
|
87
|
+
this.updateOverlayStyles(overlay);
|
|
88
|
+
overlayContainer.appendChild(overlay);
|
|
89
|
+
const disposable = ( new DragAndDropObserver(target, {
|
|
90
|
+
onDragOver: (e) => {
|
|
91
|
+
if (this.disableOverlay) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
if (target === this.currentActiveTarget) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (this.currentActiveTarget) {
|
|
100
|
+
this.setOverlay(this.currentActiveTarget, undefined);
|
|
101
|
+
}
|
|
102
|
+
this.currentActiveTarget = target;
|
|
103
|
+
this.onDragEnter(e, target);
|
|
104
|
+
},
|
|
105
|
+
onDragLeave: (e) => {
|
|
106
|
+
if (this.disableOverlay) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (target === this.currentActiveTarget) {
|
|
110
|
+
this.currentActiveTarget = undefined;
|
|
111
|
+
}
|
|
112
|
+
this.onDragLeave(e, target);
|
|
113
|
+
},
|
|
114
|
+
onDrop: (e) => {
|
|
115
|
+
if (this.disableOverlay) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
e.stopPropagation();
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
if (target !== this.currentActiveTarget) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.currentActiveTarget = undefined;
|
|
124
|
+
this.onDrop(e, target);
|
|
125
|
+
},
|
|
126
|
+
}));
|
|
127
|
+
return { overlay, disposable };
|
|
128
|
+
}
|
|
129
|
+
onDragEnter(e, target) {
|
|
130
|
+
const estimatedDropType = this.guessDropType(e);
|
|
131
|
+
this.updateDropFeedback(e, target, estimatedDropType);
|
|
132
|
+
}
|
|
133
|
+
onDragLeave(e, target) {
|
|
134
|
+
this.updateDropFeedback(e, target, undefined);
|
|
135
|
+
}
|
|
136
|
+
onDrop(e, target) {
|
|
137
|
+
this.updateDropFeedback(e, target, undefined);
|
|
138
|
+
this.drop(e);
|
|
139
|
+
}
|
|
140
|
+
async drop(e) {
|
|
141
|
+
const contexts = await this.resolveAttachmentsFromDragEvent(e);
|
|
142
|
+
if (contexts.length === 0) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.attachmentModel.addContext(...contexts);
|
|
146
|
+
}
|
|
147
|
+
updateDropFeedback(e, target, dropType) {
|
|
148
|
+
const showOverlay = dropType !== undefined;
|
|
149
|
+
if (e.dataTransfer) {
|
|
150
|
+
e.dataTransfer.dropEffect = showOverlay ? 'copy' : 'none';
|
|
151
|
+
}
|
|
152
|
+
this.setOverlay(target, dropType);
|
|
153
|
+
}
|
|
154
|
+
guessDropType(e) {
|
|
155
|
+
if (containsDragType(e, CodeDataTransfers.NOTEBOOK_CELL_OUTPUT)) {
|
|
156
|
+
return ChatDragAndDropType.NOTEBOOK_CELL_OUTPUT;
|
|
157
|
+
}
|
|
158
|
+
else if (containsDragType(e, CodeDataTransfers.SCM_HISTORY_ITEM)) {
|
|
159
|
+
return ChatDragAndDropType.SCM_HISTORY_ITEM;
|
|
160
|
+
}
|
|
161
|
+
else if (containsImageDragType(e)) {
|
|
162
|
+
return ( this.extensionService.extensions.some(ext => isProposedApiEnabled(ext, 'chatReferenceBinaryData'))) ? ChatDragAndDropType.IMAGE : undefined;
|
|
163
|
+
}
|
|
164
|
+
else if (containsDragType(e, 'text/html')) {
|
|
165
|
+
return ChatDragAndDropType.HTML;
|
|
166
|
+
}
|
|
167
|
+
else if (containsDragType(e, CodeDataTransfers.SYMBOLS)) {
|
|
168
|
+
return ChatDragAndDropType.SYMBOL;
|
|
169
|
+
}
|
|
170
|
+
else if (containsDragType(e, CodeDataTransfers.MARKERS)) {
|
|
171
|
+
return ChatDragAndDropType.MARKER;
|
|
172
|
+
}
|
|
173
|
+
else if (containsDragType(e, DataTransfers.FILES)) {
|
|
174
|
+
return ChatDragAndDropType.FILE_EXTERNAL;
|
|
175
|
+
}
|
|
176
|
+
else if (containsDragType(e, CodeDataTransfers.EDITORS)) {
|
|
177
|
+
return ChatDragAndDropType.FILE_INTERNAL;
|
|
178
|
+
}
|
|
179
|
+
else if (containsDragType(e, Mimes.uriList, CodeDataTransfers.FILES, DataTransfers.RESOURCES, DataTransfers.INTERNAL_URI_LIST)) {
|
|
180
|
+
return ChatDragAndDropType.FOLDER;
|
|
181
|
+
}
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
isDragEventSupported(e) {
|
|
185
|
+
const dropType = this.guessDropType(e);
|
|
186
|
+
return dropType !== undefined;
|
|
187
|
+
}
|
|
188
|
+
getDropTypeName(type) {
|
|
189
|
+
switch (type) {
|
|
190
|
+
case ChatDragAndDropType.FILE_INTERNAL: return localize(5176, 'File');
|
|
191
|
+
case ChatDragAndDropType.FILE_EXTERNAL: return localize(5176, 'File');
|
|
192
|
+
case ChatDragAndDropType.FOLDER: return localize(5177, 'Folder');
|
|
193
|
+
case ChatDragAndDropType.IMAGE: return localize(5178, 'Image');
|
|
194
|
+
case ChatDragAndDropType.SYMBOL: return localize(5179, 'Symbol');
|
|
195
|
+
case ChatDragAndDropType.MARKER: return localize(5180, 'Problem');
|
|
196
|
+
case ChatDragAndDropType.HTML: return localize(5181, 'URL');
|
|
197
|
+
case ChatDragAndDropType.NOTEBOOK_CELL_OUTPUT: return localize(5182, 'Output');
|
|
198
|
+
case ChatDragAndDropType.SCM_HISTORY_ITEM: return localize(5183, 'Change');
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
async resolveAttachmentsFromDragEvent(e) {
|
|
202
|
+
if (!this.isDragEventSupported(e)) {
|
|
203
|
+
return [];
|
|
204
|
+
}
|
|
205
|
+
if (containsDragType(e, CodeDataTransfers.NOTEBOOK_CELL_OUTPUT)) {
|
|
206
|
+
const notebookOutputData = extractNotebookCellOutputDropData(e);
|
|
207
|
+
if (notebookOutputData) {
|
|
208
|
+
return this.chatAttachmentResolveService.resolveNotebookOutputAttachContext(notebookOutputData);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (containsDragType(e, CodeDataTransfers.SCM_HISTORY_ITEM)) {
|
|
212
|
+
const scmHistoryItemData = extractSCMHistoryItemDropData(e);
|
|
213
|
+
if (scmHistoryItemData) {
|
|
214
|
+
return this.chatAttachmentResolveService.resolveSourceControlHistoryItemAttachContext(scmHistoryItemData);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const markerData = extractMarkerDropData(e);
|
|
218
|
+
if (markerData) {
|
|
219
|
+
return this.chatAttachmentResolveService.resolveMarkerAttachContext(markerData);
|
|
220
|
+
}
|
|
221
|
+
if (containsDragType(e, CodeDataTransfers.SYMBOLS)) {
|
|
222
|
+
const symbolsData = extractSymbolDropData(e);
|
|
223
|
+
return this.chatAttachmentResolveService.resolveSymbolsAttachContext(symbolsData);
|
|
224
|
+
}
|
|
225
|
+
const editorDragData = extractEditorsDropData(e);
|
|
226
|
+
if (editorDragData.length > 0) {
|
|
227
|
+
return coalesce(await Promise.all(( editorDragData.map(editorInput => {
|
|
228
|
+
return this.chatAttachmentResolveService.resolveEditorAttachContext(editorInput);
|
|
229
|
+
}))));
|
|
230
|
+
}
|
|
231
|
+
const internal = e.dataTransfer?.getData(DataTransfers.INTERNAL_URI_LIST);
|
|
232
|
+
if (internal) {
|
|
233
|
+
const uriList = UriList.parse(internal);
|
|
234
|
+
if (uriList.length) {
|
|
235
|
+
return coalesce(await Promise.all(( uriList.map(
|
|
236
|
+
uri => this.chatAttachmentResolveService.resolveEditorAttachContext({ resource: ( URI.parse(uri)) })
|
|
237
|
+
))));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!containsDragType(e, DataTransfers.INTERNAL_URI_LIST) && containsDragType(e, Mimes.uriList) && (((containsDragType(e, Mimes.html) || containsDragType(e, Mimes.text)) ))) {
|
|
241
|
+
return this.resolveHTMLAttachContext(e);
|
|
242
|
+
}
|
|
243
|
+
return [];
|
|
244
|
+
}
|
|
245
|
+
async downloadImageAsUint8Array(url) {
|
|
246
|
+
try {
|
|
247
|
+
const extractedImages = await this.webContentExtractorService.readImage(( URI.parse(url)), CancellationToken.None);
|
|
248
|
+
if (extractedImages) {
|
|
249
|
+
return extractedImages.buffer;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
this.logService.warn('Fetch failed:', error);
|
|
254
|
+
}
|
|
255
|
+
const widget = this.widgetRef();
|
|
256
|
+
const selection = widget?.inputEditor.getSelection();
|
|
257
|
+
if (selection && widget) {
|
|
258
|
+
widget.inputEditor.executeEdits('chatInsertUrl', [{ range: selection, text: url }]);
|
|
259
|
+
}
|
|
260
|
+
this.logService.warn(`Image URLs must end in .jpg, .png, .gif, .webp, or .bmp. Failed to fetch image from this URL: ${url}`);
|
|
261
|
+
return undefined;
|
|
262
|
+
}
|
|
263
|
+
async resolveHTMLAttachContext(e) {
|
|
264
|
+
const existingAttachmentNames = ( new Set(( this.attachmentModel.attachments.map(attachment => attachment.name))));
|
|
265
|
+
const createDisplayName = () => {
|
|
266
|
+
const baseName = ( localize(5184, 'Image from URL'));
|
|
267
|
+
let uniqueName = baseName;
|
|
268
|
+
let baseNameInstance = 1;
|
|
269
|
+
while (( existingAttachmentNames.has(uniqueName))) {
|
|
270
|
+
uniqueName = `${baseName} ${++baseNameInstance}`;
|
|
271
|
+
}
|
|
272
|
+
existingAttachmentNames.add(uniqueName);
|
|
273
|
+
return uniqueName;
|
|
274
|
+
};
|
|
275
|
+
const getImageTransferDataFromUrl = async (url) => {
|
|
276
|
+
const resource = ( URI.parse(url));
|
|
277
|
+
if (IMAGE_DATA_REGEX.test(url)) {
|
|
278
|
+
return { data: convertStringToUInt8Array(url), name: createDisplayName(), resource };
|
|
279
|
+
}
|
|
280
|
+
if (URL_REGEX.test(url)) {
|
|
281
|
+
const data = await this.downloadImageAsUint8Array(url);
|
|
282
|
+
if (data) {
|
|
283
|
+
return { data, name: createDisplayName(), resource, id: url };
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return undefined;
|
|
287
|
+
};
|
|
288
|
+
const getImageTransferDataFromFile = async (file) => {
|
|
289
|
+
try {
|
|
290
|
+
const buffer = await file.arrayBuffer();
|
|
291
|
+
return { data: ( new Uint8Array(buffer)), name: createDisplayName() };
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
this.logService.error('Error reading file:', error);
|
|
295
|
+
}
|
|
296
|
+
return undefined;
|
|
297
|
+
};
|
|
298
|
+
const imageTransferData = [];
|
|
299
|
+
const imageFiles = extractImageFilesFromDragEvent(e);
|
|
300
|
+
if (imageFiles.length) {
|
|
301
|
+
const imageTransferDataFromFiles = await Promise.all(( imageFiles.map(file => getImageTransferDataFromFile(file))));
|
|
302
|
+
imageTransferData.push(...imageTransferDataFromFiles.filter(data => !!data));
|
|
303
|
+
}
|
|
304
|
+
const imageUrls = extractUrlsFromDragEvent(e);
|
|
305
|
+
if (imageUrls.length) {
|
|
306
|
+
const imageTransferDataFromUrl = await Promise.all(( imageUrls.map(getImageTransferDataFromUrl)));
|
|
307
|
+
imageTransferData.push(...imageTransferDataFromUrl.filter(data => !!data));
|
|
308
|
+
}
|
|
309
|
+
return await this.chatAttachmentResolveService.resolveImageAttachContext(imageTransferData);
|
|
310
|
+
}
|
|
311
|
+
setOverlay(target, type) {
|
|
312
|
+
this.overlayText?.remove();
|
|
313
|
+
this.overlayText = undefined;
|
|
314
|
+
const { overlay } = this.overlays.get(target);
|
|
315
|
+
if (type !== undefined) {
|
|
316
|
+
const iconAndtextElements = renderLabelWithIcons(`$(${Codicon.attach.id}) ${this.getOverlayText(type)}`);
|
|
317
|
+
const htmlElements = ( iconAndtextElements.map(element => {
|
|
318
|
+
if (typeof element === 'string') {
|
|
319
|
+
return $('span.overlay-text', undefined, element);
|
|
320
|
+
}
|
|
321
|
+
return element;
|
|
322
|
+
}));
|
|
323
|
+
this.overlayText = $('span.attach-context-overlay-text', undefined, ...htmlElements);
|
|
324
|
+
this.overlayText.style.backgroundColor = this.overlayTextBackground;
|
|
325
|
+
overlay.appendChild(this.overlayText);
|
|
326
|
+
}
|
|
327
|
+
overlay.classList.toggle('visible', type !== undefined);
|
|
328
|
+
}
|
|
329
|
+
getOverlayText(type) {
|
|
330
|
+
const typeName = this.getDropTypeName(type);
|
|
331
|
+
return localize(5185, 'Attach {0} as Context', typeName);
|
|
332
|
+
}
|
|
333
|
+
updateOverlayStyles(overlay) {
|
|
334
|
+
overlay.style.backgroundColor = this.getColor(this.styles.overlayBackground) || '';
|
|
335
|
+
overlay.style.color = this.getColor(this.styles.listForeground) || '';
|
|
336
|
+
}
|
|
337
|
+
updateStyles() {
|
|
338
|
+
this.overlays.forEach(overlay => this.updateOverlayStyles(overlay.overlay));
|
|
339
|
+
this.overlayTextBackground = this.getColor(this.styles.listBackground) || '';
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
ChatDragAndDrop = ( __decorate([
|
|
343
|
+
( __param(3, IThemeService)),
|
|
344
|
+
( __param(4, IExtensionService)),
|
|
345
|
+
( __param(5, ISharedWebContentExtractorService)),
|
|
346
|
+
( __param(6, ILogService)),
|
|
347
|
+
( __param(7, IChatAttachmentResolveService))
|
|
348
|
+
], ChatDragAndDrop));
|
|
349
|
+
function containsImageDragType(e) {
|
|
350
|
+
if (containsDragType(e, 'image')) {
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
if (containsDragType(e, DataTransfers.FILES)) {
|
|
354
|
+
const files = e.dataTransfer?.files;
|
|
355
|
+
if (files && files.length > 0) {
|
|
356
|
+
return ( Array.from(files).some(file => file.type.startsWith('image/')));
|
|
357
|
+
}
|
|
358
|
+
const items = e.dataTransfer?.items;
|
|
359
|
+
if (items && items.length > 0) {
|
|
360
|
+
return ( Array.from(items).some(item => item.type.startsWith('image/')));
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
function extractUrlsFromDragEvent(e, logService) {
|
|
366
|
+
const textUrl = e.dataTransfer?.getData('text/uri-list');
|
|
367
|
+
if (textUrl) {
|
|
368
|
+
try {
|
|
369
|
+
const urls = UriList.parse(textUrl);
|
|
370
|
+
if (urls.length > 0) {
|
|
371
|
+
return urls;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
catch (error) {
|
|
375
|
+
return [];
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return [];
|
|
379
|
+
}
|
|
380
|
+
function extractImageFilesFromDragEvent(e) {
|
|
381
|
+
const files = e.dataTransfer?.files;
|
|
382
|
+
if (!files) {
|
|
383
|
+
return [];
|
|
384
|
+
}
|
|
385
|
+
return Array.from(files).filter(file => file.type.startsWith('image/'));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
export { ChatDragAndDrop };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions";
|
|
3
|
+
import { Action2, IAction2Options } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
4
|
+
import { IChatEditingSession } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
5
|
+
import { IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
6
|
+
export declare abstract class EditingSessionAction extends Action2 {
|
|
7
|
+
constructor(opts: Readonly<IAction2Options>);
|
|
8
|
+
run(accessor: ServicesAccessor, ...args: unknown[]): any;
|
|
9
|
+
abstract runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): any;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Resolve view title toolbar context. If none, return context from the lastFocusedWidget.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getEditingSessionContext(accessor: ServicesAccessor, args: any[]): {
|
|
15
|
+
editingSession?: IChatEditingSession;
|
|
16
|
+
chatWidget: IChatWidget;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare class ChatEditingAcceptAllAction extends EditingSessionAction {
|
|
19
|
+
constructor();
|
|
20
|
+
runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare class ChatEditingDiscardAllAction extends EditingSessionAction {
|
|
23
|
+
constructor();
|
|
24
|
+
runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare function discardAllEditsWithConfirmation(accessor: ServicesAccessor, currentEditingSession: IChatEditingSession): Promise<boolean>;
|
|
27
|
+
export declare class ChatEditingShowChangesAction extends EditingSessionAction {
|
|
28
|
+
static readonly ID = "chatEditing.viewChanges";
|
|
29
|
+
static readonly LABEL: string;
|
|
30
|
+
constructor();
|
|
31
|
+
runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export declare class ViewAllSessionChangesAction extends Action2 {
|
|
34
|
+
static readonly ID = "chatEditing.viewAllSessionChanges";
|
|
35
|
+
constructor();
|
|
36
|
+
run(accessor: ServicesAccessor, sessionResource?: URI): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export interface ChatEditingActionContext {
|
|
39
|
+
readonly sessionResource: URI;
|
|
40
|
+
readonly requestId: string;
|
|
41
|
+
readonly uri: URI;
|
|
42
|
+
readonly stopId: string | undefined;
|
|
43
|
+
}
|
|
44
|
+
export declare class ViewPreviousEditsAction extends EditingSessionAction {
|
|
45
|
+
static readonly Id = "chatEditing.viewPreviousEdits";
|
|
46
|
+
static readonly Label: string;
|
|
47
|
+
constructor();
|
|
48
|
+
runEditingSessionAction(accessor: ServicesAccessor, editingSession: IChatEditingSession, chatWidget: IChatWidget, ...args: unknown[]): Promise<void>;
|
|
49
|
+
}
|