feat: support libraryReturnUrl when installing libraries (#3227)

Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
David Luzar 2021-03-13 12:35:35 +01:00 committed by GitHub
parent 47c26cd4cf
commit 91c8b6ecbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 3 deletions

View file

@ -12,6 +12,16 @@ The change should be grouped under one of the below section and must contain PR
Please add the latest change on the top under the correct section.
-->
## Unreleased
## Excalidraw API
### Features
- Support `libraryReturnUrl` prop to indicate what URL to install libraries to [#3227](https://github.com/excalidraw/excalidraw/pull/3227).
---
## 0.4.3
## Excalidraw API

View file

@ -376,6 +376,7 @@ export default function IndexPage() {
| [`viewModeEnabled`](#viewModeEnabled) | boolean | | This implies if the app is in view mode. |
| [`zenModeEnabled`](#zenModeEnabled) | boolean | | This implies if the zen mode is enabled |
| [`gridModeEnabled`](#gridModeEnabled) | boolean | | This implies if the grid mode is enabled |
| [`libraryReturnUrl`](#libraryReturnUrl) | string | | What URL should [libraries.excalidraw.com](https://libraries.excalidraw.com) be installed to |
#### `width`
@ -533,6 +534,10 @@ This prop indicates whether the app is in `zen mode`. When supplied, the value t
This prop indicates whether the shows the grid. When supplied, the value takes precedence over `intialData.appState.gridModeEnabled`, the grid will be fully controlled by the host app, and users won't be able to toggle it from within the app.
### `libraryReturnUrl`
If supplied, this URL will be used when user tries to install a library from [libraries.excalidraw.com](https://libraries.excalidraw.com). Default to `window.location.origin`.
### Extra API's
#### `getSceneVersion`

View file

@ -29,6 +29,7 @@ const Excalidraw = (props: ExcalidrawProps) => {
viewModeEnabled,
zenModeEnabled,
gridModeEnabled,
libraryReturnUrl,
} = props;
useEffect(() => {
@ -69,6 +70,7 @@ const Excalidraw = (props: ExcalidrawProps) => {
viewModeEnabled={viewModeEnabled}
zenModeEnabled={zenModeEnabled}
gridModeEnabled={gridModeEnabled}
libraryReturnUrl={libraryReturnUrl}
/>
</IsMobileProvider>
</InitializeApp>