File tree Expand file tree Collapse file tree 5 files changed +4
-47
lines changed Expand file tree Collapse file tree 5 files changed +4
-47
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ export enum ButtonActionType {
15
15
INPUT = 'input' ,
16
16
SLEEP = 'sleep' ,
17
17
TEMPLATER_CREATE_NOTE = 'templaterCreateNote' ,
18
- QUICK_SWITCHER = 'quickSwitcher' ,
19
18
}
20
19
21
20
export interface CommandButtonAction {
@@ -96,26 +95,13 @@ export const TemplaterCreateNoteButtonActionValidator = schemaForType<TemplaterC
96
95
} ) ,
97
96
) ;
98
97
99
- export interface QuickSwitcherButtonAction {
100
- type : ButtonActionType . QUICK_SWITCHER ;
101
- filter : string ;
102
- }
103
-
104
- export const QuickSwitcherButtonActionValidator = schemaForType < QuickSwitcherButtonAction > ( ) (
105
- z . object ( {
106
- type : z . literal ( ButtonActionType . QUICK_SWITCHER ) ,
107
- filter : z . string ( ) ,
108
- } ) ,
109
- ) ;
110
-
111
98
export type ButtonAction =
112
99
| CommandButtonAction
113
100
| JSButtonAction
114
101
| OpenButtonAction
115
102
| InputButtonAction
116
103
| SleepButtonAction
117
- | TemplaterCreateNoteButtonAction
118
- | QuickSwitcherButtonAction ;
104
+ | TemplaterCreateNoteButtonAction ;
119
105
120
106
export const ButtonActionValidator = schemaForType < ButtonAction > ( ) (
121
107
z . union ( [
@@ -125,7 +111,6 @@ export const ButtonActionValidator = schemaForType<ButtonAction>()(
125
111
InputButtonActionValidator ,
126
112
SleepButtonActionValidator ,
127
113
TemplaterCreateNoteButtonActionValidator ,
128
- QuickSwitcherButtonActionValidator ,
129
114
] ) ,
130
115
) ;
131
116
Original file line number Diff line number Diff line change 72
72
<p >
73
73
When creating <a href ={DocsUtils .linkToInputFields ()}>Input Fields</a > or
74
74
<a href ={DocsUtils .linkToViewFields ()}>View Fields</a >
75
- <strong >warnings</strong >
76
- (
75
+ <strong >warnings</strong > (
77
76
<ErrorIndicatorComponent
78
77
app ={app }
79
78
declaration ={exampleWarningDeclaration }
80
79
errorCollection ={exampleWarningErrorCollection }
81
80
></ErrorIndicatorComponent >
82
- ) and <strong >errors</strong >
83
- (
81
+ ) and <strong >errors</strong > (
84
82
<ErrorIndicatorComponent
85
83
app ={app }
86
84
declaration ={exampleErrorDeclaration }
Original file line number Diff line number Diff line change 5
5
type InputButtonAction ,
6
6
type JSButtonAction ,
7
7
type OpenButtonAction ,
8
- type QuickSwitcherButtonAction ,
9
8
type SleepButtonAction ,
10
9
type TemplaterCreateNoteButtonAction ,
11
10
} from '../../config/ButtonConfig' ;
@@ -39,11 +38,6 @@ export class ButtonActionRunner {
39
38
fileName : '' ,
40
39
openNote : true ,
41
40
} satisfies TemplaterCreateNoteButtonAction ;
42
- } else if ( type === ButtonActionType . QUICK_SWITCHER ) {
43
- return {
44
- type : ButtonActionType . QUICK_SWITCHER ,
45
- filter : '' ,
46
- } satisfies QuickSwitcherButtonAction ;
47
41
}
48
42
49
43
throw new Error ( `Unknown button action type: ${ type } ` ) ;
@@ -68,9 +62,6 @@ export class ButtonActionRunner {
68
62
} else if ( action . type === ButtonActionType . TEMPLATER_CREATE_NOTE ) {
69
63
await this . runTemplaterCreateNoteAction ( action ) ;
70
64
return ;
71
- } else if ( action . type === ButtonActionType . QUICK_SWITCHER ) {
72
- await this . runQuickSwitcherAction ( action ) ;
73
- return ;
74
65
}
75
66
76
67
throw new Error ( `Unknown button action type` ) ;
@@ -110,8 +101,4 @@ export class ButtonActionRunner {
110
101
async runTemplaterCreateNoteAction ( _action : TemplaterCreateNoteButtonAction ) : Promise < void > {
111
102
throw new Error ( 'Not supported' ) ;
112
103
}
113
-
114
- async runQuickSwitcherAction ( _action : QuickSwitcherButtonAction ) : Promise < void > {
115
- throw new Error ( 'Not supported' ) ;
116
- }
117
104
}
Original file line number Diff line number Diff line change 92
92
return ' Sleep for Some Time' ;
93
93
} else if (actionType === ButtonActionType .TEMPLATER_CREATE_NOTE ) {
94
94
return ' Create a New Note Using Templater' ;
95
- } else if (actionType === ButtonActionType .QUICK_SWITCHER ) {
96
- return ' Open the Quick Switcher' ;
97
95
}
98
96
99
97
return ' CHANGE ME' ;
@@ -219,15 +217,6 @@ Add action of type
219
217
<Toggle bind:checked ={action .openNote }></Toggle >
220
218
</SettingComponent >
221
219
{/if }
222
-
223
- {#if action .type === ButtonActionType .QUICK_SWITCHER }
224
- <p >
225
- Not Implemented Yet
226
- <Button variant ="destructive" on:click ={() => removeAction (i )}>
227
- <Icon iconName =" x" ></Icon >
228
- </Button >
229
- </p >
230
- {/if }
231
220
{/each }
232
221
233
222
<h4 >Preview</h4 >
Original file line number Diff line number Diff line change 1
1
import { ButtonActionRunner } from './ButtonActionRunner' ;
2
- import { type QuickSwitcherButtonAction , type TemplaterCreateNoteButtonAction } from '../../config/ButtonConfig' ;
2
+ import { type TemplaterCreateNoteButtonAction } from '../../config/ButtonConfig' ;
3
3
import { TFile , TFolder } from 'obsidian' ;
4
4
import type MetaBindPlugin from '../../main' ;
5
5
@@ -53,6 +53,4 @@ export class ObsidianButtonActionRunner extends ButtonActionRunner {
53
53
) ;
54
54
}
55
55
}
56
-
57
- public async runQuickSwitcherAction ( _action : QuickSwitcherButtonAction ) : Promise < void > { }
58
56
}
You can’t perform that action at this time.
0 commit comments