import * as React from 'react';
import { WebCAD } from './UI/Layout/ApplicationLayout';

import './UI/Css/style.less';


//黄金布局
import '../node_modules/golden-layout/src/css/goldenlayout-base.css';
// import '../node_modules/golden-layout/src/css/goldenlayout-dark-theme.css';
import '../node_modules/golden-layout/src/css/goldenlayout-soda-theme.css';

//蓝图
import '../node_modules/normalize.css/normalize.css';
import '../node_modules/@blueprintjs/core/dist/blueprint.css';
import { commandMachine } from './Editor/CommandMachine';

//禁止选中
document.onselectstart = () => false
//禁止右键
// 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)
    }
};

