import { commandMachine } from './Editor/CommandMachine';
import './UI/Css/style.less';
import './UI/Css/golden.less';
import './UI/Css/blue.less';

import { WebCAD } from './UI/Layout/ApplicationLayout';
import { Classes } from '@blueprintjs/core';

// 禁止选中
document.onselectstart = () => false;

document.body.className = Classes.DARK;
// 禁止右键
// document.oncontextmenu = () => false;

window.onload = function ()
{
    new WebCAD("app");

    // -----热模块替换的代码.
    async function loadFirst()
    {
        let cmd = (await import("./Add-on/testEntity/test")).Test;
        commandMachine.RegisterCommand("tt", new cmd());
    }
    loadFirst(); // 必须先加载一次,否则无法触发热模块替换

    if (module.hot)
    {
        module.hot.accept('./Add-on/testEntity/test', loadFirst)
    }
};
