Skip to content

Commit 674040d

Browse files
committed
version 0.1.2
1 parent 9830f7f commit 674040d

File tree

6 files changed

+14
-5
lines changed

6 files changed

+14
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ The showcase of the plugin can be found in [the dedicated SiYuan community post]
4141

4242
## Changelog
4343

44+
+ v0.1.2
45+
+ Fix: Avoid changing configuration in publish mode
46+
+ Optimize: Change view properties
4447
+ v0.1.1
4548
+ Fix: SiYuan version requirements
4649
+ Optimize: i18n

README_zh_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
## 更新日志
4343

44+
+ v0.1.2
45+
+ 修复缺陷:避免发布模式下更改配置
46+
+ 优化:更改视图属性
4447
+ v0.1.1
4548
+ 修复缺陷:思源最低版本要求
4649
+ 优化:i18n

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "siyuan-embed-interactiveSVG",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"type": "module",
55
"description": "This is a plugin for siyuan",
66
"author": "",

plugin.json

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

src/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default class InteractiveSVGPlugin extends Plugin {
5050
this.initSetting();
5151

5252
this._addImageBlockMutationObserver = this.setAddImageBlockMuatationObserver(document.body, (blockElement: HTMLElement) => {
53-
if (this.data[STORAGE_NAME].interactiveSVGMode === "auto" || blockElement.getAttribute("custom-view") === "interactiveSVG") {
53+
if (this.data[STORAGE_NAME].interactiveSVGMode === "auto" || blockElement.getAttribute("custom-embed-view") === "interactiveSVG") {
5454
this.switchInteractiveSVGView("on", blockElement);
5555
}
5656
});
@@ -84,6 +84,8 @@ export default class InteractiveSVGPlugin extends Plugin {
8484
}
8585

8686
openSetting() {
87+
if (window.siyuan.config.readonly) return;
88+
8789
const dialogHTML = `
8890
<div class="b3-dialog__content"></div>
8991
<div class="b3-dialog__action">
@@ -200,12 +202,12 @@ export default class InteractiveSVGPlugin extends Plugin {
200202

201203
public updateInteractiveSVGViewAttribute(blockID: string, view: string) {
202204
document.querySelectorAll(`div[data-type="NodeParagraph"][data-node-id="${blockID}"]`).forEach((blockElement: HTMLElement) => {
203-
blockElement.setAttribute("custom-view", view);
205+
blockElement.setAttribute("custom-embed-view", view);
204206
});
205207
fetchPost("/api/attr/setBlockAttrs", {
206208
id: blockID,
207209
attrs: {
208-
"custom-view": view,
210+
"custom-embed-view": view,
209211
}
210212
});
211213
}

src/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ interface Window {
129129
};
130130
lang: string;
131131
keymap: any;
132+
readonly: boolean;
132133
}
133134
};
134135
_sy_plugin_sample: {

0 commit comments

Comments
 (0)