@logicflow/core 1.2.0-alpha.13 → 1.2.0-alpha.16

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.
@@ -37,7 +37,7 @@
37
37
  stroke-dashoffset: 100%;
38
38
  animation: dash 5s linear infinite;
39
39
  }
40
- @keyframes dash {
40
+ @keyframes lf-dash {
41
41
  to {
42
42
  stroke-dashoffset: 0;
43
43
  }
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "1.2.0-alpha.13",
3
+ "version": "1.2.0-alpha.16",
4
4
  "description": "LogicFlow core, to quickly build flowchart editor",
5
5
  "main": "dist/entry.js",
6
+ "module": "dist/logic-flow.js",
6
7
  "unpkg": "dist/logic-flow.min.js",
8
+ "sideEffects": true,
7
9
  "jsdelivr": "dist/logic-flow.min.js",
8
10
  "license": "Apache-2.0",
9
11
  "homepage": "http://logic-flow.org/",
@@ -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 && cp scripts/entry.js dist",
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 ./tempTypes --outDir temp && rimraf types && mv ./tempTypes/src ./types && rimraf temp && rimraf tempTypes",
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",
@@ -125,8 +125,9 @@ export default class LogicFlow {
125
125
  setTheme(style: Theme): void;
126
126
  /**
127
127
  * 重新设置画布的宽高
128
+ * 不传会自动计算画布宽高
128
129
  */
129
- resize(width: number, height: number): void;
130
+ resize(width?: number, height?: number): void;
130
131
  /**
131
132
  * 设置默认的边类型。
132
133
  * 也就是设置在节点直接有用户手动绘制的连线类型。
@@ -381,6 +382,10 @@ export default class LogicFlow {
381
382
  x: number;
382
383
  y: number;
383
384
  };
385
+ /**
386
+ * 获取节点或边对象
387
+ * @param id id
388
+ */
384
389
  canvasOverlayPosition: {
385
390
  x: number;
386
391
  y: number;
@@ -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
  */
@@ -31,6 +31,9 @@ export declare type Point = {
31
31
  y: number;
32
32
  [key: string]: unknown;
33
33
  };
34
+ export declare type Vector2 = [number, number];
35
+ export declare type DirectionVectorNumber = 0 | 1 | -1;
36
+ export declare type DirectionVector2 = [DirectionVectorNumber, DirectionVectorNumber];
34
37
  /**
35
38
  * 锚点坐标
36
39
  * 为了方便计算
@@ -0,0 +1,4 @@
1
+ import { DirectionVector2, Point } from '../type';
2
+ export declare const getDirectionVector: (point1: Point, point2: Point) => DirectionVector2;
3
+ export declare const isSameDirection: (v1: DirectionVector2, v2: DirectionVector2) => boolean;
4
+ export declare const isContraryDirection: (v1: DirectionVector2, v2: DirectionVector2) => boolean;