Fixing math package

This commit is contained in:
Marcel Mraz 2025-03-17 14:05:13 +01:00
parent 44d8a6b4fe
commit 5e68895709
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
26 changed files with 37 additions and 37 deletions

View file

@ -17,10 +17,10 @@ import type {
Radians,
} from "@excalidraw/math";
import { rescalePoints } from "../points";
import { generateRoughOptions } from "../scene/Shape";
import { ShapeCache } from "../scene/ShapeCache";
import { arrayToMap, invariant } from "../utils";
import { rescalePoints } from "@excalidraw/excalidraw/points";
import { generateRoughOptions } from "@excalidraw/excalidraw/scene/Shape";
import { ShapeCache } from "@excalidraw/excalidraw/scene/ShapeCache";
import { arrayToMap, invariant } from "@excalidraw/excalidraw/utils";
import { LinearElementEditor } from "./linearElementEditor";
import { getBoundTextElement, getContainerElement } from "./textElement";

View file

@ -1,12 +1,12 @@
export * from "./angle";
export * from "./curve";
export * from "./line";
export * from "./point";
export * from "./polygon";
export * from "./range";
export * from "./rectangle";
export * from "./segment";
export * from "./triangle";
export * from "./types";
export * from "./vector";
export * from "./utils";
export * from "./src/angle";
export * from "./src/curve";
export * from "./src/line";
export * from "./src/point";
export * from "./src/polygon";
export * from "./src/range";
export * from "./src/rectangle";
export * from "./src/segment";
export * from "./src/triangle";
export * from "./src/types";
export * from "./src/vector";
export * from "./src/utils";

View file

@ -1,4 +1,4 @@
import { toBrandedType } from "@excalidraw/common/utils";
import { toBrandedType } from "@excalidraw/common";
import type { InclusiveRange } from "./types";

View file

@ -1,13 +1,13 @@
import "../utils/test-utils";
import "../../utils/test-utils";
import {
curve,
curveClosestPoint,
curveIntersectLineSegment,
curvePointDistance,
} from "./curve";
import { pointFrom } from "./point";
import { lineSegment } from "./segment";
} from "../src/curve";
import { pointFrom } from "../src/point";
import { lineSegment } from "../src/segment";
describe("Math curve", () => {
describe("line segment intersection", () => {

View file

@ -4,12 +4,12 @@ import {
ellipseIncludesPoint,
ellipseTouchesPoint,
ellipseLineIntersectionPoints,
} from "./ellipse";
import { line } from "./line";
import { pointFrom } from "./point";
import { lineSegment } from "./segment";
} from "../src/ellipse";
import { line } from "../src/line";
import { pointFrom } from "../src/point";
import { lineSegment } from "../src/segment";
import type { Ellipse, GlobalPoint } from "./types";
import type { Ellipse, GlobalPoint } from "../src/types";
describe("point and ellipse", () => {
it("point on ellipse", () => {

View file

@ -1,5 +1,5 @@
import { line, linesIntersectAt } from "./line";
import { pointFrom } from "./point";
import { line, linesIntersectAt } from "../src/line";
import { pointFrom } from "../src/point";
describe("line-line intersections", () => {
it("should correctly detect intersection at origin", () => {

View file

@ -1,6 +1,6 @@
import { pointFrom, pointRotateRads } from "./point";
import { pointFrom, pointRotateRads } from "../src/point";
import type { Radians } from "./types";
import type { Radians } from "../src/types";
describe("rotate", () => {
it("should rotate over (x2, y2) and return the rotated coordinates for (x1, y1)", () => {

View file

@ -1,4 +1,4 @@
import { rangeInclusive, rangeIntersection, rangesOverlap } from "./range";
import { rangeInclusive, rangeIntersection, rangesOverlap } from "../src/range";
describe("range overlap", () => {
const range1_4 = rangeInclusive(1, 4);

View file

@ -1,5 +1,5 @@
import { pointFrom } from "./point";
import { lineSegment, lineSegmentIntersectionPoints } from "./segment";
import { pointFrom } from "../src/point";
import { lineSegment, lineSegmentIntersectionPoints } from "../src/segment";
describe("line-segment intersections", () => {
it("should correctly detect intersection", () => {

View file

@ -1,4 +1,4 @@
import { isVector } from ".";
import { isVector } from "../src/vector";
describe("Vector", () => {
test("isVector", () => {

View file

@ -19,7 +19,7 @@
"@excalidraw/excalidraw": ["./excalidraw/index.tsx"],
"@excalidraw/excalidraw/*": ["./excalidraw/*"],
"@excalidraw/math": ["./math/index.ts"],
"@excalidraw/math/*": ["./math/*"],
"@excalidraw/math/*": ["./math/src/*"],
"@excalidraw/utils": ["./utils/index.ts"],
"@excalidraw/utils/*": ["./utils/*"],
}

View file

@ -14,7 +14,7 @@ const getConfig = (outdir) => ({
entryNames: "[name]",
assetNames: "[dir]/[name]",
alias: {
"@excalidraw/common": path.resolve(__dirname, "../packages/common/src"),
"@excalidraw/common": path.resolve(__dirname, "../packages/common"),
"@excalidraw/element": path.resolve(__dirname, "../packages/element"),
"@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"),
"@excalidraw/utils": path.resolve(__dirname, "../packages/utils"),

View file

@ -26,7 +26,7 @@
"@excalidraw/element": ["./packages/element/index.ts"],
"@excalidraw/element/*": ["./packages/element/*"],
"@excalidraw/math": ["./packages/math/index.ts"],
"@excalidraw/math/*": ["./packages/math/*"],
"@excalidraw/math/*": ["./packages/math/src/*"],
"@excalidraw/utils": ["./packages/utils/index.ts"],
"@excalidraw/utils/*": ["./packages/utils/*"],
}