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 ` + + + + + + + + +

Infineon Technologies Americas Corp.

+ + Screenshot 2025-04-11 125031.png + Screenshot 2025-04-11 125350 + + `; + } +} diff --git a/type-script-helper/src/extension.ts b/type-script-helper/src/extension.ts index 6cb06e5..11e8295 100644 --- a/type-script-helper/src/extension.ts +++ b/type-script-helper/src/extension.ts @@ -11,19 +11,14 @@ import * as replaceLinesHelper from './replaceLinesHelper'; import * as readOnlyLinesHelper from './readOnlyLinesHelper'; import * as WebviewPanelExample from './WebviewPanelExample'; import * as WebviewPanelCostOfDelay from './WebviewPanelCostOfDelay'; -import * as ColumnsToCardsWebviewViewProvider from './ColumnsToCardsWebviewViewProvider'; +import { ViewCommandPalleteWebviewViewProvider } from "./ViewCommandPalleteWebviewViewProvider"; // This method is called when your extension is activated // Your extension is activated the very first time the command is executed export async function activate(extensionContext: vscode.ExtensionContext) { - const columnsToCardsWebviewViewProvider = new ColumnsToCardsWebviewViewProvider.ColumnsToCardsWebviewViewProvider(extensionContext); - - const item = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right); - item.text = "$(beaker) Show Kanban"; - // item.command = "kanban.show"; - item.show(); - extensionContext.subscriptions.push(vscode.window.registerWebviewViewProvider("columns-to-cards-webview-view-provider", columnsToCardsWebviewViewProvider)); + const viewCommandPalleteWebviewViewProvider = new ViewCommandPalleteWebviewViewProvider(extensionContext); + extensionContext.subscriptions.push(vscode.window.registerWebviewViewProvider("view-command-pallete-webview-view-provider", viewCommandPalleteWebviewViewProvider)); const config = vscode.workspace.getConfiguration('calc'); const outputChannel = vscode.window.createOutputChannel('calc'); @@ -49,6 +44,30 @@ export async function activate(extensionContext: vscode.ExtensionContext) { }), ); + function getWebviewView(title: string) { + const column = vscode.window.activeTextEditor + ? vscode.window.activeTextEditor.viewColumn + : undefined; + + // Otherwise, create a new panel. + const webviewView = vscode.window.createWebviewPanel( + "web-view-panel", + title, + column || vscode.ViewColumn.One, + { + // Enable javascript in the webview + enableScripts: true, + + // And restrict the webview to only loading content from our extension's `media` directory. + localResourceRoots: [ + vscode.Uri.joinPath(extensionContext.extensionUri, "media"), + vscode.Uri.joinPath(extensionContext.extensionUri, "out/compiled"), + ], + } + ); + return webviewView; + } + async function replaceResultsWithPositions( editor: vscode.TextEditor, positionsAndExpressions: [vscode.Position, string][], @@ -130,8 +149,6 @@ export async function activate(extensionContext: vscode.ExtensionContext) { const commands = [ vscode.commands.registerCommand("copyHelper.copySyntaxInLight", copyHelper.copySyntaxInLight), vscode.commands.registerCommand("extension.rotateExplorerSortOrder", settingsHelper.rotateExplorerSortOrder), - vscode.commands.registerCommand("kanban.refreshBoth", () => { kanbanHelper.refreshBoth(extensionContext); }), - vscode.commands.registerCommand("kanban.refreshSidebar", ColumnsToCardsWebviewViewProvider.refreshSidebar), vscode.commands.registerCommand("kanban.openWithTextEditor", kanbanHelper.openWithTextEditor), vscode.commands.registerCommand("kanban.openInNewWindow", kanbanHelper.openInNewWindow), vscode.commands.registerCommand("markdown.newMarkdownFile", markdownHelper.newMarkdownFile),