Skip to content

Commit 07d4ee9

Browse files
committed
version 0.7.3
1 parent c358864 commit 07d4ee9

File tree

7 files changed

+23
-41
lines changed

7 files changed

+23
-41
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
> **Notice!!!**
2020
>
21-
> 1. For improved document loading speed, this plugin only recognizes images starting with `drawio-` as valid draw.io images. If you encounter issues with your existing draw.io images not displaying the edit button, please rename your images to start with `drawio-`.
22-
>
23-
> 2. SiYuan 3.5.4 and above requires the `Settings > Editor > Allow execution of scripts inside SVG` option to be enabled to avoid SVG display errors.
21+
> For improved document loading speed, this plugin only recognizes images starting with `drawio-` as valid draw.io images. If you encounter issues with your existing draw.io images not displaying the edit button, please rename your images to start with `drawio-`.
22+
2423

2524
## Embed Series
2625

@@ -88,6 +87,9 @@ The label of a draw.io image block can be configured in the plugin settings.
8887

8988
## Changelog
9089

90+
+ v0.7.3
91+
+ Update: update draw.io to v29.6.10
92+
+ Optimize: Remove availability check, start the plugin to automatically check and fix
9193
+ v0.7.2
9294
+ Update: update draw.io to v29.6.4
9395
+ Feature: feedback in configuration & check available

README_zh_CN.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
> **注意!!!**
2020
>
21-
> 1. 为提升文档加载速度,本插件只识别以 `drawio-` 开头的图片,如果您发现原有的draw.io图片不显示编辑按钮,请重命名图片为 `drawio-` 开头的文件名。
22-
>
23-
> 2. 思源3.5.4版本之后需开启 `设置 > 编辑器 > 允许执行SVG脚本` 选项以避免SVG显示错误。
21+
> 为提升文档加载速度,本插件只识别以 `drawio-` 开头的图片,如果您发现原有的draw.io图片不显示编辑按钮,请重命名图片为 `drawio-` 开头的文件名。
22+
2423

2524
> 重大更新:v0.7.0版本起支持AI生成
2625
@@ -83,6 +82,9 @@
8382

8483
## 更新日志
8584

85+
+ v0.7.3
86+
+ 更新:更新draw.io到v29.6.10
87+
+ 优化:移除手动可用性检查,启动插件时自动检查并修复
8688
+ v0.7.2
8789
+ 更新:更新draw.io到v29.6.4
8890
+ 新增功能:插件配置页面增加反馈入口 & 可用性检查

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "siyuan-embed-drawio",
3-
"version": "0.7.2",
3+
"version": "0.7.3",
44
"type": "module",
55
"description": "This is a plugin for siyuan",
66
"author": "",
@@ -9,7 +9,7 @@
99
"repository": "",
1010
"scripts": {
1111
"dev": "vite build --watch",
12-
"prepare:draw": "curl -L -o draw.war https://github.com/jgraph/drawio/releases/download/v29.6.4/draw.war --ssl-no-revoke && unzip draw.war -d draw",
12+
"prepare:draw": "curl -L -o draw.war https://github.com/jgraph/drawio/releases/download/v29.6.10/draw.war --ssl-no-revoke && unzip draw.war -d draw",
1313
"release": "node ./release.js",
1414
"release:manual": "node ./release.js --mode=manual",
1515
"release:patch": "node ./release.js --mode=patch",

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "siyuan-embed-drawio",
33
"author": "Yuxin Zhao",
44
"url": "https://github.com/YuxinZhaozyx/siyuan-embed-drawio",
5-
"version": "0.7.2",
5+
"version": "0.7.3",
66
"minAppVersion": "3.0.0",
77
"disabledInPublish": true,
88
"backends": [

src/i18n/en_US.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,5 @@
2424
"addAIProvider": "Add Provider",
2525
"feedbackIssue": "Feedback issues",
2626
"feedbackIssueDescription": "Open plugin's repository page, welcome to click Star to support the author",
27-
"feedbackIssueButton": "Open GitHub",
28-
"systemCheck": "Check Available",
29-
"systemCheckDescription": "Check SiYuan configuration to ensure plugin available<br>Check Items:<br>1. enable \"Settings > Editor > Allow execution of scripts inside SVG\"",
30-
"systemCheckPassed": "Passed",
31-
"systemCheckFailed": "Failed, Click to Fix"
27+
"feedbackIssueButton": "Open GitHub"
3228
}

src/i18n/zh_CN.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,5 @@
2424
"addAIProvider": "添加提供商",
2525
"feedbackIssue": "反馈问题",
2626
"feedbackIssueDescription": "打开插件的仓库页面,欢迎点击 Star 支持作者<br>反馈QQ群:1037356690",
27-
"feedbackIssueButton": "打开 GitHub",
28-
"systemCheck": "可用性检查",
29-
"systemCheckDescription": "检查思源设置以确保插件可用<br>检查项:<br>1. 设置 > 编辑器 > 允许执行SVG脚本 需开启",
30-
"systemCheckPassed": "检查通过",
31-
"systemCheckFailed": "检查未通过,一键修复"
27+
"feedbackIssueButton": "打开 GitHub"
3228
}

src/index.ts

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default class DrawioPlugin extends Plugin {
6767
async onload() {
6868
this.initMetaInfo();
6969
this.initSetting();
70+
this.systemCheckAndFix();
7071

7172
this._mutationObserver = this.setAddImageBlockMuatationObserver(document.body, (blockElement: HTMLElement) => {
7273
const imageElement = blockElement.querySelector("img") as HTMLImageElement;
@@ -390,28 +391,6 @@ export default class DrawioPlugin extends Plugin {
390391
if (typeof this.data[STORAGE_NAME].AISettings === 'undefined') this.data[STORAGE_NAME].AISettings = this.getDefaultAISettings();
391392

392393
this.settingItems = [
393-
{
394-
title: this.i18n.systemCheck,
395-
direction: "column",
396-
description: this.i18n.systemCheckDescription,
397-
createActionElement: () => {
398-
const passedElement = HTMLToElement(`<div class="fn__flex fn__flex-center fn__size200"><div class="fn__flex-1"></div><div>${this.i18n.systemCheckPassed}</div></div>`);
399-
if (!(compare(Constants.SIYUAN_VERSION, '3.5.4', '>=') && !window.siyuan.config.editor.allowSVGScript)) {
400-
return passedElement;
401-
}
402-
403-
const failedElement = HTMLToElement(`<button class="b3-button b3-button--error">${this.i18n.systemCheckFailed}</button>`);
404-
failedElement.addEventListener("click", () => {
405-
window.siyuan.config.editor.allowSVGScript = true;
406-
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, (response) => {
407-
if (response.code === 0) {
408-
failedElement.replaceWith(passedElement);
409-
}
410-
});
411-
});
412-
return failedElement;
413-
},
414-
},
415394
{
416395
title: this.i18n.labelDisplay,
417396
direction: "column",
@@ -1237,4 +1216,11 @@ export default class DrawioPlugin extends Plugin {
12371216
}
12381217
return imageDataURL;
12391218
}
1219+
1220+
public systemCheckAndFix() {
1221+
if (compare(Constants.SIYUAN_VERSION, '3.5.4', '>=') && !window.siyuan.config.editor.allowSVGScript) {
1222+
window.siyuan.config.editor.allowSVGScript = true;
1223+
fetchPost("/api/setting/setEditor", window.siyuan.config.editor);
1224+
}
1225+
}
12401226
}

0 commit comments

Comments
 (0)