mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 02:12:56 +00:00
feat: add hotkey in workspace plugins
This commit is contained in:
parent
87a4076427
commit
8414425740
@ -317,8 +317,8 @@ function getKeyInfo(combination: string, action?: string): KeyInfo {
|
||||
function fireCallback(callback: IPublicTypeHotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
||||
try {
|
||||
const workspace = globalContext.get('workspace');
|
||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
||||
const designer = editor.get('designer');
|
||||
const editor = workspace.isActive ? workspace.window?.editor : globalContext.get('editor');
|
||||
const designer = editor?.get('designer');
|
||||
const node = designer?.currentSelection?.getNodes()?.[0];
|
||||
const npm = node?.componentMeta?.npm;
|
||||
const selected =
|
||||
|
||||
@ -103,6 +103,7 @@ export class Workspace implements IWorkspace {
|
||||
readonly shellModelFactory: any,
|
||||
) {
|
||||
this.context = new BasicContext(this, '', IPublicEnumPluginRegisterLevel.Workspace);
|
||||
this.context.innerHotkey.activate(true);
|
||||
makeObservable(this);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user