@logicflow/core
Advanced tools
Comparing version 1.0.0-alpha.0 to 1.0.0-alpha.1
{ | ||
"name": "@logicflow/core", | ||
"version": "1.0.0-alpha.0", | ||
"version": "1.0.0-alpha.1", | ||
"description": "LogicFlow core, to quickly build flowchart editor", | ||
@@ -78,4 +78,4 @@ "main": "dist/logic-flow.js", | ||
"lodash-es": "^4.17.15", | ||
"mobx": "^4.15.7", | ||
"mobx-react": "^5.4.4", | ||
"mobx": "^5.15.7", | ||
"mobx-react": "^6.3.0", | ||
"mobx-utils": "^5.6.1", | ||
@@ -82,0 +82,0 @@ "prettier": "^2.2.1", |
@@ -15,2 +15,29 @@ import { h, Component } from 'preact'; | ||
}; | ||
declare type StyleAttribute = { | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
[key: string]: any; | ||
}; | ||
export declare type NodeAttributes = { | ||
id: string; | ||
properties: Record<string, any>; | ||
type: string; | ||
x: number; | ||
y: number; | ||
isSelected: boolean; | ||
isHovered: boolean; | ||
text: { | ||
x: number; | ||
y: number; | ||
value: string; | ||
[key: string]: any; | ||
}; | ||
} & StyleAttribute; | ||
export default abstract class BaseNode extends Component<IProps, Istate> { | ||
@@ -24,40 +51,4 @@ static getModel(defaultModel: any): any; | ||
abstract getShape(): any; | ||
getShapeStyle(): { | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
}; | ||
getAttributes(): { | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
type: string; | ||
x: number; | ||
y: number; | ||
isSelected: boolean; | ||
isHovered: boolean; | ||
text: { | ||
value: string; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
}; | ||
}; | ||
getShapeStyle(): StyleAttribute; | ||
getAttributes(): NodeAttributes; | ||
getProperties(): Record<string, any>; | ||
@@ -64,0 +55,0 @@ getAnchorStyle(): Record<string, any>; |
@@ -9,8 +9,8 @@ import { h } from 'preact'; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
}; | ||
@@ -22,12 +22,10 @@ getAttributes(): { | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
properties: Record<string, any>; | ||
type: string; | ||
@@ -39,7 +37,6 @@ x: number; | ||
text: { | ||
value: string; | ||
[key: string]: any; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
value: string; | ||
}; | ||
@@ -46,0 +43,0 @@ }; |
@@ -9,8 +9,8 @@ import { h } from 'preact'; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
}; | ||
@@ -22,12 +22,10 @@ getAttributes(): { | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
properties: Record<string, any>; | ||
type: string; | ||
@@ -39,7 +37,6 @@ x: number; | ||
text: { | ||
value: string; | ||
[key: string]: any; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
value: string; | ||
}; | ||
@@ -46,0 +43,0 @@ }; |
@@ -7,15 +7,4 @@ import { h } from 'preact'; | ||
ry: number; | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
properties: Record<string, any>; | ||
type: string; | ||
@@ -27,10 +16,18 @@ x: number; | ||
text: { | ||
value: string; | ||
[key: string]: any; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
value: string; | ||
}; | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
}; | ||
getShape(): h.JSX.Element; | ||
} |
import { h } from 'preact'; | ||
import BaseNode from './BaseNode'; | ||
import BaseNode, { NodeAttributes } from './BaseNode'; | ||
import { PointTuple } from '../../type'; | ||
declare type PolygonNodeAttributes = { | ||
points: PointTuple[]; | ||
} & NodeAttributes; | ||
export default class PolygonNode extends BaseNode { | ||
getShapeStyle(): { | ||
points: import("../..").PointTuple[]; | ||
points: PointTuple[]; | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
}; | ||
getAttributes(): { | ||
points: import("../..").PointTuple[]; | ||
width: number; | ||
height: number; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
type: string; | ||
x: number; | ||
y: number; | ||
isSelected: boolean; | ||
isHovered: boolean; | ||
text: { | ||
value: string; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
}; | ||
}; | ||
getAttributes(): PolygonNodeAttributes; | ||
getShape(): h.JSX.Element; | ||
} | ||
export {}; |
@@ -9,8 +9,8 @@ import { h } from 'preact'; | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
}; | ||
@@ -22,12 +22,10 @@ getAttributes(): { | ||
fill: string; | ||
fillOpacity: number; | ||
strokeWidth: number; | ||
fillOpacity?: number; | ||
strokeWidth?: number; | ||
stroke: string; | ||
strokeOpacity: number; | ||
opacity: number; | ||
outlineColor: string; | ||
strokeOpacity?: number; | ||
opacity?: number; | ||
outlineColor?: string; | ||
id: string; | ||
properties: { | ||
[x: string]: any; | ||
}; | ||
properties: Record<string, any>; | ||
type: string; | ||
@@ -39,7 +37,6 @@ x: number; | ||
text: { | ||
value: string; | ||
[key: string]: any; | ||
x: number; | ||
y: number; | ||
draggable: boolean; | ||
editable: boolean; | ||
value: string; | ||
}; | ||
@@ -46,0 +43,0 @@ }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
597845
3804