File tree Expand file tree Collapse file tree
vscode-extension/hypercanvas-preview/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -608,6 +608,10 @@ export class PreviewPanel {
608608 */
609609 private _getHtmlForWebview ( ) : string {
610610 const webview = this . _panel ?. webview ;
611+ if ( ! webview ) {
612+ // Fallback HTML if the webview panel is not available
613+ return '<!DOCTYPE html><html><body><p>Preview is not available.</p></body></html>' ;
614+ }
611615 const nonce = this . _getNonce ( ) ;
612616
613617 const scriptUri = webview . asWebviewUri ( vscode . Uri . joinPath ( this . _extensionUri , 'out' , 'webview-preview-panel.js' ) ) ;
@@ -618,6 +622,7 @@ export class PreviewPanel {
618622<head>
619623 <meta charset="UTF-8">
620624 <meta name="viewport" content="width=device-width, initial-scale=1.0">
625+ <!-- unsafe-inline required: React applies styles via style={{}} attributes in PreviewPanelApp -->
621626 <meta http-equiv="Content-Security-Policy" content="
622627 default-src 'none';
623628 frame-src *;
@@ -628,15 +633,6 @@ export class PreviewPanel {
628633 ">
629634 <title>HyperCanvas Preview</title>
630635 <link rel="stylesheet" href="${ cssUri } ">
631- <style>
632- html, body, #root {
633- margin: 0;
634- padding: 0;
635- width: 100%;
636- height: 100%;
637- overflow: hidden;
638- }
639- </style>
640636</head>
641637<body>
642638 <div id="root"></div>
Original file line number Diff line number Diff line change 11/** Stub: Monaco editor is not needed in VS Code extension */
22export default ( ) => null ;
33export const loader = { config : ( ) => { } } ;
4- export const Delayer = class {
4+ export class Delayer {
55 trigger ( ) {
66 return Promise . resolve ( ) ;
77 }
8- } ;
8+ }
You can’t perform that action at this time.
0 commit comments