@plait/core 0.30.0 → 0.32.0
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/esm2022/interfaces/point.mjs +7 -1
- package/esm2022/plugins/with-moving.mjs +10 -5
- package/esm2022/plugins/with-selection.mjs +25 -20
- package/esm2022/transforms/selection.mjs +2 -2
- package/esm2022/utils/draw/arrow.mjs +4 -4
- package/esm2022/utils/math.mjs +4 -1
- package/esm2022/utils/reaction-manager.mjs +2 -1
- package/esm2022/utils/selected-element.mjs +9 -4
- package/fesm2022/plait-core.mjs +55 -30
- package/fesm2022/plait-core.mjs.map +1 -1
- package/interfaces/point.d.ts +2 -0
- package/package.json +1 -1
- package/styles/styles.scss +9 -0
- package/utils/draw/arrow.d.ts +1 -1
- package/utils/math.d.ts +1 -0
package/interfaces/point.d.ts
CHANGED
|
@@ -5,4 +5,6 @@ export interface XYPosition {
|
|
|
5
5
|
}
|
|
6
6
|
export declare const Point: {
|
|
7
7
|
isEquals(point?: Point, otherPoint?: Point): boolean | undefined;
|
|
8
|
+
isHorizontalAlign(point?: Point, otherPoint?: Point, tolerance?: number): boolean | undefined;
|
|
9
|
+
isVerticalAlign(point?: Point, otherPoint?: Point, tolerance?: number): boolean | undefined;
|
|
8
10
|
};
|
package/package.json
CHANGED
package/styles/styles.scss
CHANGED
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
|
|
10
|
+
// safari can not set this style, it will prevent text being from selected in edit mode
|
|
11
|
+
// resolve the issue text being selected when user drag and move on board in firefox
|
|
12
|
+
&.firefox {
|
|
13
|
+
user-select: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
10
16
|
.viewport-container {
|
|
11
17
|
width: 100%;
|
|
12
18
|
height: 100%;
|
|
@@ -43,6 +49,9 @@
|
|
|
43
49
|
}
|
|
44
50
|
}
|
|
45
51
|
|
|
52
|
+
&.ns-resize {
|
|
53
|
+
cursor: ns-resize;
|
|
54
|
+
}
|
|
46
55
|
&.ew-resize {
|
|
47
56
|
cursor: ew-resize;
|
|
48
57
|
}
|
package/utils/draw/arrow.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RoughSVG } from 'roughjs/bin/svg';
|
|
2
2
|
import { Options } from 'roughjs/bin/core';
|
|
3
3
|
import { Point } from '../../interfaces';
|
|
4
|
-
export declare function arrowPoints(start: Point, end: Point,
|
|
4
|
+
export declare function arrowPoints(start: Point, end: Point, degree?: number): {
|
|
5
5
|
pointLeft: Point;
|
|
6
6
|
pointRight: Point;
|
|
7
7
|
};
|
package/utils/math.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export declare const isPolylineHitRectangle: (points: Point[], rectangle: Rectan
|
|
|
12
12
|
export declare const isPointInPolygon: (point: Point, points: Point[]) => boolean;
|
|
13
13
|
export declare const isPointInEllipse: (point: Point, center: Point, rx: number, ry: number, rotation?: number) => boolean;
|
|
14
14
|
export declare const isPointInRoundRectangle: (point: Point, rectangle: RectangleClient, radius: number) => boolean;
|
|
15
|
+
export declare const downScale: (number: number) => number;
|