Virtual whiteboard for sketching hand-drawn like diagrams
fix: hide collab button when onCollabButtonClick not supplied (#2598)
David Luzar98c26642d0f4
diff --git a/src/packages/excalidraw/CHANGELOG.MD b/src/packages/excalidraw/CHANGELOG.MDindex c9caeefeda..92633cce36 100644--- a/src/packages/excalidraw/CHANGELOG.MD+++ b/src/packages/excalidraw/CHANGELOG.MD@@ -26,6 +26,7 @@ Please add the latest change on the top under the correct section.### Fixes+- Hide collab button when onCollabButtonClick not supplied [#2598](https://github.com/excalidraw/excalidraw/pull/2598)- Fix resizing the pasted charts [#2586](https://github.com/excalidraw/excalidraw/pull/2586)- Fix element visibility and zoom on cursor when canvas offset isn't 0. [#2534](https://github.com/excalidraw/excalidraw/pull/2534)- Fix Library Menu Layout [#2502](https://github.com/excalidraw/excalidraw/pull/2502)diff --git a/src/packages/excalidraw/README.md b/src/packages/excalidraw/README.mdindex 43f8214d5a..a439b9a7ed 100644--- a/src/packages/excalidraw/README.md+++ b/src/packages/excalidraw/README.md@@ -219,8 +219,8 @@ This is the user name which shows during collaboration. Defaults to `{name: ''}`#### `excalidrawRef`-You can pass a ref when you want to access some excalidraw API's.-We expose the below API's+You can pass a `ref` when you want to access some excalidraw APIs.+We expose the below APIs:| API | signature | Usage || -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |@@ -241,15 +241,15 @@ const excalidrawRef = { current: { readyPromise: <a href="https://github.com/exc#### `onCollabButtonClick`-This callback is triggered when clicked on the collab button in excalidraw+This callback is triggered when clicked on the collab button in excalidraw. If not supplied, the collab dialog button is not rendered.#### `isCollaborating`-This props implies if the app is in collaboration mode+This prop indicates if the app is in collaboration mode.#### `onPointerUpdate`-This callback is triggered when mouse pointer is updated+This callback is triggered when mouse pointer is updated.```js({ x, y }, button, pointersMap}) => void;diff --git a/src/packages/excalidraw/index.tsx b/src/packages/excalidraw/index.tsxindex 8879e48d9b..b37e211c39 100644--- a/src/packages/excalidraw/index.tsx+++ b/src/packages/excalidraw/index.tsx@@ -8,7 +8,6 @@ import "../../css/styles.scss";import { ExcalidrawAPIRefValue, ExcalidrawProps } from "../../types";import { IsMobileProvider } from "../../is-mobile";-import { noop } from "../../utils";const Excalidraw = (props: ExcalidrawProps) => {const {@@ -20,7 +19,7 @@ const Excalidraw = (props: ExcalidrawProps) => {initialData,user,excalidrawRef,- onCollabButtonClick = noop,+ onCollabButtonClick,isCollaborating,onPointerUpdate,} = props;diff --git a/src/utils.ts b/src/utils.tsindex a31a0c4a5c..821ece5706 100644--- a/src/utils.ts+++ b/src/utils.ts@@ -310,8 +310,6 @@ export const isTransparent = (color: string) => {);};-export const noop = () => ({});-export type ResolvablePromise<T> = Promise<T> & {resolve: [T] extends [undefined] ? (value?: T) => void : (value: T) => void;reject: (error: Error) => void;