This commit is contained in:
kangwei 2020-05-05 19:28:15 +08:00
commit 4eee69763f
8 changed files with 24 additions and 18 deletions

View File

@ -41,7 +41,8 @@
"@alife/theme-lowcode-light": "^0.1.0", "@alife/theme-lowcode-light": "^0.1.0",
"react": "^16.8.1", "react": "^16.8.1",
"react-dom": "^16.8.1", "react-dom": "^16.8.1",
"@ali/vu-function-parser": "^2.5.0-beta.0" "@ali/vu-function-parser": "^2.5.0-beta.0",
"compare-versions": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@ali/iceluna-cli": "^0.0.16", "@ali/iceluna-cli": "^0.0.16",

View File

@ -18,8 +18,11 @@ import { upgradeAssetsBundle } from './upgrade-assets';
import { isCSSUrl } from '@ali/lowcode-utils'; import { isCSSUrl } from '@ali/lowcode-utils';
import { I18nSetter } from '@ali/visualengine-utils'; import { I18nSetter } from '@ali/visualengine-utils';
import VariableSetter from '@ali/vs-variable-setter'; import VariableSetter from '@ali/vs-variable-setter';
import { isObject, isArray } from 'lodash'; import _isArray from "lodash/isArray";
import _isObject from "lodash/isObject";
import _get from 'lodash/get';
import funcParser from '@ali/vu-function-parser'; import funcParser from '@ali/vu-function-parser';
import cv from 'compare-versions';
const { editor, skeleton, context, HOOKS, Trunk } = Engine; const { editor, skeleton, context, HOOKS, Trunk } = Engine;
@ -99,7 +102,7 @@ function initDemoPanes() {
props: { props: {
align: 'bottom', align: 'bottom',
icon: 'set', icon: 'set',
description: '设置', description: '设置'
}, },
}); });
skeleton.add({ skeleton.add({
@ -109,7 +112,7 @@ function initDemoPanes() {
props: { props: {
align: 'bottom', align: 'bottom',
icon: 'help', icon: 'help',
description: '帮助', description: '帮助'
}, },
}); });
@ -332,9 +335,9 @@ function replaceFuncProp(props?: any){
} }
if ((prop.compiled && prop.source) || prop.type === 'actionRef' || prop.type === 'js') { if ((prop.compiled && prop.source) || prop.type === 'actionRef' || prop.type === 'js') {
replaceProps[name] = funcParser(prop); replaceProps[name] = funcParser(prop);
} else if (isObject(prop)) { } else if (_isObject(prop)) {
replaceFuncProp(prop); replaceFuncProp(prop);
} else if (isArray(prop)) { } else if (_isArray(prop)) {
prop.map((propItem) => { prop.map((propItem) => {
replaceFuncProp(propItem); replaceFuncProp(propItem);
}); });
@ -344,7 +347,6 @@ function replaceFuncProp(props?: any){
for (const name in replaceProps) { for (const name in replaceProps) {
props[name] = replaceProps[name]; props[name] = replaceProps[name];
} }
return props; return props;
}; };

View File

@ -10,3 +10,4 @@ declare module '@ali/ve-i18n-manage-pane';
declare module '@ali/ve-action-pane'; declare module '@ali/ve-action-pane';
declare module '@ali/vu-legao-design-fetch-context'; declare module '@ali/vu-legao-design-fetch-context';
declare module "@ali/vu-function-parser"; declare module "@ali/vu-function-parser";
declare module "compare-versions";

View File

@ -466,6 +466,11 @@ export class DocumentModel {
return this.rootNode; return this.rootNode;
} }
// add toData
toData() {
return { componentsTree: [this.project?.currentDocument?.export(TransformStage.Save)] };
}
getHistory(): History { getHistory(): History {
return this.history; return this.history;
} }
@ -473,10 +478,6 @@ export class DocumentModel {
get root() { get root() {
return this.rootNode; return this.rootNode;
} }
toData() {
return this.export(TransformStage.Save);
}
} }
export function isDocumentModel(obj: any): obj is DocumentModel { export function isDocumentModel(obj: any): obj is DocumentModel {

View File

@ -13,7 +13,7 @@ export default class MainArea extends Component<{ area: Area<any, Panel | Widget
render() { render() {
const { area } = this.props; const { area } = this.props;
return ( return (
<div className={classNames('lc-main-area')}> <div className={classNames('lc-main-area engine-workspacepane')}>
{area.container.items.map((item) => item.content)} {area.container.items.map((item) => item.content)}
</div> </div>
); );

View File

@ -12,7 +12,7 @@ export default class RightArea extends Component<{ area: Area<any, Panel> }> {
render() { render() {
const { area } = this.props; const { area } = this.props;
return ( return (
<div className={classNames('lc-right-area', { <div className={classNames('lc-right-area engine-tabpane', {
'lc-area-visible': area.visible, 'lc-area-visible': area.visible,
})}> })}>
<Contents area={area} /> <Contents area={area} />

View File

@ -8,7 +8,7 @@ export default class TopArea extends Component<{ area: Area, itemClassName?: str
render() { render() {
const { area, itemClassName } = this.props; const { area, itemClassName } = this.props;
return ( return (
<div className={classNames("lc-top-area", { <div className={classNames("lc-top-area engine-actionpane", {
'lc-area-visible': area.visible 'lc-area-visible': area.visible
})}> })}>
<Contents area={area} itemClassName={itemClassName} /> <Contents area={area} itemClassName={itemClassName} />

View File

@ -185,12 +185,12 @@ body {
display: flex; display: flex;
margin-bottom: 2px; margin-bottom: 2px;
padding: 8px; padding: 8px;
.lc-top-area-left{}
.lc-top-area-center{ .lc-top-area-center{
flex: 1; flex: 1;
display: flex; display: flex;
justify-content: flex-end; justify-content: center;
margin-right: 8px; margin: 0 8px;
} }
.lc-top-area-right{ .lc-top-area-right{
display: flex; display: flex;
@ -331,6 +331,7 @@ body {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
z-index: 10;
.lc-toolbar { .lc-toolbar {
height: var(--toolbar-height); height: var(--toolbar-height);
background-color: var(--color-pane-background); background-color: var(--color-pane-background);