Fix lint issues

This commit is contained in:
Mark Tolmacs 2025-05-02 13:57:08 +02:00
parent 820a8540b1
commit af428d472c
No known key found for this signature in database
9 changed files with 146 additions and 136 deletions

View file

@ -12,7 +12,12 @@ import type Scene from "@excalidraw/element/Scene";
import { angleIcon } from "../icons";
import DragInput from "./DragInput";
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable, updateBindings } from "./utils";
import {
type DragInputCallbackType,
getStepSizedValue,
isPropertyEditable,
updateBindings,
} from "./utils";
import type { AppState } from "../../types";

View file

@ -13,7 +13,11 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import type Scene from "@excalidraw/element/Scene";
import DragInput from "./DragInput";
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable } from "./utils";
import {
type DragInputCallbackType,
getStepSizedValue,
isPropertyEditable,
} from "./utils";
import type { AppState } from "../../types";

View file

@ -13,7 +13,7 @@ import { CaptureUpdateAction } from "../../store";
import { useApp } from "../App";
import { InlineIcon } from "../InlineIcon";
import { DragInputCallbackType, SMALLEST_DELTA } from "./utils";
import { type DragInputCallbackType, SMALLEST_DELTA } from "./utils";
import "./DragInput.scss";

View file

@ -17,7 +17,7 @@ import type Scene from "@excalidraw/element/Scene";
import { fontSizeIcon } from "../icons";
import StatsDragInput from "./DragInput";
import { DragInputCallbackType, getStepSizedValue } from "./utils";
import { type DragInputCallbackType, getStepSizedValue } from "./utils";
import type { AppState } from "../../types";

View file

@ -14,7 +14,11 @@ import type Scene from "@excalidraw/element/Scene";
import { angleIcon } from "../icons";
import DragInput from "./DragInput";
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable } from "./utils";
import {
type DragInputCallbackType,
getStepSizedValue,
isPropertyEditable,
} from "./utils";
import type { AppState } from "../../types";

View file

@ -26,7 +26,7 @@ import type Scene from "@excalidraw/element/Scene";
import DragInput from "./DragInput";
import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
import { DragInputCallbackType, getElementsInAtomicUnit } from "./utils";
import { type DragInputCallbackType, getElementsInAtomicUnit } from "./utils";
import type { AtomicUnit } from "./utils";
import type { AppState } from "../../types";

View file

@ -10,10 +10,8 @@ import type Scene from "@excalidraw/element/Scene";
import StatsDragInput from "./DragInput";
import { handlePositionChange } from "./utils";
import type { AtomicUnit } from "./utils";
import type { AppState } from "../../types";
import { getFrameChildren } from "@excalidraw/element/frame";
import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
import type { AtomicUnit } from "./utils";
interface MultiPositionProps {
property: "x" | "y";

View file

@ -1,9 +1,7 @@
import { pointFrom, pointRotateRads, round } from "@excalidraw/math";
import {
getFlipAdjustedCropPosition,
} from "@excalidraw/element/cropElement";
import { isFrameLikeElement, isImageElement } from "@excalidraw/element/typeChecks";
import { getFlipAdjustedCropPosition } from "@excalidraw/element/cropElement";
import { isImageElement } from "@excalidraw/element/typeChecks";
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
@ -13,7 +11,6 @@ import StatsDragInput from "./DragInput";
import { handlePositionChange } from "./utils";
import type { AppState } from "../../types";
import { getFrameChildren } from "@excalidraw/element/frame";
interface PositionProps {
property: "x" | "y";

View file

@ -7,7 +7,6 @@ import {
import { getBoundTextElement } from "@excalidraw/element/textElement";
import { getCommonBounds } from "@excalidraw/element/bounds";
import {
isFrameChildElement,
isFrameLikeElement,
isLinearElement,
isTextElement,
@ -19,6 +18,8 @@ import {
isInGroup,
} from "@excalidraw/element/groups";
import { getFrameChildren } from "@excalidraw/element/frame";
import type { Radians } from "@excalidraw/math";
import type {
@ -30,7 +31,6 @@ import type {
import type Scene from "@excalidraw/element/Scene";
import type { AppState } from "../../types";
import { getFrameChildren } from "@excalidraw/element/frame";
export type StatsInputProperty =
| "x"
@ -194,10 +194,13 @@ export const moveElement = (
}
if (isFrameLikeElement(originalElement)) {
getFrameChildren(originalElementsMap, originalElement.id).forEach(child => {
getFrameChildren(originalElementsMap, originalElement.id).forEach(
(child) => {
const latestChildElement = elementsMap.get(child.id);
if (!latestChildElement) return;
if (!latestChildElement) {
return;
}
const [childCX, childCY] = [
child.x + child.width / 2,
@ -244,7 +247,8 @@ export const moveElement = (
{ informMutation: shouldInformMutation, isDragging: false },
);
}
})
},
);
}
};
@ -368,9 +372,7 @@ export const updateBindings = (
}
};
export const handlePositionChange: DragInputCallbackType<
"x" | "y"
> = ({
export const handlePositionChange: DragInputCallbackType<"x" | "y"> = ({
accumulatedChange,
originalElements,
originalElementsMap,