Skip to content

Commit c24c3d8

Browse files
liujupingJackLian
authored andcommitted
feat: add hideComponentAction config
1 parent e1f3a11 commit c24c3d8

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

docs/docs/api/configOptions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ config.set('enableCondition', false)
216216

217217
是否在只有一个 item 的时候隐藏设置 tabs
218218

219+
#### hideComponentAction
220+
221+
`@type {boolean}` `@default {false}`
222+
223+
隐藏设计器辅助层
224+
219225
#### thisRequiredInJSE
220226

221227
`@type {boolean}` `@default {true}`

packages/designer/src/builtin-simulator/bem-tools/border-selecting.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ComponentType,
1010
} from 'react';
1111
import classNames from 'classnames';
12-
import { observer, computed, Tip } from '@alilc/lowcode-editor-core';
12+
import { observer, computed, Tip, engineConfig } from '@alilc/lowcode-editor-core';
1313
import { createIcon, isReactComponent, isActionContentObject } from '@alilc/lowcode-utils';
1414
import { IPublicTypeActionContentObject } from '@alilc/lowcode-types';
1515
import { BuiltinSimulatorHost } from '../host';
@@ -47,14 +47,18 @@ export class BorderSelectingInstance extends Component<{
4747
});
4848

4949
const { hideSelectTools } = observed.node.componentMeta.advanced;
50+
const hideComponentAction = engineConfig.get('hideComponentAction');
5051

5152
if (hideSelectTools) {
5253
return null;
5354
}
5455

5556
return (
56-
<div className={className} style={style}>
57-
{!dragging && <Toolbar observed={observed} />}
57+
<div
58+
className={className}
59+
style={style}
60+
>
61+
{(!dragging && !hideComponentAction) ? <Toolbar observed={observed} /> : null}
5862
</div>
5963
);
6064
}

packages/editor-core/src/config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ const VALID_ENGINE_OPTIONS = {
159159
type: 'function',
160160
description: '应用级设计模式下,窗口为空时展示的占位组件',
161161
},
162+
hideComponentAction: {
163+
type: 'boolean',
164+
description: '是否隐藏设计器辅助层',
165+
default: false,
166+
},
162167
};
163168

164169
const getStrictModeValue = (engineOptions: IPublicTypeEngineOptions, defaultValue: boolean): boolean => {

packages/types/src/shell/type/engine-options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ export interface IPublicTypeEngineOptions {
177177
* 应用级设计模式下,自动打开第一个窗口
178178
*/
179179
enableAutoOpenFirstWindow?: boolean;
180+
181+
/**
182+
* @default false
183+
* 隐藏设计器辅助层
184+
*/
185+
hideComponentAction?: boolean;
180186
}
181187

182188
/**

0 commit comments

Comments
 (0)