Skip to content

Commit 683714a

Browse files
committed
1 parent f5b0a21 commit 683714a

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## v0.4.0 2025-03
44

5+
* [Add plugin function `openAttributePanel`](https://github.com/siyuan-note/siyuan/issues/14276)
6+
57
## v0.3.9 2025-03-04
68

79
* [Add parameter `nodeElement` to `protyleSlash.callback`](https://github.com/siyuan-note/siyuan/issues/14036)

src/index.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
lockScreen,
1919
ICard,
2020
ICardData,
21-
Custom, exitSiYuan, getModelByDockType, getAllEditor, Files, platformUtils, openSetting
21+
Custom, exitSiYuan, getModelByDockType, getAllEditor, Files, platformUtils, openSetting, openAttributePanel
2222
} from "siyuan";
2323
import "./index.scss";
2424
import {IMenuItem} from "siyuan/types";
@@ -366,11 +366,21 @@ export default class PluginSample extends Plugin {
366366
menu.addItem({
367367
icon: "iconSettings",
368368
label: "Open Setting",
369-
accelerator: this.commands[0].customHotkey,
370369
click: () => {
371370
openSetting(this.app);
372371
}
373372
});
373+
menu.addItem({
374+
icon: "iconDrag",
375+
label: "Open Attribute Panel",
376+
click: () => {
377+
openAttributePanel({
378+
nodeElement: this.getEditor().protyle.wysiwyg.element.firstElementChild as HTMLElement,
379+
protyle: this.getEditor().protyle,
380+
focusName: "custom",
381+
});
382+
}
383+
});
374384
menu.addItem({
375385
icon: "iconInfo",
376386
label: "Dialog(open doc first)",
@@ -382,7 +392,6 @@ export default class PluginSample extends Plugin {
382392
menu.addItem({
383393
icon: "iconFocus",
384394
label: "Select Opened Doc(open doc first)",
385-
accelerator: this.commands[0].customHotkey,
386395
click: () => {
387396
(getModelByDockType("file") as Files).selectItem(this.getEditor().protyle.notebookId, this.getEditor().protyle.path);
388397
}
@@ -463,9 +472,10 @@ export default class PluginSample extends Plugin {
463472
label: "Open Float Layer(open doc first)",
464473
click: () => {
465474
this.addFloatLayer({
466-
ids: [this.getEditor().protyle.block.rootID],
475+
refDefs: [{refID: this.getEditor().protyle.block.rootID}],
467476
x: window.innerWidth - 768 - 120,
468-
y: 32
477+
y: 32,
478+
isBacklink: false
469479
});
470480
}
471481
});

0 commit comments

Comments
 (0)