mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix lint issues
This commit is contained in:
parent
820a8540b1
commit
af428d472c
9 changed files with 146 additions and 136 deletions
|
@ -12,7 +12,12 @@ import type Scene from "@excalidraw/element/Scene";
|
||||||
import { angleIcon } from "../icons";
|
import { angleIcon } from "../icons";
|
||||||
|
|
||||||
import DragInput from "./DragInput";
|
import DragInput from "./DragInput";
|
||||||
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable, updateBindings } from "./utils";
|
import {
|
||||||
|
type DragInputCallbackType,
|
||||||
|
getStepSizedValue,
|
||||||
|
isPropertyEditable,
|
||||||
|
updateBindings,
|
||||||
|
} from "./utils";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,11 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
||||||
import type Scene from "@excalidraw/element/Scene";
|
import type Scene from "@excalidraw/element/Scene";
|
||||||
|
|
||||||
import DragInput from "./DragInput";
|
import DragInput from "./DragInput";
|
||||||
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable } from "./utils";
|
import {
|
||||||
|
type DragInputCallbackType,
|
||||||
|
getStepSizedValue,
|
||||||
|
isPropertyEditable,
|
||||||
|
} from "./utils";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { CaptureUpdateAction } from "../../store";
|
||||||
import { useApp } from "../App";
|
import { useApp } from "../App";
|
||||||
import { InlineIcon } from "../InlineIcon";
|
import { InlineIcon } from "../InlineIcon";
|
||||||
|
|
||||||
import { DragInputCallbackType, SMALLEST_DELTA } from "./utils";
|
import { type DragInputCallbackType, SMALLEST_DELTA } from "./utils";
|
||||||
|
|
||||||
import "./DragInput.scss";
|
import "./DragInput.scss";
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ import type Scene from "@excalidraw/element/Scene";
|
||||||
import { fontSizeIcon } from "../icons";
|
import { fontSizeIcon } from "../icons";
|
||||||
|
|
||||||
import StatsDragInput from "./DragInput";
|
import StatsDragInput from "./DragInput";
|
||||||
import { DragInputCallbackType, getStepSizedValue } from "./utils";
|
import { type DragInputCallbackType, getStepSizedValue } from "./utils";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,11 @@ import type Scene from "@excalidraw/element/Scene";
|
||||||
import { angleIcon } from "../icons";
|
import { angleIcon } from "../icons";
|
||||||
|
|
||||||
import DragInput from "./DragInput";
|
import DragInput from "./DragInput";
|
||||||
import { DragInputCallbackType, getStepSizedValue, isPropertyEditable } from "./utils";
|
import {
|
||||||
|
type DragInputCallbackType,
|
||||||
|
getStepSizedValue,
|
||||||
|
isPropertyEditable,
|
||||||
|
} from "./utils";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ import type Scene from "@excalidraw/element/Scene";
|
||||||
|
|
||||||
import DragInput from "./DragInput";
|
import DragInput from "./DragInput";
|
||||||
import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
|
import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
|
||||||
import { DragInputCallbackType, getElementsInAtomicUnit } from "./utils";
|
import { type DragInputCallbackType, getElementsInAtomicUnit } from "./utils";
|
||||||
|
|
||||||
import type { AtomicUnit } from "./utils";
|
import type { AtomicUnit } from "./utils";
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
|
|
|
@ -10,10 +10,8 @@ import type Scene from "@excalidraw/element/Scene";
|
||||||
import StatsDragInput from "./DragInput";
|
import StatsDragInput from "./DragInput";
|
||||||
import { handlePositionChange } from "./utils";
|
import { handlePositionChange } from "./utils";
|
||||||
|
|
||||||
import type { AtomicUnit } from "./utils";
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
import { getFrameChildren } from "@excalidraw/element/frame";
|
import type { AtomicUnit } from "./utils";
|
||||||
import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
|
|
||||||
|
|
||||||
interface MultiPositionProps {
|
interface MultiPositionProps {
|
||||||
property: "x" | "y";
|
property: "x" | "y";
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import { pointFrom, pointRotateRads, round } from "@excalidraw/math";
|
import { pointFrom, pointRotateRads, round } from "@excalidraw/math";
|
||||||
|
|
||||||
import {
|
import { getFlipAdjustedCropPosition } from "@excalidraw/element/cropElement";
|
||||||
getFlipAdjustedCropPosition,
|
import { isImageElement } from "@excalidraw/element/typeChecks";
|
||||||
} from "@excalidraw/element/cropElement";
|
|
||||||
import { isFrameLikeElement, isImageElement } from "@excalidraw/element/typeChecks";
|
|
||||||
|
|
||||||
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
||||||
|
|
||||||
|
@ -13,7 +11,6 @@ import StatsDragInput from "./DragInput";
|
||||||
import { handlePositionChange } from "./utils";
|
import { handlePositionChange } from "./utils";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
import { getFrameChildren } from "@excalidraw/element/frame";
|
|
||||||
|
|
||||||
interface PositionProps {
|
interface PositionProps {
|
||||||
property: "x" | "y";
|
property: "x" | "y";
|
||||||
|
|
|
@ -7,7 +7,6 @@ import {
|
||||||
import { getBoundTextElement } from "@excalidraw/element/textElement";
|
import { getBoundTextElement } from "@excalidraw/element/textElement";
|
||||||
import { getCommonBounds } from "@excalidraw/element/bounds";
|
import { getCommonBounds } from "@excalidraw/element/bounds";
|
||||||
import {
|
import {
|
||||||
isFrameChildElement,
|
|
||||||
isFrameLikeElement,
|
isFrameLikeElement,
|
||||||
isLinearElement,
|
isLinearElement,
|
||||||
isTextElement,
|
isTextElement,
|
||||||
|
@ -19,6 +18,8 @@ import {
|
||||||
isInGroup,
|
isInGroup,
|
||||||
} from "@excalidraw/element/groups";
|
} from "@excalidraw/element/groups";
|
||||||
|
|
||||||
|
import { getFrameChildren } from "@excalidraw/element/frame";
|
||||||
|
|
||||||
import type { Radians } from "@excalidraw/math";
|
import type { Radians } from "@excalidraw/math";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
@ -30,7 +31,6 @@ import type {
|
||||||
import type Scene from "@excalidraw/element/Scene";
|
import type Scene from "@excalidraw/element/Scene";
|
||||||
|
|
||||||
import type { AppState } from "../../types";
|
import type { AppState } from "../../types";
|
||||||
import { getFrameChildren } from "@excalidraw/element/frame";
|
|
||||||
|
|
||||||
export type StatsInputProperty =
|
export type StatsInputProperty =
|
||||||
| "x"
|
| "x"
|
||||||
|
@ -194,10 +194,13 @@ export const moveElement = (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFrameLikeElement(originalElement)) {
|
if (isFrameLikeElement(originalElement)) {
|
||||||
getFrameChildren(originalElementsMap, originalElement.id).forEach(child => {
|
getFrameChildren(originalElementsMap, originalElement.id).forEach(
|
||||||
|
(child) => {
|
||||||
const latestChildElement = elementsMap.get(child.id);
|
const latestChildElement = elementsMap.get(child.id);
|
||||||
|
|
||||||
if (!latestChildElement) return;
|
if (!latestChildElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const [childCX, childCY] = [
|
const [childCX, childCY] = [
|
||||||
child.x + child.width / 2,
|
child.x + child.width / 2,
|
||||||
|
@ -244,7 +247,8 @@ export const moveElement = (
|
||||||
{ informMutation: shouldInformMutation, isDragging: false },
|
{ informMutation: shouldInformMutation, isDragging: false },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -368,9 +372,7 @@ export const updateBindings = (
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const handlePositionChange: DragInputCallbackType<
|
export const handlePositionChange: DragInputCallbackType<"x" | "y"> = ({
|
||||||
"x" | "y"
|
|
||||||
> = ({
|
|
||||||
accumulatedChange,
|
accumulatedChange,
|
||||||
originalElements,
|
originalElements,
|
||||||
originalElementsMap,
|
originalElementsMap,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue