Merge branch 'feat/joint-editor' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into feat/joint-editor

This commit is contained in:
kangwei 2020-03-16 20:40:31 +08:00
commit 90657fb6d5
6 changed files with 63 additions and 26 deletions

View File

@ -23,7 +23,7 @@
"store": "^2.0.12" "store": "^2.0.12"
}, },
"devDependencies": { "devDependencies": {
"@ice/spec": "^0.1.1", "@ice/spec": "^1.0.1",
"@types/debug": "^4.1.5", "@types/debug": "^4.1.5",
"@types/events": "^3.0.0", "@types/events": "^3.0.0",
"@types/react": "^16.8.3", "@types/react": "^16.8.3",

View File

@ -13,11 +13,13 @@ import Settings from '../../../plugin-settings';
import undoRedo from '../plugins/undoRedo'; import undoRedo from '../plugins/undoRedo';
import Designer from '../plugins/designer'; import Designer from '../plugins/designer';
import logo from '../plugins/logo'; import logo from '../plugins/logo';
import save from '../plugins/save';
import PluginFactory from '../framework/pluginFactory'; import PluginFactory from '../framework/pluginFactory';
export default { export default {
logo: PluginFactory(logo), logo: PluginFactory(logo),
save: PluginFactory(save),
designer: PluginFactory(Designer), designer: PluginFactory(Designer),
settings: PluginFactory(Settings), settings: PluginFactory(Settings),
undoRedo: PluginFactory(undoRedo), undoRedo: PluginFactory(undoRedo),

View File

@ -69,6 +69,35 @@ export default {
}, },
pluginProps: {} pluginProps: {}
}, },
{
pluginKey: 'topLinkIcon',
type: 'LinkIcon',
props: {
align: 'left',
title: 'link',
icon: 'dengpao',
linkProps: {
href: '//www.taobao.com',
target: 'blank'
}
},
config: {},
pluginProps: {}
},
{
pluginKey: 'topIcon',
type: 'Icon',
props: {
align: 'left',
title: 'icon',
icon: 'dengpao',
onClick(editor) {
alert(`icon addon invoke, current activeKey: ${editor.activeKey}`);
}
},
config: {},
pluginProps: {}
},
{ {
pluginKey: 'undoRedo', pluginKey: 'undoRedo',
type: 'Custom', type: 'Custom',
@ -89,33 +118,16 @@ export default {
} }
}, },
{ {
pluginKey: 'topLinkIcon', pluginKey: 'save',
type: 'LinkIcon', type: 'Custom',
props: { props: {
align: 'right', align: 'right',
title: 'link', width: 64
icon: 'dengpao', },
linkProps: { config: {
href: '//www.taobao.com', package: '@ali/lowcode-plugin-save',
target: 'blank' version: '1.0.0'
} }
},
config: {},
pluginProps: {}
},
{
pluginKey: 'topIcon',
type: 'Icon',
props: {
align: 'right',
title: 'icon',
icon: 'dengpao',
onClick(editor) {
alert(`icon addon invoke, current activeKey: ${editor.activeKey}`);
}
},
config: {},
pluginProps: {}
} }
], ],
leftArea: [ leftArea: [

View File

@ -0,0 +1,3 @@
.lowcode-plugin-save {
padding: 10px 4px;
}

View File

@ -0,0 +1,20 @@
import React from 'react';
import {Button} from '@alifd/next';
import './index.scss';
import { PluginProps } from '../../framework/definitions';
const Save: React.FC<PluginProps> = (props): React.ReactElement => {
const handleClick = (): void => {
console.log('save data:', props.editor.designer.currentDocument.schema);
};
return (
<div className="lowcode-plugin-save">
<Button type="primary" onClick={handleClick}></Button>
</div>
);
};
export default Save;

View File

@ -21,7 +21,7 @@
} }
.right-area { .right-area {
position: absolute; position: absolute;
right: 12px; right: 0;
top: 0; top: 0;
padding: 0 16px; padding: 0 16px;
height: 100%; height: 100%;