feat: export MIME_TYPES supported by excalidraw (#5135)

* feat: export MIME_TYPES supported by excalidraw

* Update src/packages/excalidraw/CHANGELOG.md
This commit is contained in:
Aakansha Doshi 2022-05-02 15:47:03 +05:30 committed by GitHub
parent 9e6d5fdbcb
commit aae8e2fa5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -17,6 +17,7 @@ Please add the latest change on the top under the correct section.
#### Features
- Export [`MIME_TYPES`](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L92) supported by Excalidraw [#5135](https://github.com/excalidraw/excalidraw/pull/5135).
- Support [`src`](https://github.com/excalidraw/excalidraw/blob/master/src/types.ts#L50) for collaborators. Now onwards host can pass `src` to render the customized avatar for collaborators [#5114](https://github.com/excalidraw/excalidraw/pull/5114).
- Support `libraryItems` argument in `initialData.libraryItems` and `updateScene({ libraryItems })` to be a Promise resolving to `LibraryItems`, and support functional update of `libraryItems` in [`updateScene({ libraryItems })`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#updateScene). [#5101](https://github.com/excalidraw/excalidraw/pull/5101).
- Expose util [`mergeLibraryItems`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#mergeLibraryItems) [#5101](https://github.com/excalidraw/excalidraw/pull/5101).

View File

@ -1123,6 +1123,16 @@ import { THEME } from "@excalidraw/excalidraw-next";
Defaults to `THEME.LIGHT` unless passed in `initialData.appState.theme`
### `MIME_TYPES`
**How to use **
```js
import { MIME_TYPES } from "@excalidraw/excalidraw-next";
```
[`MIME_TYPES`](https://github.com/excalidraw/excalidraw/blob/master/src/constants.ts#L92) contains all the mime types supported by `Excalidraw`.
## Need help?
Check out the existing [Q&A](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw). If you have any queries or need help, ask us [here](https://github.com/excalidraw/excalidraw/discussions?discussions_q=label%3Apackage%3Aexcalidraw).

View File

@ -5,7 +5,6 @@ import Sidebar from "./sidebar/Sidebar";
import "./App.scss";
import initialData from "./initialData";
import { MIME_TYPES } from "../../../constants";
// This is so that we use the bundled excalidraw.development.js file instead
// of the actual source code
@ -16,7 +15,9 @@ const {
exportToBlob,
exportToClipboard,
Excalidraw,
MIME_TYPES,
} = window.ExcalidrawLib;
const resolvablePromise = () => {
let resolve;
let reject;

View File

@ -202,7 +202,7 @@ export {
} from "../../packages/utils";
export { isLinearElement } from "../../element/typeChecks";
export { FONT_FAMILY, THEME } from "../../constants";
export { FONT_FAMILY, THEME, MIME_TYPES } from "../../constants";
export {
mutateElement,