From 7bd6496854d95ea3b25576308a4b47cdac20b3fa Mon Sep 17 00:00:00 2001 From: Adithyan <123532141+golok727@users.noreply.github.com> Date: Sat, 16 Dec 2023 23:53:11 +0530 Subject: [PATCH] refactor: Fix Typo (#7445) --- packages/excalidraw/components/App.tsx | 26 ++++++++++++++------------ packages/excalidraw/types.ts | 6 +++--- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index ff80ed5b..cdecbf34 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["setState"] >(() => { - console.warn("unitialized ExcalidrawSetAppStateContext context!"); + console.warn("Uninitialized ExcalidrawSetAppStateContext context!"); }); ExcalidrawSetAppStateContext.displayName = "ExcalidrawSetAppStateContext"; @@ -2867,7 +2867,6 @@ class App extends React.Component { // 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 { }); }; - private cancelInProgresAnimation: (() => void) | null = null; + private cancelInProgressAnimation: (() => void) | null = null; scrollToContent = ( target: @@ -3395,7 +3394,7 @@ class App extends React.Component { 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 { 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 { private translateCanvas: React.Component["setState"] = ( state, ) => { - this.cancelInProgresAnimation?.(); + this.cancelInProgressAnimation?.(); this.maybeUnfollowRemoteUser(); this.setState(state); }; @@ -7779,7 +7778,7 @@ class App extends React.Component { ), }; }); - // 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 { 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 { } 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 { }); 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 a4a0b011..249ead30 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;