@excalidraw/excalidraw 0.18.0-rc.4 → 0.18.0-rc.5
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/README.md +1 -0
- package/dist/dev/{chunk-3O3BNMYV.js → chunk-UGZAZPWM.js} +1143 -848
- package/dist/dev/chunk-UGZAZPWM.js.map +7 -0
- package/dist/dev/data/{image-EN763OZS.js → image-NQXTDRIN.js} +2 -2
- package/dist/dev/index.js +6 -8
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/chunk-44FFCT2W.js +34 -0
- package/dist/prod/data/{image-XQM6YLGO.js → image-WYICPQ4X.js} +1 -1
- package/dist/prod/index.js +2 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +5 -5
- package/dist/types/excalidraw/actions/actionExport.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
- package/dist/types/excalidraw/appState.d.ts +8 -8
- package/dist/types/excalidraw/clipboard.d.ts +4 -4
- package/dist/types/excalidraw/constants.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/element/binding.d.ts +1 -2
- package/dist/types/excalidraw/element/collision.d.ts +10 -1
- package/dist/types/excalidraw/element/distance.d.ts +3 -0
- package/dist/types/excalidraw/element/newElement.d.ts +1 -1
- package/dist/types/excalidraw/element/transformHandles.d.ts +2 -2
- package/dist/types/excalidraw/element/utils.d.ts +21 -0
- package/dist/types/excalidraw/shapes.d.ts +1 -1
- package/dist/types/excalidraw/utils.d.ts +3 -3
- package/dist/types/excalidraw/visualdebug.d.ts +7 -8
- package/dist/types/excalidraw/zindex.d.ts +2 -2
- package/dist/types/math/curve.d.ts +22 -14
- package/dist/types/math/ellipse.d.ts +44 -0
- package/dist/types/math/index.d.ts +1 -1
- package/dist/types/math/line.d.ts +2 -30
- package/dist/types/math/point.d.ts +1 -29
- package/dist/types/math/rectangle.d.ts +3 -0
- package/dist/types/math/segment.d.ts +8 -1
- package/dist/types/math/types.d.ts +15 -6
- package/dist/types/math/vector.d.ts +0 -4
- package/package.json +1 -1
- package/dist/dev/chunk-3O3BNMYV.js.map +0 -7
- package/dist/prod/chunk-ELWWJGPE.js +0 -34
- package/dist/types/math/arc.d.ts +0 -6
- package/dist/types/math/ga/ga.d.ts +0 -63
- package/dist/types/math/ga/gadirections.d.ts +0 -8
- package/dist/types/math/ga/galines.d.ts +0 -22
- package/dist/types/math/ga/gapoints.d.ts +0 -7
- package/dist/types/math/ga/gatransforms.d.ts +0 -10
- /package/dist/dev/data/{image-EN763OZS.js.map → image-NQXTDRIN.js.map} +0 -0
|
@@ -6,7 +6,6 @@ import type { GlobalPoint, LineSegment, LocalPoint, Radians } from "./types";
|
|
|
6
6
|
* @returns The line segment delineated by the points
|
|
7
7
|
*/
|
|
8
8
|
export declare function lineSegment<P extends GlobalPoint | LocalPoint>(a: P, b: P): LineSegment<P>;
|
|
9
|
-
export declare function lineSegmentFromPointArray<P extends GlobalPoint | LocalPoint>(pointArray: P[]): LineSegment<P> | undefined;
|
|
10
9
|
/**
|
|
11
10
|
*
|
|
12
11
|
* @param segment
|
|
@@ -30,3 +29,11 @@ export declare const lineSegmentRotate: <Point extends GlobalPoint | LocalPoint>
|
|
|
30
29
|
export declare const segmentsIntersectAt: <Point extends GlobalPoint | LocalPoint>(a: Readonly<LineSegment<Point>>, b: Readonly<LineSegment<Point>>) => Point | null;
|
|
31
30
|
export declare const pointOnLineSegment: <Point extends GlobalPoint | LocalPoint>(point: Point, line: LineSegment<Point>, threshold?: number) => boolean;
|
|
32
31
|
export declare const distanceToLineSegment: <Point extends GlobalPoint | LocalPoint>(point: Point, line: LineSegment<Point>) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the intersection point of a segment and a line
|
|
34
|
+
*
|
|
35
|
+
* @param l
|
|
36
|
+
* @param s
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
export declare function lineSegmentIntersectionPoints<Point extends GlobalPoint | LocalPoint>(l: LineSegment<Point>, s: LineSegment<Point>): Point | null;
|
|
@@ -62,6 +62,12 @@ export type Triangle<P extends GlobalPoint | LocalPoint> = [
|
|
|
62
62
|
] & {
|
|
63
63
|
_brand: "excalimath__triangle";
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* A rectangular shape represented by 4 points at its corners
|
|
67
|
+
*/
|
|
68
|
+
export type Rectangle<P extends GlobalPoint | LocalPoint> = [a: P, b: P] & {
|
|
69
|
+
_brand: "excalimath__rectangle";
|
|
70
|
+
};
|
|
65
71
|
/**
|
|
66
72
|
* A polygon is a closed shape by connecting the given points
|
|
67
73
|
* rectangles and diamonds are modelled by polygons
|
|
@@ -86,11 +92,14 @@ export type PolarCoords = [
|
|
|
86
92
|
angle: number
|
|
87
93
|
];
|
|
88
94
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
An ellipse is specified by its center, angle, and its major and minor axes
|
|
96
|
+
but for the sake of simplicity, we've used halfWidth and halfHeight instead
|
|
97
|
+
in replace of semi major and semi minor axes
|
|
91
98
|
*/
|
|
92
|
-
export type
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
export type Ellipse<Point extends GlobalPoint | LocalPoint> = {
|
|
100
|
+
center: Point;
|
|
101
|
+
halfWidth: number;
|
|
102
|
+
halfHeight: number;
|
|
103
|
+
} & {
|
|
104
|
+
_brand: "excalimath_ellipse";
|
|
96
105
|
};
|
|
@@ -86,7 +86,3 @@ export declare function vectorMagnitude(v: Vector): number;
|
|
|
86
86
|
* @returns The new normalized vector
|
|
87
87
|
*/
|
|
88
88
|
export declare const vectorNormalize: (v: Vector) => Vector;
|
|
89
|
-
/**
|
|
90
|
-
* Project the first vector onto the second vector
|
|
91
|
-
*/
|
|
92
|
-
export declare const vectorProjection: (a: Vector, b: Vector) => Vector;
|