@logicflow/core 1.0.5 → 1.0.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "LogicFlow core, to quickly build flowchart editor",
5
5
  "main": "dist/logic-flow.js",
6
6
  "unpkg": "dist/logic-flow.js",
@@ -42,6 +42,13 @@ export default class LogicFlow {
42
42
  options: Options.Definition;
43
43
  snaplineModel: SnaplineModel;
44
44
  components: ComponentRender[];
45
+ /**
46
+ * 个性配置的插件,覆盖全局配置的插件
47
+ */
48
+ plugins: Extension[];
49
+ /**
50
+ * 全局配置的插件,所有的LogicFlow都会使用
51
+ */
45
52
  static extensions: Map<string, Extension>;
46
53
  /**
47
54
  * 自定义数据格式转换方法
@@ -195,7 +202,7 @@ export default class LogicFlow {
195
202
  * })
196
203
  * @param {object} edgeConfig
197
204
  */
198
- addEdge(edgeConfig: EdgeConfig): void;
205
+ addEdge(edgeConfig: EdgeConfig): _Model.BaseEdgeModel;
199
206
  /**
200
207
  * 删除边
201
208
  * @param {string} edgeId 边Id
@@ -284,7 +284,7 @@ declare class GraphModel {
284
284
  * 给两个节点之间添加一条边
285
285
  * @param {object} edgeConfig
286
286
  */
287
- addEdge(edgeConfig: EdgeConfig): EdgeConfig;
287
+ addEdge(edgeConfig: EdgeConfig): BaseEdgeModel;
288
288
  /**
289
289
  * 移动边,内部方法,请勿直接使用
290
290
  */
@@ -1,6 +1,6 @@
1
1
  import { GridOptions } from './view/overlay/Grid';
2
2
  import { BackgroundConfig } from './view/overlay/BackgroundOverlay';
3
- import { NodeData, EdgeData, GraphConfigData } from './type';
3
+ import { NodeData, EdgeData, Extension, GraphConfigData } from './type';
4
4
  import { KeyboardDef } from './keyboard';
5
5
  import { EditConfigInterface } from './model/EditConfigModel';
6
6
  import { Theme } from './constant/DefaultTheme';
@@ -85,6 +85,10 @@ export declare type Definition = {
85
85
  * todo: 将multipleSelect放到插件中
86
86
  */
87
87
  disabledTools?: string[];
88
+ /**
89
+ * 是否配置个性插件,覆盖全局配置的插件
90
+ */
91
+ plugins?: Extension[];
88
92
  [key: string]: any;
89
93
  } & EditConfigInterface;
90
94
  export interface GuardsTypes {
@@ -169,6 +173,10 @@ export declare function get(options: Definition): {
169
173
  * todo: 将multipleSelect放到插件中
170
174
  */
171
175
  disabledTools?: string[];
176
+ /**
177
+ * 是否配置个性插件,覆盖全局配置的插件
178
+ */
179
+ plugins?: Extension[];
172
180
  } & EditConfigInterface;
173
181
  export declare const defaults: {
174
182
  background: boolean;
@@ -56,7 +56,7 @@ export declare const isSegmentsInNode: (start: Point, end: Point, node: BaseNode
56
56
  export declare const isSegmentsCrossNode: (start: Point, end: Point, node: BaseNode) => boolean;
57
57
  export declare const getCrossPointInRect: (start: Point, end: Point, node: BaseNode) => Point;
58
58
  export declare const segmentDirection: (start: Point, end: Point) => Direction;
59
- export declare const poins2PointsList: (points: string) => PolyPoint[];
59
+ export declare const points2PointsList: (points: string) => PolyPoint[];
60
60
  export declare const getSimplePoints: (start: any, end: any, sPoint: any, tPoint: any) => Point[];
61
61
  export declare const getBytesLength: (word: string) => number;
62
62
  export declare const getTextWidth: (text: any, font: any) => any;
@@ -67,7 +67,7 @@ declare type AppendAttributesType = {
67
67
  strokeWidth: number;
68
68
  strokeDasharray: string;
69
69
  };
70
- export declare const getAppendAttibutes: (appendInfo: any) => AppendAttributesType;
70
+ export declare const getAppendAttributes: (appendInfo: any) => AppendAttributesType;
71
71
  export declare type IBezierControls = {
72
72
  sNext: Point;
73
73
  ePre: Point;
@@ -15,7 +15,7 @@ declare type IProps = {
15
15
  style: ArrowStyle;
16
16
  };
17
17
  export default class Arrow extends Component<IProps> {
18
- getArrowAttibutes(): ArrowAttributesType;
18
+ getArrowAttributes(): ArrowAttributesType;
19
19
  getShape(): h.JSX.Element;
20
20
  render(): h.JSX.Element;
21
21
  }
@@ -25,7 +25,7 @@ export default class PolylineEdge extends BaseEdge {
25
25
  getEdge(): h.JSX.Element;
26
26
  getShape(): h.JSX.Element;
27
27
  getArrowInfo(): ArrowInfo;
28
- getAppendAttibutes(appendInfo: AppendInfo): AppendAttributesType;
28
+ getAppendAttributes(appendInfo: AppendInfo): AppendAttributesType;
29
29
  getAppendShape(appendInfo: AppendInfo): h.JSX.Element;
30
30
  getAppendWidth(): h.JSX.Element;
31
31
  }