Files
vscode/extensions/mermaid-chat-features/chat-webview-src/index.ts
Matt Bierner 1772c98373 Allow opening chat mermaid diagrams in a full sized editor
Fixes #271371

Basic flow is working but needs polish
2026-01-27 01:53:56 -08:00

25 lines
860 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { initializeMermaidWebview } from './mermaidWebview';
import { VsCodeApi } from './vscodeApi';
declare function acquireVsCodeApi(): VsCodeApi;
const vscode = acquireVsCodeApi();
async function main() {
await initializeMermaidWebview(vscode);
// Set up the "Open in Editor" button
const openBtn = document.querySelector('.open-in-editor-btn');
if (openBtn) {
openBtn.addEventListener('click', e => {
e.stopPropagation();
vscode.postMessage({ type: 'openInEditor' });
});
}
}
main();