Skip to content

Commit d2f2f13

Browse files
authored
Fix inline style (#89)
Closes #69.
1 parent 4e9174a commit d2f2f13

File tree

8 files changed

+1341
-959
lines changed

8 files changed

+1341
-959
lines changed

.mocharc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extension": ["ts"],
33
"require": "ts-node/register",
4+
"loader": "ts-node/esm",
45
"spec": ["projects/*/tests/**/*.ts"],
56
"watch-files": ["."]
67
}

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
23

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
## [Unreleased]
66

7+
## [1.7.5] - 2025-03-08
8+
9+
### Fixed
10+
11+
- Fixes inline style (again). (#69)
12+
713
## [1.7.4] - 2024-10-02
814

915
### Fixed
@@ -203,7 +209,8 @@
203209

204210
- Initial release.
205211

206-
[Unreleased]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.4...master
212+
[Unreleased]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.5...master
213+
[1.7.5]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.4...1.7.5
207214
[1.7.4]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.3...1.7.4
208215
[1.7.3]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.2...1.7.3
209216
[1.7.2]: https://github.com/EFanZh/Graphviz-Preview/compare/1.7.1...1.7.2

package-lock.json

Lines changed: 1315 additions & 950 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphviz-preview",
3-
"version": "1.7.4",
3+
"version": "1.7.5",
44
"publisher": "EFanZh",
55
"engines": {
66
"vscode": "^1.93.0"
@@ -96,13 +96,13 @@
9696
"@types/mocha": "10",
9797
"@types/vscode": "1",
9898
"@types/vscode-webview": "1",
99-
"mocha": "10",
99+
"mocha": "11",
100100
"nyc": "17",
101101
"prettier": "3",
102102
"ts-loader": "9",
103103
"ts-node": "10",
104104
"typescript-eslint": "8",
105-
"webpack-cli": "5"
105+
"webpack-cli": "6"
106106
},
107107
"scripts": {
108108
"check-format": "prettier -c .",

projects/extension/src/preview-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function setWebviewHtml(context: Context, document: TextDocument, webview: Webvi
2525
const baseUri = webview.asWebviewUri(document.uri).toString();
2626
const cspSource = webview.cspSource;
2727
const nonce = crypto.randomBytes(32).toString("base64");
28-
const csp = `default-src 'none'; img-src ${cspSource}; script-src ${cspSource}; style-src ${cspSource} 'nonce-${nonce}';`;
28+
const csp = `default-src 'none'; img-src ${cspSource}; script-src ${cspSource}; style-src ${cspSource} 'nonce-${nonce}'; style-src-attr 'unsafe-inline';`;
2929
const extensionUri = webview.asWebviewUri(context.extensionContext.extensionUri).toString();
3030

3131
webview.html = context.webviewTemplate.replace(webviewPlaceholder, (fallback, key) => {

projects/webview/tests/layout-state-tests.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,16 @@ class Controller {
179179

180180
assert.deepStrictEqual(this.view, checkView);
181181

182-
return { ...this.view };
182+
return {
183+
isCenter: this.view.isCenter,
184+
isIdentity: this.view.isIdentity,
185+
scaleMode: this.view.scaleMode,
186+
imageX: this.view.imageX,
187+
imageY: this.view.imageY,
188+
imageDisplayWidth: this.view.imageDisplayWidth,
189+
imageDisplayHeight: this.view.imageDisplayHeight,
190+
imageScale: this.view.imageScale,
191+
};
183192
}
184193
}
185194

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from "path";
44
const baseConfig: Configuration = {
55
mode: "none",
66
output: {
7-
path: path.resolve(__dirname, "dist"),
7+
path: path.join(import.meta.dirname, "dist"),
88
filename: "[name].js",
99
},
1010
module: {
@@ -54,4 +54,4 @@ const webviewConfig: Configuration = {
5454
devtool: "inline-source-map",
5555
};
5656

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

0 commit comments

Comments
 (0)