mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-15 14:00:35 +00:00
Merge branch 'feat/joint-editor' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into feat/joint-editor
This commit is contained in:
commit
90657fb6d5
@ -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",
|
||||||
|
|||||||
@ -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),
|
||||||
|
|||||||
@ -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: [
|
||||||
|
|||||||
3
packages/editor/src/plugins/save/index.scss
Normal file
3
packages/editor/src/plugins/save/index.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.lowcode-plugin-save {
|
||||||
|
padding: 10px 4px;
|
||||||
|
}
|
||||||
20
packages/editor/src/plugins/save/index.tsx
Normal file
20
packages/editor/src/plugins/save/index.tsx
Normal 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;
|
||||||
@ -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%;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user