From 8946b2637f46d07f3312c6e1a79dfeb21693caad Mon Sep 17 00:00:00 2001 From: dwelle Date: Sat, 23 Oct 2021 13:48:02 +0200 Subject: [PATCH] update changelog & readme --- src/packages/excalidraw/CHANGELOG.md | 4 +++- src/packages/excalidraw/README_NEXT.md | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md index 7c475086c..65cdcd5de 100644 --- a/src/packages/excalidraw/CHANGELOG.md +++ b/src/packages/excalidraw/CHANGELOG.md @@ -21,7 +21,7 @@ Please add the latest change on the top under the correct section. - File data are encoded as DataURLs (base64) for portability reasons. - [ExcalidrawAPI](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#onLibraryChange): + [ExcalidrawAPI](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#ref): - added `getFiles()` to get current `BinaryFiles` (`Record`). It may contain files that aren't referenced by any element, so if you're persisting the files to a storage, you should compare them against stored elements. @@ -37,6 +37,8 @@ Please add the latest change on the top under the correct section. - `.excalidraw` files may now contain top-level `files` key in format of `Record` when exporting any (image) elements. - Changes were made to various export utilityies exported from the package so that they take `files`. For now, TypeScript should help you figure the changes out. +- Expose App instance from [ExcalidrawAPI](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#ref) [#4088](https://github.com/excalidraw/excalidraw/pull/4088). + ## Excalidraw API ### Features diff --git a/src/packages/excalidraw/README_NEXT.md b/src/packages/excalidraw/README_NEXT.md index 920f30ba5..14db5dc0f 100644 --- a/src/packages/excalidraw/README_NEXT.md +++ b/src/packages/excalidraw/README_NEXT.md @@ -449,6 +449,7 @@ You can pass a `ref` when you want to access some excalidraw APIs. We expose the | --- | --- | --- | | ready | `boolean` | This is set to true once Excalidraw is rendered | | readyPromise | [resolvablePromise](https://github.com/excalidraw/excalidraw/blob/master/src/utils.ts#L317) | This promise will be resolved with the api once excalidraw has rendered. This will be helpful when you want do some action on the host app once this promise resolves. For this to work you will have to pass ref as shown [here](#readyPromise) | +| [app](#app) | [`InstanceType`](https://github.com/excalidraw/excalidraw/blob/master/src/components/App.tsx) | Excalidraw App instance | | [updateScene](#updateScene) |
(scene: sceneData) => void 
| updates the scene with the sceneData | | [addFiles](#addFiles) |
(files: BinaryFileData) => void 
| add files data to the appState | | resetScene | `({ resetLoadingState: boolean }) => void` | Resets the scene. If `resetLoadingState` is passed as true then it will also force set the loading state to false. | @@ -470,6 +471,10 @@ const excalidrawRef = { current: { readyPromise: