refactor(managers): accept registry parameter via constructor injection
All 16 managers now receive ManagerRegistry instance through constructor instead of calling ManagerRegistry.getInstance(). This enables each BimEngine instance to have its own isolated set of managers. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* 负责管理右键上下文菜单的显示和交互
|
||||
*/
|
||||
import { BaseManager } from '../core/base-manager';
|
||||
import { ManagerRegistry } from '../core/manager-registry';
|
||||
import { BimRightKey } from '../components/right-key';
|
||||
import { BimMenu } from '../components/menu';
|
||||
import { MenuItemConfig } from '../components/menu/item';
|
||||
@@ -19,8 +20,8 @@ export class RightKeyManager extends BaseManager {
|
||||
/** 上下文处理器列表 */
|
||||
private contextHandlers: Array<(e: MouseEvent) => MenuItemConfig[] | null> = [];
|
||||
|
||||
constructor(container: HTMLElement) {
|
||||
super();
|
||||
constructor(container: HTMLElement, registry: ManagerRegistry) {
|
||||
super(registry);
|
||||
this.container = container;
|
||||
|
||||
this.rightKeyPanel = new BimRightKey({
|
||||
|
||||
Reference in New Issue
Block a user