feat: support selecting multiple library items via shift (#4306)

This commit is contained in:
David Luzar 2021-11-26 12:46:23 +01:00 committed by GitHub
parent b53d1f6f3e
commit 06db702b5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 117 additions and 67 deletions

View file

@ -15,6 +15,10 @@ Please add the latest change on the top under the correct section.
### Features
- #### BREAKING CHANGE
Removed `getElementMap` util method.
- Changes to [`exportToCanvas`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#exportToCanvas) util function:
- Add `maxWidthOrHeight?: number` attribute.

View file

@ -865,22 +865,6 @@ import { isInvisiblySmallElement } from "@excalidraw/excalidraw-next";
Returns `true` if element is invisibly small (e.g. width & height are zero).
#### `getElementMap`
**_Signature_**
<pre>
getElementsMap(elements: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement[]</a>): {[id: string]: <a href="https://github.com/excalidraw/excalidraw/blob/master/src/element/types.ts#L78">ExcalidrawElement</a>}
</pre>
**How to use**
```js
import { getElementsMap } from "@excalidraw/excalidraw-next";
```
This function returns an object where each element is mapped to its id.
#### `loadLibraryFromBlob`
```js

View file

@ -171,7 +171,6 @@ const forwardedRefComp = forwardRef<
export default React.memo(forwardedRefComp, areEqual);
export {
getSceneVersion,
getElementMap,
isInvisiblySmallElement,
getNonDeletedElements,
} from "../../element";