feat: meta 增加 hideSelectTools

This commit is contained in:
yingkong.lz 2021-01-23 23:05:19 +08:00
parent ac051241d2
commit e7287d47b1
3 changed files with 10 additions and 0 deletions

View File

@ -46,6 +46,12 @@ export class BorderSelectingInstance extends Component<{
dragging,
});
const hideSelectTools = observed.node.componentMeta.getMetadata().experimental?.hideSelectTools;
if (hideSelectTools) {
return null;
}
return (
<div className={className} style={style}>
{!dragging && <Toolbar observed={observed} />}

View File

@ -137,6 +137,7 @@ export interface OldPrototypeConfig {
isContainer?: boolean; // => configure.component.isContainer
isAbsoluteLayoutContainer?: boolean; // => meta.experimental.isAbsoluteLayoutContainer 是否是绝对定位容器
hideSelectTools?: boolean; // => meta.experimental.hideSelectTools
isModal?: boolean; // => configure.component.isModal
isFloating?: boolean; // => configure.component.isFloating
descriptor?: string; // => configure.component.descriptor
@ -595,6 +596,7 @@ export function upgradeMetadata(oldConfig: OldPrototypeConfig) {
transducers,
isContainer,
isAbsoluteLayoutContainer,
hideSelectTools,
rectSelector,
isModal,
isFloating,
@ -684,6 +686,7 @@ export function upgradeMetadata(oldConfig: OldPrototypeConfig) {
// 未考虑清楚的,放在实验性段落
const experimental: any = {
isAbsoluteLayoutContainer,
hideSelectTools,
};
if (context) {
// for prototype.getContextInfo

View File

@ -66,6 +66,7 @@ export interface Experimental {
callbacks?: Callbacks;
initialChildren?: NodeData[] | ((target: SettingTarget) => NodeData[]);
isAbsoluteLayoutContainer: boolean;
hideSelectTools?: boolean;
// 样式 及 位置handle上必须有明确的标识以便事件路由判断或者主动设置事件独占模式
// NWSE 是交给引擎计算放置位置ReactElement 必须自己控制初始位置