mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-20 07:14:23 +00:00
feat: 🎸 polyfill style
This commit is contained in:
parent
27db010b8a
commit
a6381d7310
34
packages/vision-polyfill/src/dragon.ts
Normal file
34
packages/vision-polyfill/src/dragon.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { editor, designer } from './editor';
|
||||||
|
|
||||||
|
const dragon = designer.dragon;
|
||||||
|
|
||||||
|
const dragengine = {
|
||||||
|
from (shell: Element, boost: (e: MouseEvent) => any): any {
|
||||||
|
|
||||||
|
},
|
||||||
|
onDragstart(func: (e: any, dragment: any) => any) {
|
||||||
|
return dragon.onDragstart((evt) => {
|
||||||
|
func(evt.originalEvent, evt.dragObject.nodes[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDrag (func: (e: any, dragment: any, location: Location) => any) {
|
||||||
|
return dragon.onDrag((evt) => {
|
||||||
|
const loc = designer.currentDocument?.dropLocation;
|
||||||
|
func(evt.originalEvent, evt.dragObject.nodes[0]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onDragend (func: (dragment: any, location: Location, copy: any) => any) {
|
||||||
|
|
||||||
|
},
|
||||||
|
addSensor (sensor: any) {
|
||||||
|
|
||||||
|
},
|
||||||
|
removeSensor (sensor: any) {
|
||||||
|
|
||||||
|
},
|
||||||
|
inDragging () {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default dragengine;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { Component, Fragment } from 'react';
|
import { Component, Fragment } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { observer } from '@ali/lowcode-globals';
|
import { observer } from '@ali/lowcode-globals';
|
||||||
import { Button } from '@alifd/next';
|
import { Button, Icon } from '@alifd/next';
|
||||||
import Area from './area';
|
import Area from './area';
|
||||||
import { PanelConfig } from './types';
|
import { PanelConfig } from './types';
|
||||||
import Panel from './panel';
|
import Panel from './panel';
|
||||||
@ -20,11 +20,14 @@ export default class LeftFixedPane extends Component<{ area: Area<PanelConfig, P
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
text
|
||||||
className="lc-pane-close"
|
className="lc-pane-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
area.setVisible(false);
|
area.setVisible(false);
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Icon type="close" />
|
||||||
|
</Button>
|
||||||
<Contents area={area} />
|
<Contents area={area} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Component, Fragment } from 'react';
|
import { Component, Fragment } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { observer } from '@ali/lowcode-globals';
|
import { observer } from '@ali/lowcode-globals';
|
||||||
import { Button } from '@alifd/next';
|
import { Button, Icon } from '@alifd/next';
|
||||||
import Area from './area';
|
import Area from './area';
|
||||||
import Panel from './panel';
|
import Panel from './panel';
|
||||||
|
|
||||||
@ -21,11 +21,14 @@ export default class LeftFloatPane extends Component<{ area: Area<any, Panel> }>
|
|||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
text
|
||||||
className="lc-pane-close"
|
className="lc-pane-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
area.setVisible(false);
|
area.setVisible(false);
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
|
<Icon type="close" />
|
||||||
|
</Button>
|
||||||
<Contents area={area} />
|
<Contents area={area} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -12,12 +12,12 @@
|
|||||||
--input-border-radius: @input-border-radius;
|
--input-border-radius: @input-border-radius;
|
||||||
--popup-border-radius: @popup-border-radius;
|
--popup-border-radius: @popup-border-radius;
|
||||||
|
|
||||||
--left-area-width: 46px;
|
--left-area-width: 48px;
|
||||||
--right-area-width: 300px;
|
--right-area-width: 280px;
|
||||||
--top-area-height: 48px;
|
--top-area-height: 48px;
|
||||||
--toolbar-height: 32px;
|
--toolbar-height: 36px;
|
||||||
--dock-pane-width: 372px;
|
--dock-pane-width: 280px;
|
||||||
--dock-fixed-pane-width: 220px;
|
--dock-fixed-pane-width: 280px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 1860px) {
|
@media (min-width: 1860px) {
|
||||||
@ -185,6 +185,7 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
|
padding: 8px 16px;
|
||||||
}
|
}
|
||||||
.lc-workbench-body {
|
.lc-workbench-body {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -198,29 +199,83 @@ body {
|
|||||||
width: var(--dock-pane-width);
|
width: var(--dock-pane-width);
|
||||||
left: calc(var(--left-area-width) + 1px);
|
left: calc(var(--left-area-width) + 1px);
|
||||||
background-color: var(--color-pane-background);
|
background-color: var(--color-pane-background);
|
||||||
|
box-shadow: 4px 0 16px 0 rgba(31,50,88,0.08);
|
||||||
z-index: 820;
|
z-index: 820;
|
||||||
display: none;
|
display: none;
|
||||||
|
padding-top: 36px;
|
||||||
&.lc-area-visible {
|
&.lc-area-visible {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.lc-pane-close{
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 6px;
|
||||||
|
.next-icon{
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.lc-left-area {
|
.lc-left-area {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: var(--left-area-width);
|
width: var(--left-area-width);
|
||||||
background-color: var(--color-pane-background);
|
background-color: var(--color-pane-background);
|
||||||
display: none;
|
display: none;
|
||||||
|
flex-shrink: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
&.lc-area-visible {
|
&.lc-area-visible {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
.lc-left-area-top,
|
||||||
|
.lc-left-area-bottom{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
.lc-title{
|
||||||
|
padding: 12px;
|
||||||
|
flex-direction: column;
|
||||||
|
&.has-tip{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
&.actived{
|
||||||
|
color: #0079F2;
|
||||||
|
}
|
||||||
|
.lc-title-icon{
|
||||||
|
margin: 0;
|
||||||
|
.next-icon:before {
|
||||||
|
line-height: 1 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.lc-left-area-top{
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
.lc-left-area-bottom{
|
||||||
|
padding-bottom: 12px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.lc-left-fixed-pane {
|
.lc-left-fixed-pane {
|
||||||
width: var(--dock-fixed-pane-width);
|
width: var(--dock-fixed-pane-width);
|
||||||
background-color: var(--color-pane-background);
|
background-color: var(--color-pane-background);
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: none;
|
display: none;
|
||||||
|
flex-shrink: 0;
|
||||||
|
padding-top: 36px;
|
||||||
|
position: relative;
|
||||||
&.lc-area-visible {
|
&.lc-area-visible {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.lc-pane-close{
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 6px;
|
||||||
|
.next-icon{
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.lc-left-area.lc-area-visible ~ .lc-left-fixed-pane {
|
.lc-left-area.lc-area-visible ~ .lc-left-fixed-pane {
|
||||||
margin-left: 1px;
|
margin-left: 1px;
|
||||||
@ -228,6 +283,11 @@ body {
|
|||||||
.lc-left-area.lc-area-visible ~ .lc-workbench-center {
|
.lc-left-area.lc-area-visible ~ .lc-workbench-center {
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
}
|
}
|
||||||
|
.lc-outline-pane{
|
||||||
|
.lc-outline-tree .tree-node .tree-node-title{
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
.lc-workbench-center {
|
.lc-workbench-center {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -235,6 +295,7 @@ body {
|
|||||||
.lc-toolbar {
|
.lc-toolbar {
|
||||||
height: var(--toolbar-height);
|
height: var(--toolbar-height);
|
||||||
background-color: var(--color-pane-background);
|
background-color: var(--color-pane-background);
|
||||||
|
padding: 8px 16px;
|
||||||
}
|
}
|
||||||
.lc-main-area {
|
.lc-main-area {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@ -253,10 +314,29 @@ body {
|
|||||||
width: var(--right-area-width);
|
width: var(--right-area-width);
|
||||||
background-color: var(--color-pane-background);
|
background-color: var(--color-pane-background);
|
||||||
display: none;
|
display: none;
|
||||||
|
flex-shrink: 0;
|
||||||
margin-left: 2px;
|
margin-left: 2px;
|
||||||
&.lc-area-visible {
|
&.lc-area-visible {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.lc-settings-tabs{
|
||||||
|
> .next-tabs-nav-extra{
|
||||||
|
top: 36px !important;
|
||||||
|
}
|
||||||
|
.lc-settings-tab-item{
|
||||||
|
.next-tabs-tab-inner{
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.lc-title{
|
||||||
|
color: inherit;
|
||||||
|
line-height: inherit !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.lc-settings-tabs-content{
|
||||||
|
top: 66px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user