mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 07:14:23 +00:00
feat: 接入乐高组件面板
This commit is contained in:
parent
567281fa9b
commit
e40b1f3e7d
@ -1,10 +1,12 @@
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import Engine from '@ali/visualengine';
|
import Engine, { Panes } from '@ali/visualengine';
|
||||||
|
import getTrunkPane from '@ali/ve-trunk-pane';
|
||||||
import loadUrls from './loader';
|
import loadUrls from './loader';
|
||||||
import { upgradeAssetsBundle } from './upgrade-assets';
|
import { upgradeAssetsBundle } from './upgrade-assets';
|
||||||
|
|
||||||
const { editor } = Engine;
|
const { editor } = Engine;
|
||||||
|
|
||||||
|
initTrunkPane();
|
||||||
Engine.init();
|
Engine.init();
|
||||||
|
|
||||||
load();
|
load();
|
||||||
@ -52,3 +54,19 @@ async function loadSchema() {
|
|||||||
const schema = await editor.utils.get('./schema.json');
|
const schema = await editor.utils.get('./schema.json');
|
||||||
editor.set('schema', schema);
|
editor.set('schema', schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function initTrunkPane() {
|
||||||
|
const assets = await editor.onceGot('legao-assets');
|
||||||
|
const config = {
|
||||||
|
disableLowCodeComponent: true,
|
||||||
|
disableComponentStore: true,
|
||||||
|
app: {
|
||||||
|
getAssetsData() {
|
||||||
|
return assets;
|
||||||
|
// return data;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const TrunkPane = getTrunkPane(config);
|
||||||
|
Panes.add(TrunkPane);
|
||||||
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import PanelDock from './panel-dock';
|
|||||||
import Dock from './dock';
|
import Dock from './dock';
|
||||||
import { Stage, StageConfig } from './stage';
|
import { Stage, StageConfig } from './stage';
|
||||||
import { isValidElement } from 'react';
|
import { isValidElement } from 'react';
|
||||||
|
import { isPlainObject } from 'globals/src/utils';
|
||||||
|
|
||||||
export enum SkeletonEvents {
|
export enum SkeletonEvents {
|
||||||
PANEL_DOCK_ACTIVE = 'skeleton.panel-dock.active',
|
PANEL_DOCK_ACTIVE = 'skeleton.panel-dock.active',
|
||||||
@ -230,7 +231,7 @@ export class Skeleton {
|
|||||||
add(config: IWidgetBaseConfig & { area: string }) {
|
add(config: IWidgetBaseConfig & { area: string }) {
|
||||||
const { content, ...restConfig } = config;
|
const { content, ...restConfig } = config;
|
||||||
if (content) {
|
if (content) {
|
||||||
if (typeof content === 'object' && !isValidElement(content)) {
|
if (isPlainObject(content) && !isValidElement(content)) {
|
||||||
Object.keys(content).forEach((key) => {
|
Object.keys(content).forEach((key) => {
|
||||||
if (/props$/i.test(key) && restConfig[key]) {
|
if (/props$/i.test(key) && restConfig[key]) {
|
||||||
restConfig[key] = {
|
restConfig[key] = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user