diff --git a/docs/third-party-licenses.json b/docs/third-party-licenses.json index 1701814d..503d61b7 100644 --- a/docs/third-party-licenses.json +++ b/docs/third-party-licenses.json @@ -27,13 +27,6 @@ "url": "https://github.com/microsoft/vscode-codicons", "license": "https://github.com/microsoft/vscode-codicons/blob/main/LICENSE" }, - { - "name": "@vscode/webview-ui-toolkit", - "version": "1.4.0", - "spdx": "MIT", - "url": "https://github.com/microsoft/vscode-webview-ui-toolkit", - "license": "https://github.com/microsoft/vscode-webview-ui-toolkit/blob/main/LICENSE" - }, { "name": "async-mutex", "version": "0.5.0", diff --git a/package-lock.json b/package-lock.json index 58b862c4..36902ea3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "@lydell/node-pty": "^1.1.0", "@microsoft/vscode-serial-monitor-api": "^0.1.7", "@vscode/codicons": "^0.0.44", - "@vscode/webview-ui-toolkit": "^1.4.0", "antd": "^5.29.3", "async-mutex": "^0.5.0", "eta": "^4.5.1", @@ -5138,47 +5137,6 @@ "win32" ] }, - "node_modules/@microsoft/fast-element": { - "version": "1.14.0", - "integrity": "sha512-zXvuSOzvsu8zDTy9eby8ix8VqLop2rwKRgp++ZN2kTCsoB3+QJVoaGD2T/Cyso2ViZQFXNpiNCVKfnmxBvmWkQ==", - "license": "MIT" - }, - "node_modules/@microsoft/fast-foundation": { - "version": "2.50.0", - "integrity": "sha512-8mFYG88Xea1jZf2TI9Lm/jzZ6RWR8x29r24mGuLojNYqIR2Bl8+hnswoV6laApKdCbGMPKnsAL/O68Q0sRxeVg==", - "license": "MIT", - "dependencies": { - "@microsoft/fast-element": "^1.14.0", - "@microsoft/fast-web-utilities": "^5.4.1", - "tabbable": "^5.2.0", - "tslib": "^1.13.0" - } - }, - "node_modules/@microsoft/fast-foundation/node_modules/tslib": { - "version": "1.14.1", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "license": "0BSD" - }, - "node_modules/@microsoft/fast-react-wrapper": { - "version": "0.3.25", - "integrity": "sha512-jKzmk2xJV93RL/jEFXEZgBvXlKIY4N4kXy3qrjmBfFpqNi3VjY+oUTWyMnHRMC5EUhIFxD+Y1VD4u9uIPX3jQw==", - "license": "MIT", - "dependencies": { - "@microsoft/fast-element": "^1.14.0", - "@microsoft/fast-foundation": "^2.50.0" - }, - "peerDependencies": { - "react": ">=16.9.0" - } - }, - "node_modules/@microsoft/fast-web-utilities": { - "version": "5.4.1", - "integrity": "sha512-ReWYncndjV3c8D8iq9tp7NcFNc1vbVHvcBFPME2nNFKNbS1XCesYZGlIlf3ot5EmuOXPlrzUHOWzQ2vFpIkqDg==", - "license": "MIT", - "dependencies": { - "exenv-es6": "^1.1.1" - } - }, "node_modules/@microsoft/vscode-serial-monitor-api": { "version": "0.1.7", "integrity": "sha512-ROmxRIryoE1ZKAcrO3xS9NaUcLimihjT63b6Sh3YEQ4qZ6zC5QwysP6zUDM6W0jalQxoJuDH0hac4A8TTl5quQ==", @@ -7191,21 +7149,6 @@ "concat-map": "0.0.1" } }, - "node_modules/@vscode/webview-ui-toolkit": { - "version": "1.4.0", - "integrity": "sha512-modXVHQkZLsxgmd5yoP3ptRC/G8NBDD+ob+ngPiWNQdlrH6H1xR/qgOBD85bfU3BhOB5sZzFWBwwhp9/SfoHww==", - "deprecated": "This package has been deprecated, https://github.com/microsoft/vscode-webview-ui-toolkit/issues/561", - "license": "MIT", - "dependencies": { - "@microsoft/fast-element": "^1.12.0", - "@microsoft/fast-foundation": "^2.49.4", - "@microsoft/fast-react-wrapper": "^0.3.22", - "tslib": "^2.6.2" - }, - "peerDependencies": { - "react": ">=16.9.0" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", @@ -10998,11 +10941,6 @@ "dev": true, "license": "ISC" }, - "node_modules/exenv-es6": { - "version": "1.1.1", - "integrity": "sha512-vlVu3N8d6yEMpMsEm+7sUBAI81aqYYuEvfK0jNqmdb/OPXzzH7QWDDnVjMvDSY47JdHEqx/dfC/q8WkfoTmpGQ==", - "license": "MIT" - }, "node_modules/exit": { "version": "0.1.2", "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", @@ -21074,11 +21012,6 @@ "node": ">=18" } }, - "node_modules/tabbable": { - "version": "5.3.3", - "integrity": "sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA==", - "license": "MIT" - }, "node_modules/table": { "version": "6.9.0", "integrity": "sha512-9kY+CygyYM6j02t5YFHbNz2FN5QmYGv9zAjVp4lCDjlCw7amdckXlEt/bjMhUIfj4ThGRE4gCUH5+yGnNuPo5A==", diff --git a/package.json b/package.json index 7d389cb7..c3cce2b4 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,6 @@ "@lydell/node-pty": "^1.1.0", "@microsoft/vscode-serial-monitor-api": "^0.1.7", "@vscode/codicons": "^0.0.44", - "@vscode/webview-ui-toolkit": "^1.4.0", "antd": "^5.29.3", "async-mutex": "^0.5.0", "eta": "^4.5.1", @@ -1553,7 +1552,7 @@ ] }, "transformIgnorePatterns": [ - "/node_modules/(?!(@vscode/webview-ui-toolkit|@microsoft|exenv-es6|yaml)/)" + "/node_modules/(?!(@microsoft|yaml)/)" ], "testPathIgnorePatterns": [ "/node_modules/", diff --git a/src/views/common/components/compact-dropdown.tsx b/src/views/common/components/compact-dropdown.tsx index 91529847..f13ddb81 100644 --- a/src/views/common/components/compact-dropdown.tsx +++ b/src/views/common/components/compact-dropdown.tsx @@ -115,7 +115,7 @@ export const CompactDropdown = (props: CompactDropdownProps) => {
{props.addonBefore &&
{props.addonBefore}
} -
+
{props.displayText ? props.displayText(props.selected) : props.selected || props.unselectedLabel} {props.tag} {props.warning && } {props.available.length > 1 && } diff --git a/src/views/common/components/file-path-picker.test.tsx b/src/views/common/components/file-path-picker.test.tsx index 01028250..065fbb25 100644 --- a/src/views/common/components/file-path-picker.test.tsx +++ b/src/views/common/components/file-path-picker.test.tsx @@ -45,12 +45,15 @@ describe('FileLocationPicker', () => { openFilePicker={mockOpenFilePicker} />); }); - const browseBtn = container.querySelector('.file-location-picker vscode-button') as HTMLButtonElement; + const browseBtn = container.querySelector('.file-location-picker button') as HTMLButtonElement; expect(mockOpenFilePicker).toHaveBeenCalledTimes(0); React.act(() => { - browseBtn!.click(); + if (!browseBtn) { + throw new Error('Browse button not found. Check the selector or component rendering.'); + } + browseBtn.click(); }); expect(mockOpenFilePicker).toHaveBeenCalledTimes(1); @@ -76,6 +79,6 @@ describe('FileLocationPicker', () => { simulateChangeEvent(inputBox, 'my-location'); expect(dispatch).toHaveBeenCalledTimes(1); - expect(dispatch).toHaveBeenCalledWith({ type: 'SET_SOLUTION_LOCATION' , solutionLocation: 'my-location' }); + expect(dispatch).toHaveBeenCalledWith({ type: 'SET_SOLUTION_LOCATION', solutionLocation: 'my-location' }); }); }); diff --git a/src/views/common/components/file-path-picker.tsx b/src/views/common/components/file-path-picker.tsx index 8cfb749b..13aa4d13 100644 --- a/src/views/common/components/file-path-picker.tsx +++ b/src/views/common/components/file-path-picker.tsx @@ -16,8 +16,8 @@ import './file-path-picker.css'; import * as React from 'react'; -import { VSCodeButton } from '@vscode/webview-ui-toolkit/react'; import { CreateSolutionAction } from '../../create-solutions/view/state/reducer'; +import { Button } from 'antd'; export interface FileLocationPickerProps { disabled: boolean; @@ -41,12 +41,13 @@ export const FileLocationPicker = ({ id, disabled, location, dispatch, openFileP })} value={location} disabled={disabled} /> - openFilePicker()} > Browse - +
); diff --git a/src/views/config-wizard/confwiz-webview-main.ts b/src/views/config-wizard/confwiz-webview-main.ts index 8495b6c8..aa79ecec 100644 --- a/src/views/config-wizard/confwiz-webview-main.ts +++ b/src/views/config-wizard/confwiz-webview-main.ts @@ -152,13 +152,6 @@ export class ConfWizWebview implements vscode.CustomTextEditorProvider { } protected _getWebviewContent(webview: vscode.Webview, extensionUri: vscode.Uri): string { - const toolkitUri = webview.asWebviewUri(vscode.Uri.joinPath( - extensionUri, - 'dist', - 'views', - 'toolkit.min.js' - )); - const mainUri = webview.asWebviewUri(vscode.Uri.joinPath( extensionUri, 'dist', @@ -194,7 +187,6 @@ export class ConfWizWebview implements vscode.CustomTextEditorProvider { - diff --git a/src/views/config-wizard/confwiz-webview-view-component.test.tsx b/src/views/config-wizard/confwiz-webview-view-component.test.tsx index 7d6b344c..5b1b022e 100644 --- a/src/views/config-wizard/confwiz-webview-view-component.test.tsx +++ b/src/views/config-wizard/confwiz-webview-view-component.test.tsx @@ -29,6 +29,12 @@ import { const sendNotificationMock = jest.fn(); const notificationHandlers = new Map void>(); +const mockVsCodeApi = { + postMessage: jest.fn(), + setState: jest.fn(), + getState: jest.fn(), +}; +const acquireVsCodeApiMock = jest.fn(() => mockVsCodeApi); const getNotificationKey = (type: unknown): string => { if (typeof type === 'string') { @@ -42,13 +48,6 @@ const getNotificationKey = (type: unknown): string => { return String(type); }; -// Mock acquireVsCodeApi -global.acquireVsCodeApi = jest.fn(() => ({ - postMessage: jest.fn(), - setState: jest.fn(), - getState: jest.fn(), -})); - jest.mock('vscode-messenger-webview', () => ({ Messenger: jest.fn().mockImplementation(() => ({ start: jest.fn(), @@ -59,22 +58,11 @@ jest.mock('vscode-messenger-webview', () => ({ })) })); -jest.mock('@vscode/webview-ui-toolkit/react', () => ({ - VSCodeTextField: ({ children: _children, ...props }: React.InputHTMLAttributes) => ( - - ), - VSCodeCheckbox: ({ onChange, onClick, ...props }: React.InputHTMLAttributes) => ( - undefined)} onClick={onClick} {...props} /> - ), - VSCodeDropdown: (props: React.SelectHTMLAttributes) =>