@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/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "1.1.18",
3
+ "version": "1.1.21",
4
4
  "description": "LogicFlow core, to quickly build flowchart editor",
5
- "main": "dist/logic-flow.js",
6
- "unpkg": "dist/logic-flow.js",
7
- "jsdelivr": "dist/logic-flow.js",
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 && cp -r src/style/ dist/style",
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",
@@ -133,8 +133,9 @@ export default class LogicFlow {
133
133
  setTheme(style: Theme): void;
134
134
  /**
135
135
  * 重新设置画布的宽高
136
+ * 不传会自动计算画布宽高
136
137
  */
137
- resize(width: number, height: number): void;
138
+ resize(width?: number, height?: number): void;
138
139
  /**
139
140
  * 设置默认的边类型。
140
141
  * 也就是设置在节点直接有用户手动绘制的连线类型。
@@ -89,6 +89,7 @@ export default class EditConfigModel {
89
89
  edgeTextEdit: boolean;
90
90
  nodeTextDraggable: boolean;
91
91
  edgeTextDraggable: boolean;
92
+ autoExpand: boolean;
92
93
  multipleSelectKey: string;
93
94
  defaultConfig: {};
94
95
  constructor(config: EditConfigInterface);
@@ -417,7 +417,7 @@ declare class GraphModel {
417
417
  /**
418
418
  * 重新设置画布的宽高
419
419
  */
420
- resize(width: number, height: number): void;
420
+ resize(width?: number, height?: number): void;
421
421
  /**
422
422
  * 清空画布
423
423
  */
@@ -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(): import("../../constant/DefaultTheme").CommonTheme;
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
  }
@@ -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;