'use strict' ; import * as vscode from 'vscode' ; import * as path from 'path' ; import { ReactView } from './ReactView' ; import { ExtensionUtil } from '../util/ExtensionUtil' ; import { Reporter } from '../util/Reporter' ; export class Fabric2View extends ReactView { constructor ( context ) { super ( context , 'fabric2view' , `What's new with Fabric v2.0` ) ; } async openPanelInner ( panel ) { Reporter . instance ( ) . sendTelemetryEvent ( 'openedView' , { openedView : panel . title } ) ; const extensionPath = ExtensionUtil . getExtensionPath ( ) ; const panelIcon = vscode . Uri . file ( path . join ( extensionPath , 'resources' , 'logo.svg' ) ) ; panel . iconPath = panelIcon ; panel . webview . onDidReceiveMessage ( async ( message ) => { if ( message . data ) { await vscode . commands . executeCommand ( message . command , ... message . data ) ; } else { await vscode . commands . executeCommand ( message . command ) ; } } ) ; await this . loadComponent ( panel ) ; } async loadComponent ( panel ) { panel . webview . postMessage ( { path : '/fabric2' } ) ; } }