-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathplugin.ts
More file actions
34 lines (28 loc) · 1.22 KB
/
plugin.ts
File metadata and controls
34 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { ICommandService, Inject, Injector, Plugin, UniverInstanceType } from '@univerjs/presets'
import { IShortcutService } from '@univerjs/presets/preset-sheets-core'
import { CustomClearSelectionContentCommand } from './commands/commands/custom.command'
import { CustomClearSelectionValueShortcutItem } from './controllers/shortcuts/custom.shortcut'
const SHEET_CUSTOM_SHORTCUT_PLUGIN = 'SHEET_CUSTOM_SHORTCUT_PLUGIN'
export class UniverSheetsCustomShortcutPlugin extends Plugin {
static override type = UniverInstanceType.UNIVER_SHEET
static override pluginName = SHEET_CUSTOM_SHORTCUT_PLUGIN
constructor(
@Inject(Injector) protected readonly _injector: Injector,
@ICommandService private readonly _commandService: ICommandService,
@IShortcutService private readonly _shortcutService: IShortcutService,
) {
super()
this._initCommands()
this._initShortcuts()
}
private _initCommands() {
[
CustomClearSelectionContentCommand,
].forEach(command => this.disposeWithMe(this._commandService.registerCommand(command)))
}
private _initShortcuts() {
[
CustomClearSelectionValueShortcutItem,
].forEach(item => this.disposeWithMe(this._shortcutService.registerShortcut(item)))
}
}