@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.
Files changed (46) hide show
  1. package/README.md +1 -0
  2. package/dist/dev/{chunk-3O3BNMYV.js → chunk-UGZAZPWM.js} +1143 -848
  3. package/dist/dev/chunk-UGZAZPWM.js.map +7 -0
  4. package/dist/dev/data/{image-EN763OZS.js → image-NQXTDRIN.js} +2 -2
  5. package/dist/dev/index.js +6 -8
  6. package/dist/dev/index.js.map +2 -2
  7. package/dist/prod/chunk-44FFCT2W.js +34 -0
  8. package/dist/prod/data/{image-XQM6YLGO.js → image-WYICPQ4X.js} +1 -1
  9. package/dist/prod/index.js +2 -2
  10. package/dist/types/excalidraw/actions/actionCanvas.d.ts +5 -5
  11. package/dist/types/excalidraw/actions/actionExport.d.ts +7 -7
  12. package/dist/types/excalidraw/actions/actionFrame.d.ts +1 -1
  13. package/dist/types/excalidraw/actions/actionZindex.d.ts +2 -2
  14. package/dist/types/excalidraw/appState.d.ts +8 -8
  15. package/dist/types/excalidraw/clipboard.d.ts +4 -4
  16. package/dist/types/excalidraw/constants.d.ts +1 -0
  17. package/dist/types/excalidraw/data/blob.d.ts +1 -1
  18. package/dist/types/excalidraw/element/binding.d.ts +1 -2
  19. package/dist/types/excalidraw/element/collision.d.ts +10 -1
  20. package/dist/types/excalidraw/element/distance.d.ts +3 -0
  21. package/dist/types/excalidraw/element/newElement.d.ts +1 -1
  22. package/dist/types/excalidraw/element/transformHandles.d.ts +2 -2
  23. package/dist/types/excalidraw/element/utils.d.ts +21 -0
  24. package/dist/types/excalidraw/shapes.d.ts +1 -1
  25. package/dist/types/excalidraw/utils.d.ts +3 -3
  26. package/dist/types/excalidraw/visualdebug.d.ts +7 -8
  27. package/dist/types/excalidraw/zindex.d.ts +2 -2
  28. package/dist/types/math/curve.d.ts +22 -14
  29. package/dist/types/math/ellipse.d.ts +44 -0
  30. package/dist/types/math/index.d.ts +1 -1
  31. package/dist/types/math/line.d.ts +2 -30
  32. package/dist/types/math/point.d.ts +1 -29
  33. package/dist/types/math/rectangle.d.ts +3 -0
  34. package/dist/types/math/segment.d.ts +8 -1
  35. package/dist/types/math/types.d.ts +15 -6
  36. package/dist/types/math/vector.d.ts +0 -4
  37. package/package.json +1 -1
  38. package/dist/dev/chunk-3O3BNMYV.js.map +0 -7
  39. package/dist/prod/chunk-ELWWJGPE.js +0 -34
  40. package/dist/types/math/arc.d.ts +0 -6
  41. package/dist/types/math/ga/ga.d.ts +0 -63
  42. package/dist/types/math/ga/gadirections.d.ts +0 -8
  43. package/dist/types/math/ga/galines.d.ts +0 -22
  44. package/dist/types/math/ga/gapoints.d.ts +0 -7
  45. package/dist/types/math/ga/gatransforms.d.ts +0 -10
  46. /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
- * Angles are in radians and centered on 0, 0. Zero radians on a 1 radius circle
90
- * corresponds to (1, 0) cartesian coordinates (point), i.e. to the "right".
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 SymmetricArc = {
93
- radius: number;
94
- startAngle: number;
95
- endAngle: number;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/excalidraw",
3
- "version": "0.18.0-rc.4",
3
+ "version": "0.18.0-rc.5",
4
4
  "type": "module",
5
5
  "types": "./dist/types/excalidraw/index.d.ts",
6
6
  "main": "./dist/prod/index.js",