mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-07 02:47:12 +00:00
feat: fix conflict
This commit is contained in:
parent
6bb6a2c308
commit
4f3b0e9883
@ -127,102 +127,6 @@ export const __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
|||||||
};
|
};
|
||||||
engineConfig.set('isOpenSource', isOpenSource);
|
engineConfig.set('isOpenSource', isOpenSource);
|
||||||
|
|
||||||
// 注册一批内置插件
|
|
||||||
(async function registerPlugins() {
|
|
||||||
// 处理 editor.set('assets'),将组件元数据创建好
|
|
||||||
const componentMetaParser = (ctx: ILowCodePluginContext) => {
|
|
||||||
return {
|
|
||||||
init() {
|
|
||||||
editor.onGot('assets', (assets: any) => {
|
|
||||||
const { components = [] } = assets;
|
|
||||||
designer.buildComponentMetasMap(components);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
componentMetaParser.pluginName = '___component_meta_parser___';
|
|
||||||
await plugins.register(componentMetaParser);
|
|
||||||
|
|
||||||
// 注册默认的 setters
|
|
||||||
const setterRegistry = (ctx: ILowCodePluginContext) => {
|
|
||||||
return {
|
|
||||||
init() {
|
|
||||||
if (engineConfig.get('disableDefaultSetters')) return;
|
|
||||||
const builtinSetters = require('@alilc/lowcode-engine-ext')?.setters;
|
|
||||||
if (builtinSetters) {
|
|
||||||
ctx.setters.registerSetter(builtinSetters);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
setterRegistry.pluginName = '___setter_registry___';
|
|
||||||
await plugins.register(setterRegistry);
|
|
||||||
|
|
||||||
// 注册默认的面板
|
|
||||||
const defaultPanelRegistry = (ctx: ILowCodePluginContext) => {
|
|
||||||
return {
|
|
||||||
init() {
|
|
||||||
skeleton.add({
|
|
||||||
area: 'mainArea',
|
|
||||||
name: 'designer',
|
|
||||||
type: 'Widget',
|
|
||||||
content: DesignerPlugin,
|
|
||||||
});
|
|
||||||
if (!engineConfig.get('disableDefaultSettingPanel')) {
|
|
||||||
skeleton.add({
|
|
||||||
area: 'rightArea',
|
|
||||||
name: 'settingsPane',
|
|
||||||
type: 'Panel',
|
|
||||||
content: SettingsPrimaryPane,
|
|
||||||
props: {
|
|
||||||
ignoreRoot: true,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// by default in float area;
|
|
||||||
let isInFloatArea = true;
|
|
||||||
const hasPreferenceForOutline = editor
|
|
||||||
?.getPreference()
|
|
||||||
?.contains('outline-pane-pinned-status-isFloat', 'skeleton');
|
|
||||||
if (hasPreferenceForOutline) {
|
|
||||||
isInFloatArea = editor
|
|
||||||
?.getPreference()
|
|
||||||
?.get('outline-pane-pinned-status-isFloat', 'skeleton');
|
|
||||||
}
|
|
||||||
|
|
||||||
skeleton.add({
|
|
||||||
area: 'leftArea',
|
|
||||||
name: 'outlinePane',
|
|
||||||
type: 'PanelDock',
|
|
||||||
content: Outline,
|
|
||||||
panelProps: {
|
|
||||||
area: isInFloatArea ? 'leftFloatArea' : 'leftFixedArea',
|
|
||||||
keepVisibleWhileDragging: true,
|
|
||||||
...engineConfig.get('defaultOutlinePaneProps'),
|
|
||||||
},
|
|
||||||
contentProps: {
|
|
||||||
treeTitleExtra: engineConfig.get('treeTitleExtra'),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
skeleton.add({
|
|
||||||
area: 'rightArea',
|
|
||||||
name: 'backupOutline',
|
|
||||||
type: 'Panel',
|
|
||||||
props: {
|
|
||||||
condition: () => {
|
|
||||||
return designer.dragon.dragging && !getTreeMaster(designer).hasVisibleTreeBoard();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
content: OutlineBackupPane,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
};
|
|
||||||
};
|
|
||||||
defaultPanelRegistry.pluginName = '___default_panel___';
|
|
||||||
await plugins.register(defaultPanelRegistry);
|
|
||||||
})();
|
|
||||||
|
|
||||||
// container which will host LowCodeEngine DOM
|
// container which will host LowCodeEngine DOM
|
||||||
let engineContainer: HTMLElement;
|
let engineContainer: HTMLElement;
|
||||||
// @ts-ignore webpack Define variable
|
// @ts-ignore webpack Define variable
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { ILowCodePluginContext } from '@alilc/lowcode-designer';
|
import { ILowCodePluginContext } from '@alilc/lowcode-designer';
|
||||||
|
import { engineConfig } from '@alilc/lowcode-editor-core';
|
||||||
import { SettingsPrimaryPane } from '@alilc/lowcode-editor-skeleton';
|
import { SettingsPrimaryPane } from '@alilc/lowcode-editor-skeleton';
|
||||||
import DesignerPlugin from '@alilc/lowcode-plugin-designer';
|
import DesignerPlugin from '@alilc/lowcode-plugin-designer';
|
||||||
import Outline, { getTreeMaster, OutlineBackupPane } from '@alilc/lowcode-plugin-outline-pane';
|
import Outline, { getTreeMaster, OutlineBackupPane } from '@alilc/lowcode-plugin-outline-pane';
|
||||||
@ -63,6 +64,9 @@ export const defaultPanelRegistry = (editor: any, designer: any) => {
|
|||||||
keepVisibleWhileDragging: true,
|
keepVisibleWhileDragging: true,
|
||||||
...config.get('defaultOutlinePaneProps'),
|
...config.get('defaultOutlinePaneProps'),
|
||||||
},
|
},
|
||||||
|
contentProps: {
|
||||||
|
treeTitleExtra: engineConfig.get('treeTitleExtra'),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
skeleton.add({
|
skeleton.add({
|
||||||
area: 'rightArea',
|
area: 'rightArea',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user