Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extension": ["ts"],
"require": "ts-node/register",
"loader": "ts-node/esm",
"spec": ["projects/*/tests/**/*.ts"],
"watch-files": ["."]
}
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
23
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

## [Unreleased]

## [1.7.5] - 2025-03-08

### Fixed

- Fixes inline style (again). (#69)

## [1.7.4] - 2024-10-02

### Fixed
Expand Down Expand Up @@ -203,7 +209,8 @@

- Initial release.

[Unreleased]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.4...master
[Unreleased]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.5...master
[1.7.5]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.4...1.7.5
[1.7.4]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.3...1.7.4
[1.7.3]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.2...1.7.3
[1.7.2]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.1...1.7.2
Expand Down
2,265 changes: 1,315 additions & 950 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphviz-preview",
"version": "1.7.4",
"version": "1.7.5",
"publisher": "EFanZh",
"engines": {
"vscode": "^1.93.0"
Expand Down Expand Up @@ -96,13 +96,13 @@
"@types/mocha": "10",
"@types/vscode": "1",
"@types/vscode-webview": "1",
"mocha": "10",
"mocha": "11",
"nyc": "17",
"prettier": "3",
"ts-loader": "9",
"ts-node": "10",
"typescript-eslint": "8",
"webpack-cli": "5"
"webpack-cli": "6"
},
"scripts": {
"check-format": "prettier -c .",
Expand Down
2 changes: 1 addition & 1 deletion projects/extension/src/preview-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function setWebviewHtml(context: Context, document: TextDocument, webview: Webvi
const baseUri = webview.asWebviewUri(document.uri).toString();
const cspSource = webview.cspSource;
const nonce = crypto.randomBytes(32).toString("base64");
const csp = `default-src 'none'; img-src ${cspSource}; script-src ${cspSource}; style-src ${cspSource} 'nonce-${nonce}';`;
const csp = `default-src 'none'; img-src ${cspSource}; script-src ${cspSource}; style-src ${cspSource} 'nonce-${nonce}'; style-src-attr 'unsafe-inline';`;
const extensionUri = webview.asWebviewUri(context.extensionContext.extensionUri).toString();

webview.html = context.webviewTemplate.replace(webviewPlaceholder, (fallback, key) => {
Expand Down
11 changes: 10 additions & 1 deletion projects/webview/tests/layout-state-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,16 @@ class Controller {

assert.deepStrictEqual(this.view, checkView);

return { ...this.view };
return {
isCenter: this.view.isCenter,
isIdentity: this.view.isIdentity,
scaleMode: this.view.scaleMode,
imageX: this.view.imageX,
imageY: this.view.imageY,
imageDisplayWidth: this.view.imageDisplayWidth,
imageDisplayHeight: this.view.imageDisplayHeight,
imageScale: this.view.imageScale,
};
}
}

Expand Down
4 changes: 2 additions & 2 deletions webpack.config.ts → webpack.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from "path";
const baseConfig: Configuration = {
mode: "none",
output: {
path: path.resolve(__dirname, "dist"),
path: path.join(import.meta.dirname, "dist"),
filename: "[name].js",
},
module: {
Expand Down Expand Up @@ -54,4 +54,4 @@ const webviewConfig: Configuration = {
devtool: "inline-source-map",
};

module.exports = [extensionConfig, webviewConfig];
export default [extensionConfig, webviewConfig];