refactor(components): accept registry in menu, engine, walk-path, button-group
Menu button factories, Engine component, WalkPathPanel, and BimButtonGroup now accept registry via options/parameters. Engine component adds public resize() method wrapping EngineKernel.handleWindowResize(). Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -10,12 +10,11 @@ import { t, localeManager } from '../../services/locale';
|
||||
import { themeManager } from '../../services/theme';
|
||||
import type { ThemeConfig } from '../../themes/types';
|
||||
import { IBimComponent } from '../../types/component';
|
||||
import { ManagerRegistry } from '../../core/manager-registry';
|
||||
import { EngineEvents } from '../../types/events';
|
||||
import type { EngineEvents } from '../../types/events';
|
||||
|
||||
export class BimButtonGroup implements IBimComponent {
|
||||
private container: HTMLElement;
|
||||
private options: ButtonGroupOptions;
|
||||
protected options: ButtonGroupOptions;
|
||||
private groups: ButtonGroup[] = [];
|
||||
private activeBtnIds: Set<string> = new Set();
|
||||
private btnRefs: Map<string, HTMLElement> = new Map();
|
||||
@@ -63,8 +62,7 @@ export class BimButtonGroup implements IBimComponent {
|
||||
}
|
||||
|
||||
protected emit<K extends keyof EngineEvents>(event: K, payload: EngineEvents[K]) {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
registry.emit(event, payload);
|
||||
this.options.registry?.emit(event, payload);
|
||||
}
|
||||
|
||||
private initContainer(): void {
|
||||
|
||||
Reference in New Issue
Block a user