File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,35 +61,6 @@ export const createModifyNodeModalSubmitHandler = (
6161} ;
6262
6363export const registerCommands = ( plugin : DiscourseGraphPlugin ) => {
64- plugin . addCommand ( {
65- id : "open-node-type-menu" ,
66- name : "Open node type menu" ,
67- editorCallback : ( editor : Editor ) => {
68- const hasSelection = ! ! editor . getSelection ( ) ;
69-
70- if ( hasSelection ) {
71- new NodeTypeModal ( plugin , ( nodeType : DiscourseNode ) => {
72- void createDiscourseNode ( {
73- plugin,
74- editor,
75- nodeType,
76- text : editor . getSelection ( ) . trim ( ) || "" ,
77- } ) ;
78- } ) . open ( ) ;
79- } else {
80- const currentFile =
81- plugin . app . workspace . getActiveViewOfType ( MarkdownView ) ?. file ||
82- undefined ;
83- new ModifyNodeModal ( plugin . app , {
84- nodeTypes : plugin . settings . nodeTypes ,
85- plugin,
86- currentFile,
87- onSubmit : createModifyNodeModalSubmitHandler ( plugin , editor ) ,
88- } ) . open ( ) ;
89- }
90- } ,
91- } ) ;
92-
9364 plugin . addCommand ( {
9465 id : "create-discourse-node" ,
9566 name : "Create discourse node" ,
You can’t perform that action at this time.
0 commit comments