Files
theia-code-os/packages/design-panel/src/browser/design-panel-contribution.ts
mawkone 8bb5110148
Some checks failed
Playwright Tests / Playwright Tests (ubuntu-22.04, Node.js 22.x) (push) Has been cancelled
3PP License Check / 3PP License Check (11, 22.x, ubuntu-22.04) (push) Has been cancelled
Publish packages to NPM / Perform Publishing (push) Has been cancelled
deploy: current vibn theia state
Made-with: Cursor
2026-02-27 12:01:08 -08:00

43 lines
1.4 KiB
TypeScript

import { injectable } from '@theia/core/shared/inversify';
import { AbstractViewContribution } from '@theia/core/lib/browser';
import { Command, CommandRegistry, MenuModelRegistry } from '@theia/core/lib/common';
import { CommonMenus } from '@theia/core/lib/browser';
import { DesignPanelWidget } from './design-panel-widget';
export const DesignPanelCommand: Command = {
id: 'vibn.design.panel.open',
label: 'Open Design Panel',
category: 'Design',
};
@injectable()
export class DesignPanelContribution extends AbstractViewContribution<DesignPanelWidget> {
constructor() {
super({
widgetId: DesignPanelWidget.ID,
widgetName: DesignPanelWidget.LABEL,
defaultWidgetOptions: {
area: 'main',
},
toggleCommandId: DesignPanelCommand.id,
});
}
override registerCommands(registry: CommandRegistry): void {
super.registerCommands(registry);
registry.registerCommand(DesignPanelCommand, {
execute: () => this.openView({ reveal: true, activate: true }),
});
}
override registerMenus(menus: MenuModelRegistry): void {
super.registerMenus(menus);
menus.registerMenuAction(CommonMenus.VIEW_VIEWS, {
commandId: DesignPanelCommand.id,
label: 'Design Panel',
order: 'z',
});
}
}