Deprecate mutateElement in the codebase

This commit is contained in:
Marcel Mraz 2025-04-15 23:53:43 +02:00
parent acfa33650e
commit 11600ee6a6
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
27 changed files with 100 additions and 140 deletions

View file

@ -1,10 +1,10 @@
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { mutateElement } from "../src/mutateElement";
import { normalizeElementOrder } from "../src/sortElements";
import type { ExcalidrawElement } from "../src/types";
const { h } = window;
const assertOrder = (
elements: readonly ExcalidrawElement[],
expectedOrder: string[],
@ -35,7 +35,7 @@ describe("normalizeElementsOrder", () => {
boundElements: [],
});
mutateElement(container, {
h.app.scene.mutate(container, {
boundElements: [{ type: "text", id: boundText.id }],
});
@ -352,7 +352,7 @@ describe("normalizeElementsOrder", () => {
containerId: container.id,
});
mutateElement(container, {
h.app.scene.mutate(container, {
boundElements: [
{ type: "text", id: boundText.id },
{ type: "text", id: "xxx" },
@ -387,7 +387,7 @@ describe("normalizeElementsOrder", () => {
boundElements: [],
groupIds: ["C", "A"],
});
mutateElement(container, {
h.app.scene.mutate(container, {
boundElements: [{ type: "text", id: boundText.id }],
});