@plait/core 0.82.0-next.0 → 0.83.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.
|
@@ -4,6 +4,8 @@ export declare enum Direction {
|
|
|
4
4
|
right = "right",
|
|
5
5
|
bottom = "bottom"
|
|
6
6
|
}
|
|
7
|
+
export declare const isHorizontalDirection: (direction: Direction) => direction is Direction.left | Direction.right;
|
|
8
|
+
export declare const isVerticalDirection: (direction: Direction) => direction is Direction.top | Direction.bottom;
|
|
7
9
|
export type Vector = [number, number];
|
|
8
10
|
export type DirectionFactor = -1 | 0 | 1;
|
|
9
11
|
export type DirectionFactors = [DirectionFactor, DirectionFactor];
|
package/package.json
CHANGED
package/utils/helper.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function normalizePoint(point: number[]): {
|
|
|
9
9
|
x: number;
|
|
10
10
|
y: number;
|
|
11
11
|
};
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const rgbaToHEX: (rgb: string, opacity: number) => string;
|
|
13
13
|
export declare function isContextmenu(event: MouseEvent): boolean;
|
|
14
14
|
export declare function uniqueById(elements: PlaitElement[]): any[];
|
|
15
15
|
export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
package/utils/to-point.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Point } from '../interfaces/point';
|
|
|
4
4
|
export declare const getViewBox: (board: PlaitBoard) => DOMRect;
|
|
5
5
|
/**
|
|
6
6
|
* Get the screen point starting from the upper left corner of the svg element (based on the svg screen coordinate system)
|
|
7
|
+
* reference: https://github.com/worktile/plait/blob/develop/packages/core/src/utils/to-point.md
|
|
7
8
|
*/
|
|
8
9
|
export declare function toHostPoint(board: PlaitBoard, x: number, y: number): Point;
|
|
9
10
|
export declare function toActiveRectangleFromViewBoxRectangle(board: PlaitBoard, rectangle: RectangleClient): RectangleClient;
|
|
@@ -15,6 +16,7 @@ export declare function toActivePoint(board: PlaitBoard, x: number, y: number):
|
|
|
15
16
|
export declare function toScreenPointFromActivePoint(board: PlaitBoard, activePoint: Point): Point;
|
|
16
17
|
/**
|
|
17
18
|
* Get the point in the coordinate system of the svg viewBox
|
|
19
|
+
* reference: https://github.com/worktile/plait/blob/develop/packages/core/src/utils/to-point.md
|
|
18
20
|
*/
|
|
19
21
|
export declare function toViewBoxPoint(board: PlaitBoard, hostPoint: Point): Point;
|
|
20
22
|
export declare function toViewBoxPoints(board: PlaitBoard, hostPoints: Point[]): Point[];
|