diff --git a/type-script-helper/README.md b/type-script-helper/README.md index cbf2c9d..a35d8de 100644 --- a/type-script-helper/README.md +++ b/type-script-helper/README.md @@ -230,3 +230,8 @@ None ----------------------------------------------------------------------------------------------------------- - Changed ADO Priority servers + +## 1.120.0 1744401374311 = 638799981743110000 = 2025-1.Spring = Fri Apr 11 2025 12:56:13 GMT-0700 (Mountain Standard Time) +----------------------------------------------------------------------------------------------------------- + +- Sidebar button for view command pallete images diff --git a/type-script-helper/media/Screenshot 2025-04-11 125031.png b/type-script-helper/media/Screenshot 2025-04-11 125031.png new file mode 100644 index 0000000..1e80fea Binary files /dev/null and b/type-script-helper/media/Screenshot 2025-04-11 125031.png differ diff --git a/type-script-helper/media/Screenshot 2025-04-11 125350.png b/type-script-helper/media/Screenshot 2025-04-11 125350.png new file mode 100644 index 0000000..2bf5335 Binary files /dev/null and b/type-script-helper/media/Screenshot 2025-04-11 125350.png differ diff --git a/type-script-helper/media/lowres-LOGO_Black.png.png b/type-script-helper/media/lowres-LOGO_Black.png.png new file mode 100644 index 0000000..3f2c3b1 Binary files /dev/null and b/type-script-helper/media/lowres-LOGO_Black.png.png differ diff --git a/type-script-helper/package.json b/type-script-helper/package.json index e3ec071..afab92d 100644 --- a/type-script-helper/package.json +++ b/type-script-helper/package.json @@ -253,6 +253,26 @@ "title": "Webview Example" } ], + "views": { + "view-command-pallete-webview-view-provider-view": [ + { + "contextualTitle": "Infineon Technologies Americas Corp.", + "icon": "media/lowres-LOGO_Black.png.png", + "id": "view-command-pallete-webview-view-provider", + "name": "Infineon", + "type": "webview" + } + ] + }, + "viewsContainers": { + "activitybar": [ + { + "icon": "media/lowres-LOGO_Black.png.png", + "id": "view-command-pallete-webview-view-provider-view", + "title": "Infineon Technologies Americas Corp." + } + ] + }, "configuration": { "properties": { "fileTemplates.author": { @@ -333,5 +353,5 @@ "watch": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\"", "webpack": "webpack --config ./build/node-extension.webpack.config.js" }, - "version": "1.119.0" + "version": "1.120.0" } \ No newline at end of file diff --git a/type-script-helper/src/ViewCommandPalleteWebviewViewProvider.ts b/type-script-helper/src/ViewCommandPalleteWebviewViewProvider.ts new file mode 100644 index 0000000..2d8a690 --- /dev/null +++ b/type-script-helper/src/ViewCommandPalleteWebviewViewProvider.ts @@ -0,0 +1,65 @@ +import * as vscode from "vscode"; +import { getNonce } from "./getNonce"; + +export class ViewCommandPalleteWebviewViewProvider implements vscode.WebviewViewProvider { + _webviewView?: vscode.WebviewView; + + constructor(private readonly _extensionContext: vscode.ExtensionContext) { + } + + public revive(webviewView: vscode.WebviewView) { + this._webviewView = webviewView; + } + + public resolveWebviewView(webviewView: vscode.WebviewView) { + this._webviewView = webviewView; + webviewView.webview.options = { + // Allow scripts in the webview + enableScripts: true, + + localResourceRoots: [this._extensionContext.extensionUri], + }; + + webviewView.webview.html = this._getHtmlForWebview(webviewView.webview); + } + + private _getHtmlForWebview(webview: vscode.Webview) { + + const imageA = webview.asWebviewUri( + vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "Screenshot 2025-04-11 125031.png") + ); + const imageB = webview.asWebviewUri( + vscode.Uri.joinPath(this._extensionContext.extensionUri, "media", "Screenshot 2025-04-11 125350.png") + ); + + // Use a nonce to only allow a specific script to be run. + const nonce = getNonce(); + + return ` + +
+ + + + + + +