mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 19:52:51 +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 {
|
function fireCallback(callback: IPublicTypeHotkeyCallback, e: KeyboardEvent, combo?: string, sequence?: string): void {
|
||||||
try {
|
try {
|
||||||
const workspace = globalContext.get('workspace');
|
const workspace = globalContext.get('workspace');
|
||||||
const editor = workspace.isActive ? workspace.window.editor : globalContext.get('editor');
|
const editor = workspace.isActive ? workspace.window?.editor : globalContext.get('editor');
|
||||||
const designer = editor.get('designer');
|
const designer = editor?.get('designer');
|
||||||
const node = designer?.currentSelection?.getNodes()?.[0];
|
const node = designer?.currentSelection?.getNodes()?.[0];
|
||||||
const npm = node?.componentMeta?.npm;
|
const npm = node?.componentMeta?.npm;
|
||||||
const selected =
|
const selected =
|
||||||
|
|||||||
@ -103,6 +103,7 @@ export class Workspace implements IWorkspace {
|
|||||||
readonly shellModelFactory: any,
|
readonly shellModelFactory: any,
|
||||||
) {
|
) {
|
||||||
this.context = new BasicContext(this, '', IPublicEnumPluginRegisterLevel.Workspace);
|
this.context = new BasicContext(this, '', IPublicEnumPluginRegisterLevel.Workspace);
|
||||||
|
this.context.innerHotkey.activate(true);
|
||||||
makeObservable(this);
|
makeObservable(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user