Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/mermaid-chat-features/chat-webview-src/index.ts
5303 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
import { initializeMermaidWebview } from './mermaidWebview';
6
import { VsCodeApi } from './vscodeApi';
7
8
declare function acquireVsCodeApi(): VsCodeApi;
9
const vscode = acquireVsCodeApi();
10
11
12
async function main() {
13
await initializeMermaidWebview(vscode);
14
15
// Set up the "Open in Editor" button
16
const openBtn = document.querySelector('.open-in-editor-btn');
17
if (openBtn) {
18
openBtn.addEventListener('click', e => {
19
e.stopPropagation();
20
vscode.postMessage({ type: 'openInEditor' });
21
});
22
}
23
}
24
main();
25
26