Refactor code structure for improved readability and maintainability

This commit is contained in:
Ayesha Imran 2025-04-28 13:22:25 +05:00
parent c8d38e87b0
commit 987668c139
31 changed files with 1517 additions and 2045 deletions

View file

@ -84,5 +84,8 @@
},
"resolutions": {
"strip-ansi": "6.0.1"
},
"dependencies": {
"yarn": "1.22.22"
}
}

View file

@ -1,6 +1,11 @@
import rough from "roughjs/bin/rough";
import { rescalePoints, arrayToMap, invariant } from "@excalidraw/common";
import {
rescalePoints,
arrayToMap,
invariant,
sizeOf,
} from "@excalidraw/common";
import {
degreesToRadians,
@ -57,6 +62,7 @@ import type {
ElementsMap,
ExcalidrawRectanguloidElement,
ExcalidrawEllipseElement,
ElementsMapOrArray,
ExcalidrawRegularPolygonElement,
} from "./types";
import type { Drawable, Op } from "roughjs/bin/core";
@ -939,10 +945,10 @@ export const getElementBounds = (
};
export const getCommonBounds = (
elements: readonly ExcalidrawElement[],
elements: ElementsMapOrArray,
elementsMap?: ElementsMap,
): Bounds => {
if (!elements.length) {
if (!sizeOf(elements)) {
return [0, 0, 0, 0];
}

View file

@ -7,10 +7,11 @@ export const hasBackground = (type: ElementOrToolType) =>
type === "ellipse" ||
type === "diamond" ||
type === "line" ||
type === "regularPolygon" || // Added regularPolygon
type === "freedraw";
export const hasStrokeColor = (type: ElementOrToolType) =>
type !== "image" && type !== "frame" && type !== "magicframe";
type !== "image" && type !== "frame" && type !== "magicframe"; // regularPolygon already included by not being excluded
export const hasStrokeWidth = (type: ElementOrToolType) =>
type === "rectangle" ||
@ -20,6 +21,7 @@ export const hasStrokeWidth = (type: ElementOrToolType) =>
type === "diamond" ||
type === "freedraw" ||
type === "arrow" ||
type === "regularPolygon" || // Added regularPolygon
type === "line";
export const hasStrokeStyle = (type: ElementOrToolType) =>
@ -29,6 +31,7 @@ export const hasStrokeStyle = (type: ElementOrToolType) =>
type === "ellipse" ||
type === "diamond" ||
type === "arrow" ||
type === "regularPolygon" || // Added regularPolygon
type === "line";
export const canChangeRoundness = (type: ElementOrToolType) =>
@ -37,6 +40,7 @@ export const canChangeRoundness = (type: ElementOrToolType) =>
type === "embeddable" ||
type === "line" ||
type === "diamond" ||
type === "regularPolygon" || // Added regularPolygon
type === "image";
export const toolIsArrow = (type: ElementOrToolType) => type === "arrow";

View file

@ -2,6 +2,8 @@ import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
import { isElbowArrow, isLinearElement } from "@excalidraw/element/typeChecks";
import { arrayToMap } from "@excalidraw/common";
import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
import { DEFAULT_CATEGORIES } from "../components/CommandPalette/CommandPalette";
@ -50,7 +52,7 @@ export const actionToggleLinearEditor = register({
const editingLinearElement =
appState.editingLinearElement?.elementId === selectedElement.id
? null
: new LinearElementEditor(selectedElement);
: new LinearElementEditor(selectedElement, arrayToMap(elements));
return {
appState: {
...appState,

View file

@ -130,12 +130,14 @@ export type ScrollBars = {
y: number;
width: number;
height: number;
deltaMultiplier: number;
} | null;
vertical: {
x: number;
y: number;
width: number;
height: number;
deltaMultiplier: number;
} | null;
};

View file

@ -1219,7 +1219,7 @@ exports[`contextMenu element > selecting 'Add to library' in context menu adds e
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -1278,7 +1278,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1437,7 +1437,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -1471,7 +1471,7 @@ exports[`contextMenu element > selecting 'Bring forward' in context menu brings
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -1530,7 +1530,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1583,7 +1583,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1772,7 +1772,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -1806,7 +1806,7 @@ exports[`contextMenu element > selecting 'Bring to front' in context menu brings
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -1865,7 +1865,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1918,7 +1918,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2109,7 +2109,7 @@ exports[`contextMenu element > selecting 'Copy styles' in context menu copies st
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -2168,7 +2168,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2325,7 +2325,7 @@ exports[`contextMenu element > selecting 'Delete' in context menu deletes elemen
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -2384,7 +2384,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2571,7 +2571,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -2605,7 +2605,7 @@ exports[`contextMenu element > selecting 'Duplicate' in context menu duplicates
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -2664,7 +2664,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2717,7 +2717,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2883,7 +2883,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -2919,7 +2919,7 @@ exports[`contextMenu element > selecting 'Group selection' in context menu group
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -2978,7 +2978,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3031,7 +3031,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3285,7 +3285,7 @@ exports[`contextMenu element > selecting 'Paste styles' in context menu pastes s
"opacity": 60,
"roughness": 2,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 289600103,
"strokeColor": "#e03131",
@ -3344,7 +3344,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3397,7 +3397,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3572,6 +3572,9 @@ History {
"fillStyle": "cross-hatch",
"opacity": 60,
"roughness": 2,
"roundness": {
"type": 3,
},
"strokeColor": "#e03131",
"strokeStyle": "dotted",
},
@ -3580,6 +3583,9 @@ History {
"fillStyle": "solid",
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
},
@ -3728,7 +3734,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -3762,7 +3768,7 @@ exports[`contextMenu element > selecting 'Send backward' in context menu sends e
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -3821,7 +3827,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3874,7 +3880,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4055,7 +4061,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1014066025,
"strokeColor": "#1e1e1e",
@ -4089,7 +4095,7 @@ exports[`contextMenu element > selecting 'Send to back' in context menu sends el
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -4148,7 +4154,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4201,7 +4207,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4385,7 +4391,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -4419,7 +4425,7 @@ exports[`contextMenu element > selecting 'Ungroup selection' in context menu ung
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 238820263,
"strokeColor": "#1e1e1e",
@ -4478,7 +4484,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4531,7 +4537,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5666,7 +5672,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 453191,
"strokeColor": "#1e1e1e",
@ -5700,7 +5706,7 @@ exports[`contextMenu element > shows 'Group selection' in context menu for multi
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 400692809,
"strokeColor": "#1e1e1e",
@ -5759,7 +5765,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5812,7 +5818,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6892,7 +6898,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -6928,7 +6934,7 @@ exports[`contextMenu element > shows 'Ungroup selection' in context menu for gro
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 238820263,
"strokeColor": "#1e1e1e",
@ -6987,7 +6993,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -7040,7 +7046,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9819,7 +9825,7 @@ exports[`contextMenu element > shows context menu for element > [end of test] el
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 449462985,
"strokeColor": "#1e1e1e",
@ -9946,7 +9952,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",

View file

@ -193,7 +193,7 @@ exports[`Test dragCreate > add element to the scene when pointer dragging long e
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",

View file

@ -6176,7 +6176,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6208,7 +6208,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6240,7 +6240,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6297,7 +6297,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6351,7 +6351,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6426,7 +6426,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -7610,7 +7610,7 @@ exports[`history > multiplayer undo/redo > should iterate through the history wh
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -7668,7 +7668,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -8567,7 +8567,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -8599,7 +8599,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -8688,7 +8688,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -8741,7 +8741,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9262,7 +9262,7 @@ exports[`history > multiplayer undo/redo > should not let remote changes to inte
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9351,7 +9351,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9531,7 +9531,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9643,7 +9643,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -9799,7 +9799,7 @@ exports[`history > multiplayer undo/redo > should not override remote changes on
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#ffec99",
"strokeStyle": "solid",
@ -9856,7 +9856,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10681,7 +10681,7 @@ exports[`history > multiplayer undo/redo > should redistribute deltas when eleme
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10738,7 +10738,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11375,7 +11375,7 @@ exports[`history > multiplayer undo/redo > should update history entries after r
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11477,7 +11477,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11663,7 +11663,7 @@ exports[`history > singleplayer undo/redo > remounting undo/redo buttons should
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11721,7 +11721,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11876,7 +11876,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11908,7 +11908,7 @@ exports[`history > singleplayer undo/redo > should clear the redo stack on eleme
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11965,7 +11965,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12119,7 +12119,7 @@ exports[`history > singleplayer undo/redo > should create entry when selecting f
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12284,7 +12284,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12809,7 +12809,7 @@ exports[`history > singleplayer undo/redo > should disable undo/redo buttons whe
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12866,7 +12866,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13054,7 +13054,7 @@ exports[`history > singleplayer undo/redo > should end up with no history entry
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13111,7 +13111,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13267,7 +13267,7 @@ exports[`history > singleplayer undo/redo > should iterate through the history w
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13363,7 +13363,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13518,7 +13518,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13550,7 +13550,7 @@ exports[`history > singleplayer undo/redo > should not clear the redo stack on s
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13607,7 +13607,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13698,7 +13698,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -14595,7 +14595,7 @@ exports[`history > singleplayer undo/redo > should not override appstate changes
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -14716,7 +14716,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18437,7 +18437,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18469,7 +18469,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18501,7 +18501,7 @@ exports[`history > singleplayer undo/redo > should support changes in elements'
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18558,7 +18558,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18611,7 +18611,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -18664,7 +18664,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19438,7 +19438,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19470,7 +19470,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19502,7 +19502,7 @@ exports[`history > singleplayer undo/redo > should support element creation, del
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19559,7 +19559,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19612,7 +19612,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -19665,7 +19665,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",

View file

@ -18,7 +18,7 @@ exports[`duplicate element on move when ALT is clicked > rectangle 5`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",
@ -52,7 +52,7 @@ exports[`duplicate element on move when ALT is clicked > rectangle 6`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1604849351,
"strokeColor": "#1e1e1e",
@ -86,7 +86,7 @@ exports[`move element > rectangle 5`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",
@ -125,7 +125,7 @@ exports[`move element > rectangles with binding arrow 5`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",
@ -164,7 +164,7 @@ exports[`move element > rectangles with binding arrow 6`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1150084233,
"strokeColor": "#1e1e1e",

View file

@ -162,7 +162,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -215,7 +215,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -268,7 +268,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -580,7 +580,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -633,7 +633,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -686,7 +686,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -978,7 +978,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1031,7 +1031,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1191,7 +1191,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1734,7 +1734,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1787,7 +1787,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -1840,7 +1840,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2107,7 +2107,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2160,7 +2160,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2341,7 +2341,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2524,7 +2524,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2577,7 +2577,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -2843,7 +2843,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3070,7 +3070,7 @@ exports[`regression tests > click on an element and drag it > [dragged] element
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",
@ -3129,7 +3129,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3336,7 +3336,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3567,7 +3567,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3620,7 +3620,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3825,7 +3825,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3878,7 +3878,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -3931,7 +3931,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4136,7 +4136,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4189,7 +4189,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4588,7 +4588,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -4842,7 +4842,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5125,7 +5125,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5506,7 +5506,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5559,7 +5559,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5612,7 +5612,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -5893,7 +5893,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6178,7 +6178,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -6992,7 +6992,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -7323,7 +7323,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -8070,7 +8070,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10259,7 +10259,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10448,7 +10448,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10501,7 +10501,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10554,7 +10554,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10689,7 +10689,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10722,7 +10722,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10755,7 +10755,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10938,7 +10938,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -10991,7 +10991,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11341,7 +11341,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11545,7 +11545,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11598,7 +11598,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11859,7 +11859,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11912,7 +11912,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -11965,7 +11965,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12276,7 +12276,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12329,7 +12329,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12467,7 +12467,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -12520,7 +12520,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13012,7 +13012,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13065,7 +13065,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13118,7 +13118,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13628,7 +13628,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -13966,7 +13966,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -14473,7 +14473,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",
@ -14526,7 +14526,7 @@ History {
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"strokeColor": "#1e1e1e",
"strokeStyle": "solid",

View file

@ -185,7 +185,7 @@ exports[`select single element on the scene > rectangle 1`] = `
"opacity": 100,
"roughness": 1,
"roundness": {
"type": 3,
"type": 2,
},
"seed": 1278240551,
"strokeColor": "#1e1e1e",

View file

@ -602,6 +602,7 @@ export interface ExcalidrawProps {
) => JSX.Element | null;
aiEnabled?: boolean;
showDeprecatedFonts?: boolean;
renderScrollbars?: boolean;
}
export type SceneData = {
@ -784,6 +785,7 @@ export type UnsubscribeCallback = () => void;
export interface ExcalidrawImperativeAPI {
updateScene: InstanceType<typeof App>["updateScene"];
mutateElement: InstanceType<typeof App>["mutateElement"];
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
resetScene: InstanceType<typeof App>["resetScene"];
getSceneElementsIncludingDeleted: InstanceType<

3141
yarn.lock

File diff suppressed because it is too large Load diff