Move utils source into src/

This commit is contained in:
Marcel Mraz 2025-03-24 12:15:37 +01:00
parent ba0a9e0cb4
commit 4a182f985b
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
31 changed files with 47 additions and 49 deletions

View file

@ -12,13 +12,9 @@ import {
import type { Curve } from "@excalidraw/math";
import {
pointInEllipse,
pointOnEllipse,
type GeometricShape,
} from "./geometry/shape";
import { pointInEllipse, pointOnEllipse, type GeometricShape } from "./shape";
import type { Polycurve, Polyline } from "./geometry/shape";
import type { Polycurve, Polyline } from "./shape";
// check if the given point is considered on the given shape's border
export const isPointOnShape = <Point extends GlobalPoint | LocalPoint>(

View file

@ -9,9 +9,9 @@ import {
import type { Curve, Degrees, GlobalPoint } from "@excalidraw/math";
import { pointOnCurve, pointOnPolyline } from "./collision";
import { pointOnCurve, pointOnPolyline } from "../src/collision";
import type { Polyline } from "./geometry/shape";
import type { Polyline } from "../src/shape";
describe("point and curve", () => {
const c: Curve<GlobalPoint> = curve(

View file

@ -3,7 +3,7 @@ import * as mockedSceneExportUtils from "@excalidraw/excalidraw/scene/export";
import { diagramFactory } from "@excalidraw/excalidraw/tests/fixtures/diagramFixture";
import { vi } from "vitest";
import * as utils from ".";
import * as utils from "../src";
const exportToSvgSpy = vi.spyOn(mockedSceneExportUtils, "exportToSvg");

View file

@ -15,7 +15,7 @@ import type {
Radians,
} from "@excalidraw/math";
import { pointInEllipse, pointOnEllipse, type Ellipse } from "./shape";
import { pointInEllipse, pointOnEllipse, type Ellipse } from "../src/shape";
describe("point and line", () => {
// const l: Line<GlobalPoint> = line(point(1, 0), point(1, 2));

View file

@ -4,7 +4,7 @@ import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
import * as utils from "./index";
import * as utils from "../src";
// NOTE this test file is using the actual API, unmocked. Hence splitting it
// from the other test file, because I couldn't figure out how to test

View file

@ -6,7 +6,7 @@ import {
elementPartiallyOverlapsWithOrContainsBBox,
elementsOverlappingBBox,
isElementInsideBBox,
} from "./withinBounds";
} from "../src/withinBounds";
const makeElement = (x: number, y: number, width: number, height: number) =>
API.createElement({