@logicflow/core 1.1.18 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entry.js +7 -0
- package/dist/logic-flow.js +39169 -15
- package/dist/logic-flow.min.js +15 -0
- package/package.json +9 -6
- package/types/LogicFlow.d.ts +2 -1
- package/types/model/EditConfigModel.d.ts +1 -0
- package/types/model/GraphModel.d.ts +1 -1
- package/types/model/edge/BaseEdgeModel.d.ts +15 -2
- package/types/model/node/BaseNodeModel.d.ts +4 -0
- package/types/type/index.d.ts +21 -0
- package/types/view/edge/BaseEdge.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logicflow/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21",
|
|
4
4
|
"description": "LogicFlow core, to quickly build flowchart editor",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"main": "dist/entry.js",
|
|
6
|
+
"module": "dist/logic-flow.js",
|
|
7
|
+
"unpkg": "dist/logic-flow.min.js",
|
|
8
|
+
"sideEffects": true,
|
|
9
|
+
"jsdelivr": "dist/logic-flow.min.js",
|
|
8
10
|
"license": "Apache-2.0",
|
|
9
11
|
"homepage": "http://logic-flow.org/",
|
|
10
12
|
"types": "types/index.d.ts",
|
|
@@ -17,12 +19,13 @@
|
|
|
17
19
|
"dev": "cross-env NODE_ENV=development webpack-dev-server --client-log-level warning --config scripts/webpack.config.dev.js",
|
|
18
20
|
"clean": "rimraf dist lib esm cjs",
|
|
19
21
|
"build": "npm run build:umd",
|
|
20
|
-
"build:umd": "cross-env NODE_ENV=production webpack --config scripts/webpack.config.build.js &&
|
|
22
|
+
"build:umd": "cross-env NODE_ENV=production webpack --config scripts/webpack.config.build.js && npm run copy",
|
|
21
23
|
"build-analyse": "cross-env analyse=true npm run build",
|
|
22
24
|
"types": "tsc -d --declarationDir ./types --outDir temp && rimraf temp",
|
|
23
25
|
"lint": "eslint . --ext .ts,.tsx",
|
|
24
26
|
"publish-lib": "npm run types & npm run clean && npm run build && npm publish",
|
|
25
|
-
"publish-next": "npm run types & npm run clean && npm run build && npm publish --tag next"
|
|
27
|
+
"publish-next": "npm run types & npm run clean && npm run build && npm publish --tag next",
|
|
28
|
+
"copy": "node ./scripts/copy.js"
|
|
26
29
|
},
|
|
27
30
|
"files": [
|
|
28
31
|
"dist",
|
package/types/LogicFlow.d.ts
CHANGED
|
@@ -133,8 +133,9 @@ export default class LogicFlow {
|
|
|
133
133
|
setTheme(style: Theme): void;
|
|
134
134
|
/**
|
|
135
135
|
* 重新设置画布的宽高
|
|
136
|
+
* 不传会自动计算画布宽高
|
|
136
137
|
*/
|
|
137
|
-
resize(width
|
|
138
|
+
resize(width?: number, height?: number): void;
|
|
138
139
|
/**
|
|
139
140
|
* 设置默认的边类型。
|
|
140
141
|
* 也就是设置在节点直接有用户手动绘制的连线类型。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IBaseModel } from '../BaseModel';
|
|
2
2
|
import GraphModel from '../GraphModel';
|
|
3
|
-
import { Point, AdditionData, EdgeData, MenuConfig, EdgeConfig } from '../../type/index';
|
|
3
|
+
import { Point, AdditionData, EdgeData, MenuConfig, EdgeConfig, ShapeStyleAttribute } from '../../type/index';
|
|
4
4
|
import { ModelType, ElementType } from '../../constant/constant';
|
|
5
5
|
import { OutlineTheme } from '../../constant/DefaultTheme';
|
|
6
6
|
declare class BaseEdgeModel implements IBaseModel {
|
|
@@ -37,6 +37,11 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
37
37
|
menu?: MenuConfig[];
|
|
38
38
|
customTextPosition: boolean;
|
|
39
39
|
animationData: import("../../constant/DefaultAnimation").Animation;
|
|
40
|
+
style: ShapeStyleAttribute;
|
|
41
|
+
arrowConfig: {
|
|
42
|
+
markerEnd: string;
|
|
43
|
+
markerStart: string;
|
|
44
|
+
};
|
|
40
45
|
[propName: string]: any;
|
|
41
46
|
constructor(data: EdgeConfig, graphModel: GraphModel);
|
|
42
47
|
/**
|
|
@@ -62,7 +67,12 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
62
67
|
* 获取当前节点样式
|
|
63
68
|
* @returns 自定义边样式
|
|
64
69
|
*/
|
|
65
|
-
getEdgeStyle():
|
|
70
|
+
getEdgeStyle(): {
|
|
71
|
+
[x: string]: any;
|
|
72
|
+
fill?: string;
|
|
73
|
+
stroke?: string;
|
|
74
|
+
strokeWidth?: number;
|
|
75
|
+
};
|
|
66
76
|
/**
|
|
67
77
|
* @overridable 支持重写
|
|
68
78
|
* 获取当前节点文本样式
|
|
@@ -118,6 +128,9 @@ declare class BaseEdgeModel implements IBaseModel {
|
|
|
118
128
|
getHistoryData(): EdgeData;
|
|
119
129
|
setProperty(key: any, val: any): void;
|
|
120
130
|
setProperties(properties: any): void;
|
|
131
|
+
setStyle(key: any, val: any): void;
|
|
132
|
+
setStyles(styles: any): void;
|
|
133
|
+
updateStyles(styles: any): void;
|
|
121
134
|
/**
|
|
122
135
|
* 内部方法,处理初始化文本格式
|
|
123
136
|
*/
|
|
@@ -49,6 +49,7 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
49
49
|
zIndex: number;
|
|
50
50
|
state: number;
|
|
51
51
|
autoToFront: boolean;
|
|
52
|
+
style: ShapeStyleAttribute;
|
|
52
53
|
readonly BaseType = ElementType.NODE;
|
|
53
54
|
modelType: ModelType;
|
|
54
55
|
additionStateData: AdditionData;
|
|
@@ -192,6 +193,9 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
192
193
|
setElementState(state: number, additionStateData?: AdditionData): void;
|
|
193
194
|
setProperty(key: any, val: any): void;
|
|
194
195
|
setProperties(properties: any): void;
|
|
196
|
+
setStyle(key: any, val: any): void;
|
|
197
|
+
setStyles(styles: any): void;
|
|
198
|
+
updateStyles(styles: any): void;
|
|
195
199
|
setZIndex(zindex?: number): void;
|
|
196
200
|
updateAttributes(attributes: any): void;
|
|
197
201
|
}
|
package/types/type/index.d.ts
CHANGED
|
@@ -382,4 +382,25 @@ export declare type VirtualRectSize = {
|
|
|
382
382
|
virtualRectCenterPositionX: number;
|
|
383
383
|
virtualRectCenterPositionY: number;
|
|
384
384
|
};
|
|
385
|
+
export declare type ArrowPath = {
|
|
386
|
+
d: string;
|
|
387
|
+
stroke?: string;
|
|
388
|
+
fill?: string;
|
|
389
|
+
transform?: string;
|
|
390
|
+
[key: string]: any;
|
|
391
|
+
};
|
|
392
|
+
export declare type ArrowMarker = {
|
|
393
|
+
id: string;
|
|
394
|
+
refX?: string | number;
|
|
395
|
+
refY?: string | number;
|
|
396
|
+
overflow?: string;
|
|
397
|
+
orient?: string;
|
|
398
|
+
markerUnits?: string;
|
|
399
|
+
viewBox?: string;
|
|
400
|
+
markerWidth?: number;
|
|
401
|
+
markerHeight?: number;
|
|
402
|
+
path: ArrowPath;
|
|
403
|
+
[key: string]: any;
|
|
404
|
+
};
|
|
405
|
+
export declare type ArrowMarkerList = ArrowMarker[];
|
|
385
406
|
export {};
|
|
@@ -17,6 +17,8 @@ export default class BaseEdge extends Component<IProps> {
|
|
|
17
17
|
getArrowInfo(): ArrowInfo;
|
|
18
18
|
getArrowStyle(): ArrowStyle;
|
|
19
19
|
getArrow(): h.JSX.Element;
|
|
20
|
+
getStartArrow(): h.JSX.Element;
|
|
21
|
+
getEndArrow(): h.JSX.Element;
|
|
20
22
|
getAdjustPoints(): h.JSX.Element;
|
|
21
23
|
getAnimation(): void;
|
|
22
24
|
getAppendWidth(): h.JSX.Element;
|