力皓 447ed9b8f9 chore: 保存成功弹框位置适配新引擎
feat: 支持属性变更事件
2020-11-20 14:15:03 +08:00

34 lines
1.1 KiB
TypeScript

import React, { Component } from 'react';
import { observer } from '@ali/lowcode-editor-core';
import { BorderDetecting } from './border-detecting';
import { BuiltinSimulatorHost } from '../host';
import { BorderSelecting } from './border-selecting';
import BorderResizing from './border-resizing';
import { InsertionView } from './insertion';
import './bem-tools.less';
import './borders.less';
@observer
export class BemTools extends Component<{ host: BuiltinSimulatorHost }> {
shouldComponentUpdate() {
return false;
}
render() {
const { host } = this.props;
const { designMode } = host;
const { scrollX, scrollY, scale } = host.viewport;
if (designMode === 'live') {
return null;
}
return (
<div className="lc-bem-tools" style={{ transform: `translate(${-scrollX * scale}px,${-scrollY * scale}px)` }}>
<BorderDetecting key="hovering" host={host} />
<BorderSelecting key="selecting" host={host} />
<InsertionView key="insertion" host={host} />
<BorderResizing key="resizing" host={host} />
</div>
);
}
}