@@ -18,7 +18,7 @@ import {
18
18
lockScreen ,
19
19
ICard ,
20
20
ICardData ,
21
- Custom , exitSiYuan , getModelByDockType , getAllEditor , Files , platformUtils , openSetting
21
+ Custom , exitSiYuan , getModelByDockType , getAllEditor , Files , platformUtils , openSetting , openAttributePanel
22
22
} from "siyuan" ;
23
23
import "./index.scss" ;
24
24
import { IMenuItem } from "siyuan/types" ;
@@ -366,11 +366,21 @@ export default class PluginSample extends Plugin {
366
366
menu . addItem ( {
367
367
icon : "iconSettings" ,
368
368
label : "Open Setting" ,
369
- accelerator : this . commands [ 0 ] . customHotkey ,
370
369
click : ( ) => {
371
370
openSetting ( this . app ) ;
372
371
}
373
372
} ) ;
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
+ } ) ;
374
384
menu . addItem ( {
375
385
icon : "iconInfo" ,
376
386
label : "Dialog(open doc first)" ,
@@ -382,7 +392,6 @@ export default class PluginSample extends Plugin {
382
392
menu . addItem ( {
383
393
icon : "iconFocus" ,
384
394
label : "Select Opened Doc(open doc first)" ,
385
- accelerator : this . commands [ 0 ] . customHotkey ,
386
395
click : ( ) => {
387
396
( getModelByDockType ( "file" ) as Files ) . selectItem ( this . getEditor ( ) . protyle . notebookId , this . getEditor ( ) . protyle . path ) ;
388
397
}
@@ -463,9 +472,10 @@ export default class PluginSample extends Plugin {
463
472
label : "Open Float Layer(open doc first)" ,
464
473
click : ( ) => {
465
474
this . addFloatLayer ( {
466
- ids : [ this . getEditor ( ) . protyle . block . rootID ] ,
475
+ refDefs : [ { refID : this . getEditor ( ) . protyle . block . rootID } ] ,
467
476
x : window . innerWidth - 768 - 120 ,
468
- y : 32
477
+ y : 32 ,
478
+ isBacklink : false
469
479
} ) ;
470
480
}
471
481
} ) ;
0 commit comments