2025-12-24 19:02:34 +08:00
|
|
|
|
import type { ButtonConfig } from '../../../index.type';
|
|
|
|
|
|
import type { BimEngine } from '../../../../../bim-engine';
|
2025-12-22 15:39:58 +08:00
|
|
|
|
import { infoIcon } from './icon';
|
2025-12-03 15:46:18 +08:00
|
|
|
|
|
2025-12-24 19:02:34 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 信息按钮配置
|
|
|
|
|
|
* 说明:当前仍保留 demo 的事件触发方式;engine 已注入,便于未来替换为 SDK 内部逻辑。
|
|
|
|
|
|
*/
|
|
|
|
|
|
export const createInfoButton = (_engine: BimEngine): ButtonConfig => {
|
|
|
|
|
|
return {
|
|
|
|
|
|
id: 'toolbar-info',
|
|
|
|
|
|
groupId: 'group-2',
|
|
|
|
|
|
type: 'button',
|
|
|
|
|
|
label: 'toolbar.info',
|
|
|
|
|
|
icon: infoIcon,
|
|
|
|
|
|
onClick: () => {
|
|
|
|
|
|
// WORKAROUND: Dispatch a standard custom event on document
|
|
|
|
|
|
document.dispatchEvent(new CustomEvent('bim-demo:open-property-panel'));
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
2025-12-03 15:46:18 +08:00
|
|
|
|
};
|