Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

refactor: Fix Typo (#7445)

Adithyan7bd6496854d9
diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx
index ff80ed5b0b..cdecbf3426 100644
--- a/packages/excalidraw/components/App.tsx
+++ b/packages/excalidraw/components/App.tsx
@@ -439,7 +439,7 @@ ExcalidrawAppStateContext.displayName = "ExcalidrawAppStateContext";
const ExcalidrawSetAppStateContext = React.createContext<
React.Component<any, AppState>["setState"]
>(() => {
- console.warn("unitialized ExcalidrawSetAppStateContext context!");
+ console.warn("Uninitialized ExcalidrawSetAppStateContext context!");
});
ExcalidrawSetAppStateContext.displayName = "ExcalidrawSetAppStateContext";
@@ -2867,7 +2867,6 @@ class App extends React.Component<AppProps, AppState> {
// event else some browsers (FF...) will clear the clipboardData
// (something something security)
let file = event?.clipboardData?.files[0];
-
const data = await parseClipboard(event, isPlainPaste);
if (!file && !isPlainPaste) {
if (data.mixedContent) {
@@ -3370,7 +3369,7 @@ class App extends React.Component<AppProps, AppState> {
});
};
- private cancelInProgresAnimation: (() => void) | null = null;
+ private cancelInProgressAnimation: (() => void) | null = null;
scrollToContent = (
target:
@@ -3395,7 +3394,7 @@ class App extends React.Component<AppProps, AppState> {
duration?: number;
},
) => {
- this.cancelInProgresAnimation?.();
+ this.cancelInProgressAnimation?.();
// convert provided target into ExcalidrawElement[] if necessary
const targetElements = Array.isArray(target) ? target : [target];
@@ -3462,9 +3461,9 @@ class App extends React.Component<AppProps, AppState> {
duration: opts?.duration ?? 500,
});
- this.cancelInProgresAnimation = () => {
+ this.cancelInProgressAnimation = () => {
cancel();
- this.cancelInProgresAnimation = null;
+ this.cancelInProgressAnimation = null;
};
} else {
this.setState({ scrollX, scrollY, zoom });
@@ -3481,7 +3480,7 @@ class App extends React.Component<AppProps, AppState> {
private translateCanvas: React.Component<any, AppState>["setState"] = (
state,
) => {
- this.cancelInProgresAnimation?.();
+ this.cancelInProgressAnimation?.();
this.maybeUnfollowRemoteUser();
this.setState(state);
};
@@ -7779,7 +7778,7 @@ class App extends React.Component<AppProps, AppState> {
),
};
});
- // if not gragging a linear element point (outside editor)
+ // if not dragging a linear element point (outside editor)
} else if (!this.state.selectedLinearElement?.isDragging) {
// remove element from selection while
// keeping prev elements selected
@@ -8104,7 +8103,10 @@ class App extends React.Component<AppProps, AppState> {
maxWidthOrHeight: DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
});
} catch (error: any) {
- console.error("error trying to resing image file on insertion", error);
+ console.error(
+ "Error trying to resizing image file on insertion",
+ error,
+ );
}
if (imageFile.size > MAX_ALLOWED_FILE_BYTES) {
@@ -8647,7 +8649,7 @@ class App extends React.Component<AppProps, AppState> {
}
if (file) {
- // atetmpt to parse an excalidraw/excalidrawlib file
+ // Attempt to parse an excalidraw/excalidrawlib file
await this.loadFileToCanvas(file, fileHandle);
}
@@ -8746,13 +8748,13 @@ class App extends React.Component<AppProps, AppState> {
});
const selectedElements = this.scene.getSelectedElements(this.state);
- const isHittignCommonBoundBox =
+ const isHittingCommonBoundBox =
this.isHittingCommonBoundingBoxOfSelectedElements(
{ x, y },
selectedElements,
);
- const type = element || isHittignCommonBoundBox ? "element" : "canvas";
+ const type = element || isHittingCommonBoundBox ? "element" : "canvas";
const container = this.excalidrawContainerRef.current!;
const { top: offsetTop, left: offsetLeft } =
diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts
index a4a0b01130..249ead30d7 100644
--- a/packages/excalidraw/types.ts
+++ b/packages/excalidraw/types.ts
@@ -53,7 +53,7 @@ export type Collaborator = Readonly<{
background: string;
stroke: string;
};
- // The url of the collaborator's avatar, defaults to username intials
+ // The url of the collaborator's avatar, defaults to username initials
// if not present
avatarUrl?: string;
// user id. If supplied, we'll filter out duplicates when rendering user avatars.
@@ -500,10 +500,10 @@ export type ExportOpts = {
) => JSX.Element;
};
-// NOTE at the moment, if action name coressponds to canvasAction prop, its
+// NOTE at the moment, if action name corresponds to canvasAction prop, its
// truthiness value will determine whether the action is rendered or not
// (see manager renderAction). We also override canvasAction values in
-// excalidraw package index.tsx.
+// Excalidraw package index.tsx.
export type CanvasActions = Partial<{
changeViewBackgroundColor: boolean;
clearCanvas: boolean;