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, Radians,
} from "@excalidraw/math"; } from "@excalidraw/math";
import { rescalePoints } from "../points"; import { rescalePoints } from "@excalidraw/excalidraw/points";
import { generateRoughOptions } from "../scene/Shape"; import { generateRoughOptions } from "@excalidraw/excalidraw/scene/Shape";
import { ShapeCache } from "../scene/ShapeCache"; import { ShapeCache } from "@excalidraw/excalidraw/scene/ShapeCache";
import { arrayToMap, invariant } from "../utils"; import { arrayToMap, invariant } from "@excalidraw/excalidraw/utils";
import { LinearElementEditor } from "./linearElementEditor"; import { LinearElementEditor } from "./linearElementEditor";
import { getBoundTextElement, getContainerElement } from "./textElement"; import { getBoundTextElement, getContainerElement } from "./textElement";

View file

@ -1,12 +1,12 @@
export * from "./angle"; export * from "./src/angle";
export * from "./curve"; export * from "./src/curve";
export * from "./line"; export * from "./src/line";
export * from "./point"; export * from "./src/point";
export * from "./polygon"; export * from "./src/polygon";
export * from "./range"; export * from "./src/range";
export * from "./rectangle"; export * from "./src/rectangle";
export * from "./segment"; export * from "./src/segment";
export * from "./triangle"; export * from "./src/triangle";
export * from "./types"; export * from "./src/types";
export * from "./vector"; export * from "./src/vector";
export * from "./utils"; 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"; import type { InclusiveRange } from "./types";

View file

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

View file

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

View file

@ -1,5 +1,5 @@
import { line, linesIntersectAt } from "./line"; import { line, linesIntersectAt } from "../src/line";
import { pointFrom } from "./point"; import { pointFrom } from "../src/point";
describe("line-line intersections", () => { describe("line-line intersections", () => {
it("should correctly detect intersection at origin", () => { 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", () => { describe("rotate", () => {
it("should rotate over (x2, y2) and return the rotated coordinates for (x1, y1)", () => { 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", () => { describe("range overlap", () => {
const range1_4 = rangeInclusive(1, 4); const range1_4 = rangeInclusive(1, 4);

View file

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

View file

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

View file

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

View file

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

View file

@ -26,7 +26,7 @@
"@excalidraw/element": ["./packages/element/index.ts"], "@excalidraw/element": ["./packages/element/index.ts"],
"@excalidraw/element/*": ["./packages/element/*"], "@excalidraw/element/*": ["./packages/element/*"],
"@excalidraw/math": ["./packages/math/index.ts"], "@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/index.ts"],
"@excalidraw/utils/*": ["./packages/utils/*"], "@excalidraw/utils/*": ["./packages/utils/*"],
} }